Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: mojo/runner/platform_handle_impl.cc

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to mojo::edk namespace in preparation for runtim flag Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/runner/platform_handle_impl.cc
diff --git a/mojo/runner/platform_handle_impl.cc b/mojo/runner/platform_handle_impl.cc
index c5e79997a5f140b02075f4cc3057c098431def72..dab5c13eec525c81e844bffa97cb00022d7f1d7f 100644
--- a/mojo/runner/platform_handle_impl.cc
+++ b/mojo/runner/platform_handle_impl.cc
@@ -3,24 +3,43 @@
// found in the LICENSE file.
#include "mojo/platform_handle/platform_handle.h"
+
+#if defined(USE_CHROME_EDK)
+#include "mojo/edk/embedder/embedder.h"
+#else
#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
+#endif
extern "C" {
MojoResult MojoCreatePlatformHandleWrapper(MojoPlatformHandle platform_handle,
MojoHandle* wrapper) {
+#if defined(USE_CHROME_EDK)
+ mojo::edk::PlatformHandle platform_handle_wrapper(platform_handle);
+ mojo::edk::ScopedPlatformHandle scoped_platform_handle(
+ platform_handle_wrapper);
+ return mojo::edk::CreatePlatformHandleWrapper(
+ scoped_platform_handle.Pass(), wrapper);
+#else
mojo::embedder::PlatformHandle platform_handle_wrapper(platform_handle);
mojo::embedder::ScopedPlatformHandle scoped_platform_handle(
platform_handle_wrapper);
return mojo::embedder::CreatePlatformHandleWrapper(
scoped_platform_handle.Pass(), wrapper);
+#endif
}
MojoResult MojoExtractPlatformHandle(MojoHandle wrapper,
MojoPlatformHandle* platform_handle) {
+#if defined(USE_CHROME_EDK)
+ mojo::edk::ScopedPlatformHandle scoped_platform_handle;
+ MojoResult result = mojo::edk::PassWrappedPlatformHandle(
+ wrapper, &scoped_platform_handle);
+#else
mojo::embedder::ScopedPlatformHandle scoped_platform_handle;
MojoResult result = mojo::embedder::PassWrappedPlatformHandle(
wrapper, &scoped_platform_handle);
+#endif
if (result != MOJO_RESULT_OK)
return result;

Powered by Google App Engine
This is Rietveld 408576698