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

Side by Side Diff: components/nacl/broker/nacl_broker_listener.cc

Issue 2025763002: Use ChannelMojo in Pepper and NaCl processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-utility-channel-mojo
Patch Set: iujbhirtughfbnjrthiubj Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/nacl/browser/nacl_process_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/nacl/broker/nacl_broker_listener.h" 5 #include "components/nacl/broker/nacl_broker_listener.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // this code is running in. 99 // this code is running in.
100 base::FilePath exe_path; 100 base::FilePath exe_path;
101 PathService::Get(base::FILE_EXE, &exe_path); 101 PathService::Get(base::FILE_EXE, &exe_path);
102 if (!exe_path.empty()) { 102 if (!exe_path.empty()) {
103 base::CommandLine* cmd_line = new base::CommandLine(exe_path); 103 base::CommandLine* cmd_line = new base::CommandLine(exe_path);
104 nacl::CopyNaClCommandLineArguments(cmd_line); 104 nacl::CopyNaClCommandLineArguments(cmd_line);
105 105
106 cmd_line->AppendSwitchASCII(switches::kProcessType, 106 cmd_line->AppendSwitchASCII(switches::kProcessType,
107 switches::kNaClLoaderProcess); 107 switches::kNaClLoaderProcess);
108 108
109 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, 109 cmd_line->AppendSwitchASCII(switches::kMojoChannelToken,
110 loader_channel_id); 110 loader_channel_id);
111 111
112 base::Process loader_process; 112 base::Process loader_process;
113 sandbox::ResultCode result = content::StartSandboxedProcess( 113 sandbox::ResultCode result = content::StartSandboxedProcess(
114 this, cmd_line, base::HandlesToInheritVector(), &loader_process); 114 this, cmd_line, base::HandlesToInheritVector(), &loader_process);
115 115
116 if (result == sandbox::SBOX_ALL_OK) { 116 if (result == sandbox::SBOX_ALL_OK) {
117 // Note: PROCESS_DUP_HANDLE is necessary here, because: 117 // Note: PROCESS_DUP_HANDLE is necessary here, because:
118 // 1) The current process is the broker, which is the loader's parent. 118 // 1) The current process is the broker, which is the loader's parent.
119 // 2) The browser is not the loader's parent, and so only gets the 119 // 2) The browser is not the loader's parent, and so only gets the
(...skipping 19 matching lines...) Expand all
139 const std::string& startup_info) { 139 const std::string& startup_info) {
140 NaClStartDebugExceptionHandlerThread( 140 NaClStartDebugExceptionHandlerThread(
141 base::Process(process_handle), startup_info, 141 base::Process(process_handle), startup_info,
142 base::ThreadTaskRunnerHandle::Get(), 142 base::ThreadTaskRunnerHandle::Get(),
143 base::Bind(SendReply, channel_.get(), pid)); 143 base::Bind(SendReply, channel_.get(), pid));
144 } 144 }
145 145
146 void NaClBrokerListener::OnStopBroker() { 146 void NaClBrokerListener::OnStopBroker() {
147 base::MessageLoop::current()->QuitWhenIdle(); 147 base::MessageLoop::current()->QuitWhenIdle();
148 } 148 }
OLDNEW
« no previous file with comments | « no previous file | components/nacl/browser/nacl_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698