| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 // static | 72 // static |
| 73 void ServiceProcessControl::RunAllTasksHelper(TaskList* task_list) { | 73 void ServiceProcessControl::RunAllTasksHelper(TaskList* task_list) { |
| 74 TaskList::iterator index = task_list->begin(); | 74 TaskList::iterator index = task_list->begin(); |
| 75 while (index != task_list->end()) { | 75 while (index != task_list->end()) { |
| 76 (*index).Run(); | 76 (*index).Run(); |
| 77 index = task_list->erase(index); | 77 index = task_list->erase(index); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool ServiceProcessControl::is_connected() const { |
| 82 return channel_.get() != NULL; |
| 83 } |
| 84 |
| 81 void ServiceProcessControl::Launch(const base::Closure& success_task, | 85 void ServiceProcessControl::Launch(const base::Closure& success_task, |
| 82 const base::Closure& failure_task) { | 86 const base::Closure& failure_task) { |
| 83 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 84 | 88 |
| 85 base::Closure failure = failure_task; | 89 base::Closure failure = failure_task; |
| 86 if (!success_task.is_null()) | 90 if (!success_task.is_null()) |
| 87 connect_success_tasks_.push_back(success_task); | 91 connect_success_tasks_.push_back(success_task); |
| 88 | 92 |
| 89 if (!failure.is_null()) | 93 if (!failure.is_null()) |
| 90 connect_failure_tasks_.push_back(failure); | 94 connect_failure_tasks_.push_back(failure); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 if (base::LaunchProcess(*cmd_line_, options, NULL)) { | 313 if (base::LaunchProcess(*cmd_line_, options, NULL)) { |
| 310 BrowserThread::PostTask( | 314 BrowserThread::PostTask( |
| 311 BrowserThread::IO, FROM_HERE, | 315 BrowserThread::IO, FROM_HERE, |
| 312 base::Bind(&Launcher::DoDetectLaunched, this)); | 316 base::Bind(&Launcher::DoDetectLaunched, this)); |
| 313 } else { | 317 } else { |
| 314 BrowserThread::PostTask( | 318 BrowserThread::PostTask( |
| 315 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); | 319 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); |
| 316 } | 320 } |
| 317 } | 321 } |
| 318 #endif // !OS_MACOSX | 322 #endif // !OS_MACOSX |
| OLD | NEW |