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

Unified Diff: components/nacl/loader/nacl_helper_win_64.cc

Issue 2305913002: Use ChannelMojo from the browser to NaCl loader process. (Closed)
Patch Set: Created 4 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: components/nacl/loader/nacl_helper_win_64.cc
diff --git a/components/nacl/loader/nacl_helper_win_64.cc b/components/nacl/loader/nacl_helper_win_64.cc
index 22cf61e3dad4ee40ccf3e054eee18838dce980ec..a17fe888a0a745637411c4949c973adff8e64c24 100644
--- a/components/nacl/loader/nacl_helper_win_64.cc
+++ b/components/nacl/loader/nacl_helper_win_64.cc
@@ -25,6 +25,9 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/sandbox_init.h"
+#include "mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/platform_channel_pair.h"
+#include "mojo/edk/embedder/scoped_ipc_support.h"
#include "sandbox/win/src/sandbox_types.h"
extern int NaClMain(const content::MainFunctionParams&);
@@ -36,6 +39,14 @@ int NaClBrokerMain(const content::MainFunctionParams& parameters) {
base::MessageLoopForIO main_message_loop;
base::PlatformThread::SetName("CrNaClBrokerMain");
+ mojo::edk::Init();
+ mojo::edk::ScopedIPCSupport mojo_ipc_support(main_message_loop.task_runner());
+ mojo::edk::ScopedPlatformHandle platform_channel(
+ mojo::edk::PlatformChannelPair::PassClientHandleFromParentProcess(
+ *base::CommandLine::ForCurrentProcess()));
+ DCHECK(platform_channel.is_valid());
+ mojo::edk::SetParentPipeHandle(std::move(platform_channel));
+
std::unique_ptr<base::PowerMonitorSource> power_monitor_source(
new base::PowerMonitorDeviceSource());
base::PowerMonitor power_monitor(std::move(power_monitor_source));

Powered by Google App Engine
This is Rietveld 408576698