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

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

Issue 3704003: Fix crash on launch when remoting lab is turned on on Windows. (Closed)
Patch Set: Change comment. Created 10 years, 2 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/service/service_process_control.h" 5 #include "chrome/browser/service/service_process_control.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/thread.h" 10 #include "base/thread.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 void ServiceProcessControl::Launch(Task* task) { 129 void ServiceProcessControl::Launch(Task* task) {
130 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 130 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
131 131
132 // If the service process is already running then connects to it. 132 // If the service process is already running then connects to it.
133 if (CheckServiceProcessRunning()) { 133 if (CheckServiceProcessRunning()) {
134 ConnectInternal(task); 134 ConnectInternal(task);
135 return; 135 return;
136 } 136 }
137 137
138 // Prevent quick calls to Launch in succession from causing a crash.
139 // TODO(scottbyer) - ServiceProcessControl launch task callback code needs to
140 // be enhanced to deal with this properly. See
141 // http://code.google.com/p/chromium/issues/detail?id=58802
142 if (launcher_) {
143 return;
144 }
145
138 // A service process should have a different mechanism for starting, but now 146 // A service process should have a different mechanism for starting, but now
139 // we start it as if it is a child process. 147 // we start it as if it is a child process.
140 FilePath exe_path = ChildProcessHost::GetChildPath(true); 148 FilePath exe_path = ChildProcessHost::GetChildPath(true);
141 if (exe_path.empty()) { 149 if (exe_path.empty()) {
142 NOTREACHED() << "Unable to get service process binary name."; 150 NOTREACHED() << "Unable to get service process binary name.";
143 } 151 }
144 152
145 CommandLine* cmd_line = new CommandLine(exe_path); 153 CommandLine* cmd_line = new CommandLine(exe_path);
146 cmd_line->AppendSwitchASCII(switches::kProcessType, 154 cmd_line->AppendSwitchASCII(switches::kProcessType,
147 switches::kServiceProcess); 155 switches::kServiceProcess);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 270 }
263 271
264 bool ServiceProcessControl::GetCloudPrintProxyStatus( 272 bool ServiceProcessControl::GetCloudPrintProxyStatus(
265 Callback2<bool, std::string>::Type* cloud_print_status_callback) { 273 Callback2<bool, std::string>::Type* cloud_print_status_callback) {
266 DCHECK(cloud_print_status_callback); 274 DCHECK(cloud_print_status_callback);
267 cloud_print_status_callback_.reset(cloud_print_status_callback); 275 cloud_print_status_callback_.reset(cloud_print_status_callback);
268 return Send(new ServiceMsg_IsCloudPrintProxyEnabled); 276 return Send(new ServiceMsg_IsCloudPrintProxyEnabled);
269 } 277 }
270 278
271 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl); 279 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698