#include "mojo/core/ipcz_driver/base_shared_memory_service.h"
#include <tuple>
#include <utility>
#include "base/containers/circular_deque.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/shared_memory_hooks.h"
#include "base/memory/shared_memory_mapping.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/memory/writable_shared_memory_region.h"
#include "base/process/process.h"
#include "build/build_config.h"
#include "mojo/core/broker.h"
#include "mojo/core/broker_host.h"
#include "mojo/core/connection_params.h"
#include "mojo/core/ipcz_api.h"
#include "mojo/core/ipcz_driver/transport.h"
#include "mojo/core/scoped_ipcz_handle.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/platform/platform_channel_endpoint.h"
#include "third_party/ipcz/include/ipcz/ipcz.h"
#define SHARED_MEMORY_SERVICE_REQUIRED() …
namespace mojo::core::ipcz_driver {
namespace {
#if SHARED_MEMORY_SERVICE_REQUIRED()
void CreateBrokerHostOnIOThread(PlatformChannelEndpoint endpoint) { … }
void CreateServiceFromNextParcel(ScopedIpczHandle portal) { … }
void WaitForClientConnection(ScopedIpczHandle portal) { … }
Broker* g_client = …;
#endif
base::WritableSharedMemoryRegion CreateWritableSharedMemoryRegion(size_t size) { … }
base::MappedReadOnlyRegion CreateReadOnlySharedMemoryRegion(
size_t size,
base::SharedMemoryMapper* mapper) { … }
base::UnsafeSharedMemoryRegion CreateUnsafeSharedMemoryRegion(size_t size) { … }
}
void BaseSharedMemoryService::CreateService(ScopedIpczHandle portal) { … }
void BaseSharedMemoryService::CreateClient(ScopedIpczHandle portal) { … }
void BaseSharedMemoryService::InstallHooks() { … }
base::WritableSharedMemoryRegion BaseSharedMemoryService::CreateWritableRegion(
size_t size) { … }
}