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

Unified Diff: third_party/mojo/src/mojo/edk/embedder/embedder.cc

Issue 1465183005: Rename mojo::TokenSerializer to mojo::Broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win component Created 5 years, 1 month 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: third_party/mojo/src/mojo/edk/embedder/embedder.cc
diff --git a/third_party/mojo/src/mojo/edk/embedder/embedder.cc b/third_party/mojo/src/mojo/edk/embedder/embedder.cc
index 31ec8930675c7bfc095343e0c4f723de70d0004b..671dc78cd138021caf44aefa7178bad2a06f67b7 100644
--- a/third_party/mojo/src/mojo/edk/embedder/embedder.cc
+++ b/third_party/mojo/src/mojo/edk/embedder/embedder.cc
@@ -92,29 +92,47 @@ system::ChannelId MakeChannelId() {
return static_cast<system::ChannelId>(-new_counter_value);
}
-} // namespace
-
+edk::ScopedPlatformHandle CreateEDKHandle(ScopedPlatformHandle handle) {
+ return edk::ScopedPlatformHandle(edk::PlatformHandle(
#if defined(OS_WIN)
-void PreInitializeParentProcess() {
- edk::PreInitializeParentProcess();
+ handle.release().handle));
+#else
+ handle.release().fd));
+#endif
}
-void PreInitializeChildProcess() {
- edk::PreInitializeChildProcess();
+ScopedPlatformHandle CreateHandle(edk::ScopedPlatformHandle handle) {
+ return ScopedPlatformHandle(PlatformHandle(
+#if defined(OS_WIN)
+ handle.release().handle));
+#else
+ handle.release().fd));
+#endif
}
-HANDLE ChildProcessLaunched(HANDLE child_process) {
- return edk::ChildProcessLaunched(child_process);
-}
+} // namespace
-void ChildProcessLaunched(HANDLE child_process, HANDLE server_pipe) {
- return edk::ChildProcessLaunched(child_process, server_pipe);
+void PreInitializeParentProcess() {
+ edk::PreInitializeParentProcess();
+}
+
+void PreInitializeChildProcess() {
+ edk::PreInitializeChildProcess();
+}
+
+ScopedPlatformHandle ChildProcessLaunched(base::ProcessHandle child_process) {
+ return CreateHandle(edk::ChildProcessLaunched(child_process).Pass());
}
-void SetParentPipeHandle(HANDLE pipe) {
- edk::SetParentPipeHandle(pipe);
+void ChildProcessLaunched(base::ProcessHandle child_process,
+ ScopedPlatformHandle server_pipe) {
+ return edk::ChildProcessLaunched(
+ child_process, CreateEDKHandle(server_pipe.Pass()));
+}
+
+void SetParentPipeHandle(ScopedPlatformHandle pipe) {
+ edk::SetParentPipeHandle(CreateEDKHandle(pipe.Pass()));
}
-#endif
void SetMaxMessageSize(size_t bytes) {
system::GetMutableConfiguration()->max_message_num_bytes = bytes;
@@ -145,14 +163,9 @@ MojoResult CreatePlatformHandleWrapper(
MojoHandle* platform_handle_wrapper_handle) {
DCHECK(platform_handle_wrapper_handle);
if (UseNewEDK()) {
- mojo::edk::ScopedPlatformHandle edk_handle(mojo::edk::PlatformHandle(
-#if defined(OS_WIN)
- platform_handle.release().handle));
-#else
- platform_handle.release().fd));
-#endif
return mojo::edk::CreatePlatformHandleWrapper(
- edk_handle.Pass(), platform_handle_wrapper_handle);
+ CreateEDKHandle(platform_handle.Pass()),
+ platform_handle_wrapper_handle);
}
scoped_refptr<system::Dispatcher> dispatcher =
@@ -345,13 +358,8 @@ ScopedMessagePipeHandle CreateChannel(
if (UseNewEDK()) {
if (!did_create_channel_callback.is_null())
did_create_channel_callback.Run(nullptr);
- mojo::edk::ScopedPlatformHandle edk_handle(mojo::edk::PlatformHandle(
-#if defined(OS_WIN)
- platform_handle.release().handle));
-#else
- platform_handle.release().fd));
-#endif
- return mojo::edk::CreateMessagePipe(edk_handle.Pass());
+ return mojo::edk::CreateMessagePipe(
+ CreateEDKHandle(platform_handle.Pass()));
}
system::ChannelManager* channel_manager =
« mojo/runner/host/child_process.cc ('K') | « third_party/mojo/src/mojo/edk/embedder/embedder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698