| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 RunConnectDoneTasks(); | 41 RunConnectDoneTasks(); |
| 42 return; | 42 return; |
| 43 } | 43 } |
| 44 | 44 |
| 45 // Actually going to connect. | 45 // Actually going to connect. |
| 46 VLOG(1) << "Connecting to Service Process IPC Server"; | 46 VLOG(1) << "Connecting to Service Process IPC Server"; |
| 47 | 47 |
| 48 // TODO(hclam): Handle error connecting to channel. | 48 // TODO(hclam): Handle error connecting to channel. |
| 49 const IPC::ChannelHandle channel_id = GetServiceProcessChannel(); | 49 const IPC::ChannelHandle channel_id = GetServiceProcessChannel(); |
| 50 SetChannel(new IPC::ChannelProxy( | 50 SetChannel(new IPC::ChannelProxy( |
| 51 channel_id, IPC::Channel::MODE_NAMED_CLIENT, this, | 51 channel_id, |
| 52 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | 52 IPC::Channel::MODE_NAMED_CLIENT, |
| 53 this, |
| 54 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); |
| 53 } | 55 } |
| 54 | 56 |
| 55 void ServiceProcessControl::SetChannel(IPC::ChannelProxy* channel) { | 57 void ServiceProcessControl::SetChannel(IPC::ChannelProxy* channel) { |
| 56 channel_.reset(channel); | 58 channel_.reset(channel); |
| 57 } | 59 } |
| 58 | 60 |
| 59 void ServiceProcessControl::RunConnectDoneTasks() { | 61 void ServiceProcessControl::RunConnectDoneTasks() { |
| 60 // The tasks executed here may add more tasks to the vector. So copy | 62 // The tasks executed here may add more tasks to the vector. So copy |
| 61 // them to the stack before executing them. This way recursion is | 63 // them to the stack before executing them. This way recursion is |
| 62 // avoided. | 64 // avoided. |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 if (base::LaunchProcess(*cmd_line_, options, NULL)) { | 307 if (base::LaunchProcess(*cmd_line_, options, NULL)) { |
| 306 BrowserThread::PostTask( | 308 BrowserThread::PostTask( |
| 307 BrowserThread::IO, FROM_HERE, | 309 BrowserThread::IO, FROM_HERE, |
| 308 base::Bind(&Launcher::DoDetectLaunched, this)); | 310 base::Bind(&Launcher::DoDetectLaunched, this)); |
| 309 } else { | 311 } else { |
| 310 BrowserThread::PostTask( | 312 BrowserThread::PostTask( |
| 311 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); | 313 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); |
| 312 } | 314 } |
| 313 } | 315 } |
| 314 #endif // !OS_MACOSX | 316 #endif // !OS_MACOSX |
| OLD | NEW |