OLD | NEW |
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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/nacl_host/nacl_process_host.h" | 7 #include "chrome/browser/nacl_host/nacl_process_host.h" |
8 | 8 |
9 #if defined(OS_POSIX) | 9 #if defined(OS_POSIX) |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 return false; | 124 return false; |
125 | 125 |
126 // Build command line for nacl. | 126 // Build command line for nacl. |
127 FilePath exe_path = GetChildPath(true); | 127 FilePath exe_path = GetChildPath(true); |
128 if (exe_path.empty()) | 128 if (exe_path.empty()) |
129 return false; | 129 return false; |
130 | 130 |
131 CommandLine* cmd_line = new CommandLine(exe_path); | 131 CommandLine* cmd_line = new CommandLine(exe_path); |
132 nacl::CopyNaClCommandLineArguments(cmd_line); | 132 nacl::CopyNaClCommandLineArguments(cmd_line); |
133 | 133 |
134 cmd_line->AppendSwitchWithValue(switches::kProcessType, | 134 cmd_line->AppendSwitchASCII(switches::kProcessType, |
135 switches::kNaClLoaderProcess); | 135 switches::kNaClLoaderProcess); |
136 | 136 |
137 cmd_line->AppendSwitchWithValue(switches::kProcessChannelID, channel_id()); | 137 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); |
138 | 138 |
139 // On Windows we might need to start the broker process to launch a new loader | 139 // On Windows we might need to start the broker process to launch a new loader |
140 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
141 if (running_on_wow64_) { | 141 if (running_on_wow64_) { |
142 NaClBrokerService::GetInstance()->Init(resource_dispatcher_host_); | 142 NaClBrokerService::GetInstance()->Init(resource_dispatcher_host_); |
143 return NaClBrokerService::GetInstance()->LaunchLoader(this, | 143 return NaClBrokerService::GetInstance()->LaunchLoader(this, |
144 ASCIIToWide(channel_id())); | 144 ASCIIToWide(channel_id())); |
145 } else { | 145 } else { |
146 BrowserChildProcessHost::Launch(FilePath(), cmd_line); | 146 BrowserChildProcessHost::Launch(FilePath(), cmd_line); |
147 } | 147 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 if (fnIsWow64Process != NULL) { | 276 if (fnIsWow64Process != NULL) { |
277 BOOL bIsWow64 = FALSE; | 277 BOOL bIsWow64 = FALSE; |
278 if (fnIsWow64Process(GetCurrentProcess(),&bIsWow64)) { | 278 if (fnIsWow64Process(GetCurrentProcess(),&bIsWow64)) { |
279 if (bIsWow64) { | 279 if (bIsWow64) { |
280 running_on_wow64_ = true; | 280 running_on_wow64_ = true; |
281 } | 281 } |
282 } | 282 } |
283 } | 283 } |
284 } | 284 } |
285 #endif | 285 #endif |
OLD | NEW |