diff options
Diffstat (limited to 'mojo/platform_handle')
-rw-r--r-- | mojo/platform_handle/BUILD.gn | 29 | ||||
-rw-r--r-- | mojo/platform_handle/platform_handle.h | 16 | ||||
-rw-r--r-- | mojo/platform_handle/platform_handle_exports.h | 33 | ||||
-rw-r--r-- | mojo/platform_handle/platform_handle_functions.h | 27 | ||||
-rw-r--r-- | mojo/platform_handle/platform_handle_private_thunks.cc | 38 | ||||
-rw-r--r-- | mojo/platform_handle/platform_handle_private_thunks.h | 31 |
6 files changed, 0 insertions, 174 deletions
diff --git a/mojo/platform_handle/BUILD.gn b/mojo/platform_handle/BUILD.gn deleted file mode 100644 index a9d98a0..0000000 --- a/mojo/platform_handle/BUILD.gn +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2015 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. - -source_set("platform_handle") { - sources = [ - "platform_handle_private_thunks.cc", - "platform_handle_private_thunks.h", - ] - - deps = [ - ":defs", - "//third_party/mojo/src/mojo/public/c/system", - ] - - defines = [ "PLATFORM_HANDLE_IMPLEMENTATION" ] -} - -# Only targets that are registering the thunks should depend upon this. -source_set("defs") { - visibility = [ - ":platform_handle", - "//mojo/runner:native_application_support", - ] - sources = [ - "native_exports.h", - "platform_handle_functions.h", - ] -} diff --git a/mojo/platform_handle/platform_handle.h b/mojo/platform_handle/platform_handle.h deleted file mode 100644 index e07bfce..0000000 --- a/mojo/platform_handle/platform_handle.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 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_PLATFORM_HANDLE_PLATFORM_HANDLE_H_ -#define MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_H_ - -#include "build/build_config.h" - -#if defined(OS_WIN) -typedef HANDLE MojoPlatformHandle; -#elif defined(OS_POSIX) -typedef int MojoPlatformHandle; -#endif - -#endif // MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_ diff --git a/mojo/platform_handle/platform_handle_exports.h b/mojo/platform_handle/platform_handle_exports.h deleted file mode 100644 index 6c57f9b..0000000 --- a/mojo/platform_handle/platform_handle_exports.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015 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_PLATFORM_HANDLE_PLATFORM_HANDLE_EXPORTS_H_ -#define MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_EXPORTS_H_ - -#if defined(COMPONENT_BUILD) && defined(MOJO_USE_SYSTEM_IMPL) -#if defined(WIN32) - -#if defined(PLATFORM_HANDLE_IMPLEMENTATION) -#define PLATFORM_HANDLE_EXPORT __declspec(dllexport) -#else -#define PLATFORM_HANDLE_EXPORT __declspec(dllimport) -#endif - -#else // !defined(WIN32) - -#if defined(PLATFORM_HANDLE_IMPLEMENTATION) -#define PLATFORM_HANDLE_EXPORT __attribute__((visibility("default"))) -#else -#define PLATFORM_HANDLE_EXPORT -#endif - -#endif // defined(WIN32) - -#else // !defined(COMPONENT_BUILD) || !defined(MOJO_USE_SYSTEM_IMPL) - -#define PLATFORM_HANDLE_EXPORT - -#endif // defined(COMPONENT_BUILD) && defined(MOJO_USE_SYSTEM_IMPL) - -#endif // MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_EXPORTS_H_ diff --git a/mojo/platform_handle/platform_handle_functions.h b/mojo/platform_handle/platform_handle_functions.h deleted file mode 100644 index dec5d1f..0000000 --- a/mojo/platform_handle/platform_handle_functions.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2015 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_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_ -#define MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_ - -#include "mojo/platform_handle/platform_handle.h" -#include "mojo/platform_handle/platform_handle_exports.h" -#include "third_party/mojo/src/mojo/public/c/system/types.h" - -extern "C" { - -// Wraps |platform_handle| in a MojoHandle so that it can transported, returns -// true on success. This takes ownership of |platform_handle|, regardless of -// whether this succeeds. -PLATFORM_HANDLE_EXPORT MojoResult -MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle, - MojoHandle* wrapper); - -PLATFORM_HANDLE_EXPORT MojoResult -MojoExtractPlatformHandle(MojoHandle wrapper, - MojoPlatformHandle* platform_handle); - -} // extern "C" - -#endif // MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_FUNCTIONS_H_ diff --git a/mojo/platform_handle/platform_handle_private_thunks.cc b/mojo/platform_handle/platform_handle_private_thunks.cc deleted file mode 100644 index 1b21098..0000000 --- a/mojo/platform_handle/platform_handle_private_thunks.cc +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015 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 "mojo/platform_handle/platform_handle_private_thunks.h" - -#include <assert.h> - -#if defined(WIN32) -#define THUNK_EXPORT __declspec(dllexport) -#else -#define THUNK_EXPORT __attribute__((visibility("default"))) -#endif - -extern "C" { - -static MojoPlatformHandlePrivateThunks g_thunks = {0}; - -MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle, - MojoHandle* wrapper) { - assert(g_thunks.CreatePlatformHandleWrapper); - return g_thunks.CreatePlatformHandleWrapper(platform_handle, wrapper); -} - -MojoResult MojoExtractPlatformHandle(MojoHandle wrapper, - MojoPlatformHandle* platform_handle) { - assert(g_thunks.ExtractPlatformHandle); - return g_thunks.ExtractPlatformHandle(wrapper, platform_handle); -} - -extern "C" THUNK_EXPORT size_t MojoSetPlatformHandlePrivateThunks( - const MojoPlatformHandlePrivateThunks* thunks) { - if (thunks->size >= sizeof(g_thunks)) - g_thunks = *thunks; - return sizeof(g_thunks); -} - -} // extern "C" diff --git a/mojo/platform_handle/platform_handle_private_thunks.h b/mojo/platform_handle/platform_handle_private_thunks.h deleted file mode 100644 index 285497a..0000000 --- a/mojo/platform_handle/platform_handle_private_thunks.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015 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_PLATFORM_HANDLE_PLATFORM_HANDLE_PRIVATE_THUNKS_H_ -#define MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_PRIVATE_THUNKS_H_ - -#include <stddef.h> - -#include "mojo/platform_handle/platform_handle_functions.h" - -#pragma pack(push, 8) -struct MojoPlatformHandlePrivateThunks { - size_t size; // Should be set to sizeof(PlatformHandleThunks). - MojoResult (*CreatePlatformHandleWrapper)(MojoPlatformHandle, MojoHandle*); - MojoResult (*ExtractPlatformHandle)(MojoHandle, MojoPlatformHandle*); -}; -#pragma pack(pop) - -inline MojoPlatformHandlePrivateThunks MojoMakePlatformHandlePrivateThunks() { - MojoPlatformHandlePrivateThunks system_thunks = { - sizeof(MojoPlatformHandlePrivateThunks), - MojoCreatePlatformHandleWrapper, - MojoExtractPlatformHandle}; - return system_thunks; -} - -typedef size_t (*MojoSetPlatformHandlePrivateThunksFn)( - const struct MojoPlatformHandlePrivateThunks* thunks); - -#endif // MOJO_PLATFORM_HANDLE_PLATFORM_HANDLE_PRIVATE_THUNKS_H_ |