Based on Nekogram. Key additions: - Rebrand to FoxiGram (app name, APK name, applicationId com.foxigram.app) - Embedded Xray (VLESS+Reality) proxy client via JNI libxray.so - Bundled hidden one-tap proxies (LTE + WiFi), read-only in UI - Auto-restore proxy on restart, rebind to active network (LTE/WiFi) - Server credentials externalized to git-ignored XrayServers.java (+ template) - libxray Go source included; compiled .so, keystore, google-services.json ignored
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
// Copyright 2018 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "base/containers/intrusive_heap.h"
|
|
|
|
#include "base/logging.h"
|
|
#include "base/memory/ptr_util.h"
|
|
|
|
namespace base {
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// HeapHandle
|
|
|
|
// static
|
|
HeapHandle HeapHandle::Invalid() {
|
|
return HeapHandle();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// InternalHeapHandleStorage
|
|
|
|
InternalHeapHandleStorage::InternalHeapHandleStorage()
|
|
: handle_(new HeapHandle()) {}
|
|
|
|
InternalHeapHandleStorage::InternalHeapHandleStorage(
|
|
InternalHeapHandleStorage&& other) noexcept
|
|
: handle_(std::move(other.handle_)) {
|
|
DCHECK(intrusive_heap::IsInvalid(other.handle_));
|
|
}
|
|
|
|
InternalHeapHandleStorage::~InternalHeapHandleStorage() = default;
|
|
|
|
InternalHeapHandleStorage& InternalHeapHandleStorage::operator=(
|
|
InternalHeapHandleStorage&& other) noexcept {
|
|
handle_ = std::move(other.handle_);
|
|
DCHECK(intrusive_heap::IsInvalid(other.handle_));
|
|
return *this;
|
|
}
|
|
|
|
void InternalHeapHandleStorage::swap(
|
|
InternalHeapHandleStorage& other) noexcept {
|
|
std::swap(handle_, other.handle_);
|
|
}
|
|
|
|
} // namespace base
|