chromium/mojo/public/cpp/platform/named_platform_channel_posix.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/named_platform_channel.h"

#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>

#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "net/base/sockaddr_storage.h"
#include "net/base/sockaddr_util_posix.h"

namespace mojo {

namespace {

NamedPlatformChannel::ServerName GenerateRandomServerName(
    const NamedPlatformChannel::Options& options) {}

// This function fills in |addr_storage| with the appropriate data for the
// socket as well as the data's length. Returns true on success, or false on
// failure (typically because |server_name| violated the naming rules). On
// Linux and Android, setting |use_abstract_namespace| to true will return a
// socket address for an abstract non-filesystem socket.
bool MakeUnixAddr(const NamedPlatformChannel::ServerName& server_name,
                  bool use_abstract_namespace,
                  net::SockaddrStorage* addr_storage) {}

// This function creates a unix domain socket, and set it as non-blocking.
// If successful, this returns a PlatformHandle containing the socket.
// Otherwise, this returns an invalid PlatformHandle.
PlatformHandle CreateUnixDomainSocket() {}

}  // namespace

// static
PlatformChannelServerEndpoint NamedPlatformChannel::CreateServerEndpoint(
    const Options& options,
    ServerName* server_name) {}

// static
PlatformChannelEndpoint NamedPlatformChannel::CreateClientEndpoint(
    const Options& options) {}

}  // namespace mojo