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

Side by Side Diff: chrome/browser/service/service_process_control.cc

Issue 8438020: Cloud print connector policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, initialization fix for Windows. Created 9 years, 1 month 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) 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
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;
Peter Kasting 2011/11/21 20:51:32 Nit: I think this still works without ".get()"
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698