blob: b767ea0975c27fa5187a91b11d5689db3517cc00 [file] [log] [blame]
// Copyright 2016 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 "build/build_config.h"
#include "mojo/edk/embedder/scoped_platform_handle.h"
#include "mojo/edk/system/system_impl_export.h"
#if defined(OS_WIN)
#include "base/strings/string16.h"
namespace mojo {
namespace edk {
struct NamedPlatformHandle;
#if defined(OS_POSIX)
// The maximum length of the name of a unix domain socket. The standard size on
// linux is 108, mac is 104. To maintain consistency across platforms we
// standardize on the smaller value.
const size_t kMaxSocketNameLength = 104;
struct CreateServerHandleOptions {
#if defined(OS_WIN)
// If true, creating a server handle will fail if another pipe with the same
// name exists.
bool enforce_uniqueness = true;
// If non-empty, a security descriptor to use when creating the pipe. If
// empty, a default security descriptor will be used. See
// kDefaultSecurityDescriptor in
base::string16 security_descriptor;
// Creates a client platform handle from |handle|. This may block until |handle|
// is ready to receive connections.
CreateClientHandle(const NamedPlatformHandle& handle);
// Creates a server platform handle from |handle|.
CreateServerHandle(const NamedPlatformHandle& handle,
const CreateServerHandleOptions& options = {});
} // namespace edk
} // namespace mojo