chromium/mojo/public/cpp/platform/platform_channel_endpoint.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "mojo/public/cpp/platform/platform_channel_endpoint.h"

#include <string>
#include <string_view>
#include <tuple>
#include <utility>

#include "base/command_line.h"
#include "base/logging.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "mojo/public/cpp/platform/platform_channel.h"

#if BUILDFLAG(MOJO_USE_APPLE_CHANNEL)
#include <mach/port.h>

#include "base/apple/scoped_mach_port.h"
#include "base/mac/mach_port_rendezvous.h"
#elif BUILDFLAG(IS_FUCHSIA)
#include <lib/zx/handle.h>
#elif BUILDFLAG(IS_POSIX)
#include "base/files/scoped_file.h"
#include "base/posix/global_descriptors.h"
#elif BUILDFLAG(IS_WIN)
#include <windows.h>

#include "base/win/scoped_handle.h"
#endif

#if BUILDFLAG(IS_ANDROID)
#include "base/android/binder.h"
#endif

namespace mojo {

namespace {

#if BUILDFLAG(IS_ANDROID)
// Leave room for any other descriptors defined in content for example.
// TODO(crbug.com/40499227): Consider changing base::GlobalDescriptors to
// generate a key when setting the file descriptor.
constexpr int kAndroidClientHandleDescriptor =
    base::GlobalDescriptors::kBaseDescriptor + 10000;
constexpr std::string_view kBinderValuePrefix = "binder:";
#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(MOJO_USE_APPLE_CHANNEL)
bool IsTargetDescriptorUsed(const base::FileHandleMappingVector& mapping,
                            int target_fd) {}
#endif

}  // namespace

PlatformChannelEndpoint::PlatformChannelEndpoint() = default;

PlatformChannelEndpoint::PlatformChannelEndpoint(
    PlatformChannelEndpoint&& other) = default;

PlatformChannelEndpoint::PlatformChannelEndpoint(PlatformHandle handle)
    :{}

PlatformChannelEndpoint::~PlatformChannelEndpoint() = default;

PlatformChannelEndpoint& PlatformChannelEndpoint::operator=(
    PlatformChannelEndpoint&& other) = default;

void PlatformChannelEndpoint::reset() {}

PlatformChannelEndpoint PlatformChannelEndpoint::Clone() const {}

void PlatformChannelEndpoint::PrepareToPass(HandlePassingInfo& info,
                                            base::CommandLine& command_line) {}

void PlatformChannelEndpoint::PrepareToPass(HandlePassingInfo& info,
                                            std::string& value) {}

void PlatformChannelEndpoint::PrepareToPass(base::LaunchOptions& options,
                                            base::CommandLine& command_line) {}

std::string PlatformChannelEndpoint::PrepareToPass(
    base::LaunchOptions& options) {}

void PlatformChannelEndpoint::ProcessLaunchAttempted() {}

// static
PlatformChannelEndpoint PlatformChannelEndpoint::RecoverFromString(
    std::string_view value) {}

}  // namespace mojo