| 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 "chrome/browser/service/service_process_control.h" | 5 #include "chrome/browser/service/service_process_control.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 bool ret = Send(new ServiceMsg_Shutdown()); | 249 bool ret = Send(new ServiceMsg_Shutdown()); |
| 250 channel_.reset(); | 250 channel_.reset(); |
| 251 return ret; | 251 return ret; |
| 252 } | 252 } |
| 253 | 253 |
| 254 // static | 254 // static |
| 255 ServiceProcessControl* ServiceProcessControl::GetInstance() { | 255 ServiceProcessControl* ServiceProcessControl::GetInstance() { |
| 256 return Singleton<ServiceProcessControl>::get(); | 256 return Singleton<ServiceProcessControl>::get(); |
| 257 } | 257 } |
| 258 | 258 |
| 259 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl); | |
| 260 | |
| 261 ServiceProcessControl::Launcher::Launcher(ServiceProcessControl* process, | 259 ServiceProcessControl::Launcher::Launcher(ServiceProcessControl* process, |
| 262 CommandLine* cmd_line) | 260 CommandLine* cmd_line) |
| 263 : process_(process), | 261 : process_(process), |
| 264 cmd_line_(cmd_line), | 262 cmd_line_(cmd_line), |
| 265 launched_(false), | 263 launched_(false), |
| 266 retry_count_(0) { | 264 retry_count_(0) { |
| 267 } | 265 } |
| 268 | 266 |
| 269 // Execute the command line to start the process asynchronously. | 267 // Execute the command line to start the process asynchronously. |
| 270 // After the command is executed, |task| is called with the process handle on | 268 // After the command is executed, |task| is called with the process handle on |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 if (base::LaunchProcess(*cmd_line_, options, NULL)) { | 312 if (base::LaunchProcess(*cmd_line_, options, NULL)) { |
| 315 BrowserThread::PostTask( | 313 BrowserThread::PostTask( |
| 316 BrowserThread::IO, FROM_HERE, | 314 BrowserThread::IO, FROM_HERE, |
| 317 base::Bind(&Launcher::DoDetectLaunched, this)); | 315 base::Bind(&Launcher::DoDetectLaunched, this)); |
| 318 } else { | 316 } else { |
| 319 BrowserThread::PostTask( | 317 BrowserThread::PostTask( |
| 320 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); | 318 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); |
| 321 } | 319 } |
| 322 } | 320 } |
| 323 #endif // !OS_MACOSX | 321 #endif // !OS_MACOSX |
| OLD | NEW |