diff options
Diffstat (limited to 'mojo/edk/embedder/named_platform_handle.h')
-rw-r--r-- | mojo/edk/embedder/named_platform_handle.h | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/mojo/edk/embedder/named_platform_handle.h b/mojo/edk/embedder/named_platform_handle.h deleted file mode 100644 index 15ca656..0000000 --- a/mojo/edk/embedder/named_platform_handle.h +++ /dev/null @@ -1,51 +0,0 @@ -// 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. - -#ifndef MOJO_EDK_EMBEDDER_NAMED_PLATFORM_HANDLE_H_ -#define MOJO_EDK_EMBEDDER_NAMED_PLATFORM_HANDLE_H_ - -#include <string> - -#include "base/strings/string16.h" -#include "base/strings/string_piece.h" -#include "base/strings/utf_string_conversions.h" -#include "build/build_config.h" -#include "mojo/edk/system/system_impl_export.h" - -namespace mojo { -namespace edk { - -#if defined(OS_POSIX) -struct MOJO_SYSTEM_IMPL_EXPORT NamedPlatformHandle { - NamedPlatformHandle() {} - explicit NamedPlatformHandle(const base::StringPiece& name) - : name(name.as_string()) {} - - bool is_valid() const { return !name.empty(); } - - std::string name; -}; -#elif defined(OS_WIN) -struct MOJO_SYSTEM_IMPL_EXPORT NamedPlatformHandle { - NamedPlatformHandle() {} - explicit NamedPlatformHandle(const base::StringPiece& name) - : name(base::UTF8ToUTF16(name)) {} - - explicit NamedPlatformHandle(const base::StringPiece16& name) - : name(name.as_string()) {} - - bool is_valid() const { return !name.empty(); } - - base::string16 pipe_name() const { return L"\\\\.\\pipe\\mojo." + name; } - - base::string16 name; -}; -#else -#error "Platform not yet supported." -#endif - -} // namespace edk -} // namespace mojo - -#endif // MOJO_EDK_EMBEDDER_NAMED_PLATFORM_HANDLE_H_ |