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

Side by Side Diff: chrome/browser/nacl_host/nacl_broker_host_win.cc

Issue 2885017: Moved common parts of ChildProcessHost into chrome/common and created a Brows... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Code review changes Created 10 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/nacl_host/nacl_broker_host_win.h" 5 #include "chrome/browser/nacl_host/nacl_broker_host_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "ipc/ipc_switches.h" 9 #include "ipc/ipc_switches.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/nacl_host/nacl_broker_service_win.h" 11 #include "chrome/browser/nacl_host/nacl_broker_service_win.h"
12 #include "chrome/browser/nacl_host/nacl_process_host.h" 12 #include "chrome/browser/nacl_host/nacl_process_host.h"
13 #include "chrome/common/chrome_constants.h" 13 #include "chrome/common/chrome_constants.h"
14 #include "chrome/common/chrome_switches.h" 14 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/nacl_cmd_line.h" 15 #include "chrome/common/nacl_cmd_line.h"
16 #include "chrome/common/nacl_messages.h" 16 #include "chrome/common/nacl_messages.h"
17 17
18 NaClBrokerHost::NaClBrokerHost( 18 NaClBrokerHost::NaClBrokerHost(
19 ResourceDispatcherHost* resource_dispatcher_host) 19 ResourceDispatcherHost* resource_dispatcher_host)
20 : ChildProcessHost(NACL_BROKER_PROCESS, resource_dispatcher_host), 20 : BrowserChildProcessHost(NACL_BROKER_PROCESS, resource_dispatcher_host),
21 stopping_(false) { 21 stopping_(false) {
22 } 22 }
23 23
24 NaClBrokerHost::~NaClBrokerHost() { 24 NaClBrokerHost::~NaClBrokerHost() {
25 } 25 }
26 26
27 URLRequestContext* NaClBrokerHost::GetRequestContext( 27 URLRequestContext* NaClBrokerHost::GetRequestContext(
28 uint32 request_id, 28 uint32 request_id,
29 const ViewHostMsg_Resource_Request& request_data) { 29 const ViewHostMsg_Resource_Request& request_data) {
30 return NULL; 30 return NULL;
(...skipping 12 matching lines...) Expand all
43 FilePath nacl_path = module_path.DirName().Append(chrome::kNaClAppName); 43 FilePath nacl_path = module_path.DirName().Append(chrome::kNaClAppName);
44 CommandLine* cmd_line = new CommandLine(nacl_path); 44 CommandLine* cmd_line = new CommandLine(nacl_path);
45 nacl::CopyNaClCommandLineArguments(cmd_line); 45 nacl::CopyNaClCommandLineArguments(cmd_line);
46 46
47 cmd_line->AppendSwitchWithValue(switches::kProcessType, 47 cmd_line->AppendSwitchWithValue(switches::kProcessType,
48 switches::kNaClBrokerProcess); 48 switches::kNaClBrokerProcess);
49 49
50 cmd_line->AppendSwitchWithValue(switches::kProcessChannelID, 50 cmd_line->AppendSwitchWithValue(switches::kProcessChannelID,
51 ASCIIToWide(channel_id())); 51 ASCIIToWide(channel_id()));
52 52
53 ChildProcessHost::Launch(FilePath(), cmd_line); 53 BrowserChildProcessHost::Launch(FilePath(), cmd_line);
54 return true; 54 return true;
55 } 55 }
56 56
57 void NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) { 57 void NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) {
58 IPC_BEGIN_MESSAGE_MAP(NaClBrokerHost, msg) 58 IPC_BEGIN_MESSAGE_MAP(NaClBrokerHost, msg)
59 IPC_MESSAGE_HANDLER(NaClProcessMsg_LoaderLaunched, OnLoaderLaunched) 59 IPC_MESSAGE_HANDLER(NaClProcessMsg_LoaderLaunched, OnLoaderLaunched)
60 IPC_END_MESSAGE_MAP() 60 IPC_END_MESSAGE_MAP()
61 } 61 }
62 62
63 bool NaClBrokerHost::LaunchLoader( 63 bool NaClBrokerHost::LaunchLoader(
64 const std::wstring& loader_channel_id) { 64 const std::wstring& loader_channel_id) {
65 return Send(new NaClProcessMsg_LaunchLoaderThroughBroker(loader_channel_id)); 65 return Send(new NaClProcessMsg_LaunchLoaderThroughBroker(loader_channel_id));
66 } 66 }
67 67
68 void NaClBrokerHost::OnLoaderLaunched(const std::wstring& loader_channel_id, 68 void NaClBrokerHost::OnLoaderLaunched(const std::wstring& loader_channel_id,
69 base::ProcessHandle handle) { 69 base::ProcessHandle handle) {
70 NaClBrokerService::GetInstance()->OnLoaderLaunched(loader_channel_id, handle); 70 NaClBrokerService::GetInstance()->OnLoaderLaunched(loader_channel_id, handle);
71 } 71 }
72 72
73 void NaClBrokerHost::StopBroker() { 73 void NaClBrokerHost::StopBroker() {
74 stopping_ = true; 74 stopping_ = true;
75 Send(new NaClProcessMsg_StopBroker()); 75 Send(new NaClProcessMsg_StopBroker());
76 } 76 }
OLDNEW
« no previous file with comments | « chrome/browser/nacl_host/nacl_broker_host_win.h ('k') | chrome/browser/nacl_host/nacl_broker_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698