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/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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 return; | 40 return; |
41 } | 41 } |
42 | 42 |
43 // Actually going to connect. | 43 // Actually going to connect. |
44 VLOG(1) << "Connecting to Service Process IPC Server"; | 44 VLOG(1) << "Connecting to Service Process IPC Server"; |
45 | 45 |
46 // TODO(hclam): Handle error connecting to channel. | 46 // TODO(hclam): Handle error connecting to channel. |
47 const IPC::ChannelHandle channel_id = GetServiceProcessChannel(); | 47 const IPC::ChannelHandle channel_id = GetServiceProcessChannel(); |
48 channel_.reset(new IPC::ChannelProxy( | 48 channel_.reset(new IPC::ChannelProxy( |
49 channel_id, IPC::Channel::MODE_NAMED_CLIENT, this, | 49 channel_id, IPC::Channel::MODE_NAMED_CLIENT, this, |
50 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 50 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); |
51 false /* needs_override_peer_pid */)); | |
52 } | 51 } |
53 | 52 |
54 void ServiceProcessControl::RunConnectDoneTasks() { | 53 void ServiceProcessControl::RunConnectDoneTasks() { |
55 // The tasks executed here may add more tasks to the vector. So copy | 54 // The tasks executed here may add more tasks to the vector. So copy |
56 // them to the stack before executing them. This way recursion is | 55 // them to the stack before executing them. This way recursion is |
57 // avoided. | 56 // avoided. |
58 TaskList tasks; | 57 TaskList tasks; |
59 tasks.swap(connect_done_tasks_); | 58 tasks.swap(connect_done_tasks_); |
60 RunAllTasksHelper(&tasks); | 59 RunAllTasksHelper(&tasks); |
61 DCHECK(tasks.empty()); | 60 DCHECK(tasks.empty()); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 if (base::LaunchProcess(*cmd_line_, options, NULL)) { | 319 if (base::LaunchProcess(*cmd_line_, options, NULL)) { |
321 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 320 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
322 NewRunnableMethod(this, | 321 NewRunnableMethod(this, |
323 &Launcher::DoDetectLaunched)); | 322 &Launcher::DoDetectLaunched)); |
324 } else { | 323 } else { |
325 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 324 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
326 NewRunnableMethod(this, &Launcher::Notify)); | 325 NewRunnableMethod(this, &Launcher::Notify)); |
327 } | 326 } |
328 } | 327 } |
329 #endif // !OS_MACOSX | 328 #endif // !OS_MACOSX |
OLD | NEW |