summaryrefslogtreecommitdiffstats
path: root/mojo/platform_handle
diff options
context:
space:
mode:
authorsky <sky@chromium.org>2015-05-01 11:24:37 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-01 18:26:05 +0000
commit781e65d533b63593da93b0fbaf2a181bffc57451 (patch)
treef8661e2f864614b15355e4a0b1aafca62f62b372 /mojo/platform_handle
parent0aecd69f2612fb8dab768900e4b2061b56ffb236 (diff)
downloadchromium_src-781e65d533b63593da93b0fbaf2a181bffc57451.zip
chromium_src-781e65d533b63593da93b0fbaf2a181bffc57451.tar.gz
chromium_src-781e65d533b63593da93b0fbaf2a181bffc57451.tar.bz2
Revert of Adds thunks for getting platform handles (patchset #3 id:40001 of https://codereview.chromium.org/1113393002/)
Reason for revert: Broke build. Original issue's description: > Adds thunks for getting platform handles > > BUG=none > TEST=none > R=viettrungluu@chromium.org > > Committed: https://crrev.com/8f7386b022c30b46325f8c67ba4d04d33606103b > Cr-Commit-Position: refs/heads/master@{#327937} TBR=viettrungluu@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=none Review URL: https://codereview.chromium.org/1123453003 Cr-Commit-Position: refs/heads/master@{#327945}
Diffstat (limited to 'mojo/platform_handle')
-rw-r--r--mojo/platform_handle/BUILD.gn29
-rw-r--r--mojo/platform_handle/platform_handle.h16
-rw-r--r--mojo/platform_handle/platform_handle_exports.h33
-rw-r--r--mojo/platform_handle/platform_handle_functions.h27
-rw-r--r--mojo/platform_handle/platform_handle_private_thunks.cc38
-rw-r--r--mojo/platform_handle/platform_handle_private_thunks.h31
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_