OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 return true; | 245 return true; |
246 } | 246 } |
247 | 247 |
248 IPC::ChannelHandle ServiceProcessState::GetServiceProcessChannel() { | 248 IPC::ChannelHandle ServiceProcessState::GetServiceProcessChannel() { |
249 return ::GetServiceProcessChannel(); | 249 return ::GetServiceProcessChannel(); |
250 } | 250 } |
251 | 251 |
252 #endif // !OS_MACOSX | 252 #endif // !OS_MACOSX |
253 | 253 |
254 void ServiceProcessState::CreateAutoRunCommandLine() { | 254 void ServiceProcessState::CreateAutoRunCommandLine() { |
255 FilePath exe_path = ChildProcessHost::GetChildPath(false); | 255 FilePath exe_path = |
| 256 ChildProcessHost::GetChildPath(ChildProcessHost::CHILD_NORMAL); |
256 if (exe_path.empty()) { | 257 if (exe_path.empty()) { |
257 NOTREACHED() << "Unable to get service process binary name."; | 258 NOTREACHED() << "Unable to get service process binary name."; |
258 } | 259 } |
259 autorun_command_line_.reset(new CommandLine(exe_path)); | 260 autorun_command_line_.reset(new CommandLine(exe_path)); |
260 autorun_command_line_->AppendSwitchASCII(switches::kProcessType, | 261 autorun_command_line_->AppendSwitchASCII(switches::kProcessType, |
261 switches::kServiceProcess); | 262 switches::kServiceProcess); |
262 | 263 |
263 // The user data directory is the only other flag we currently want to | 264 // The user data directory is the only other flag we currently want to |
264 // possibly store. | 265 // possibly store. |
265 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 266 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
266 FilePath user_data_dir = | 267 FilePath user_data_dir = |
267 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); | 268 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
268 if (!user_data_dir.empty()) | 269 if (!user_data_dir.empty()) |
269 autorun_command_line_->AppendSwitchPath(switches::kUserDataDir, | 270 autorun_command_line_->AppendSwitchPath(switches::kUserDataDir, |
270 user_data_dir); | 271 user_data_dir); |
271 } | 272 } |
OLD | NEW |