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_process/service_process_control.h" | 5 #include "chrome/browser/service_process/service_process_control.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 RunConnectDoneTasks(); | 45 RunConnectDoneTasks(); |
46 return; | 46 return; |
47 } | 47 } |
48 | 48 |
49 // Actually going to connect. | 49 // Actually going to connect. |
50 DVLOG(1) << "Connecting to Service Process IPC Server"; | 50 DVLOG(1) << "Connecting to Service Process IPC Server"; |
51 | 51 |
52 // TODO(hclam): Handle error connecting to channel. | 52 // TODO(hclam): Handle error connecting to channel. |
53 const IPC::ChannelHandle channel_id = GetServiceProcessChannel(); | 53 const IPC::ChannelHandle channel_id = GetServiceProcessChannel(); |
54 SetChannel(IPC::ChannelProxy::Create( | 54 SetChannel(IPC::ChannelProxy::Create( |
55 channel_id, | 55 channel_id, IPC::Channel::MODE_NAMED_CLIENT, this, |
56 IPC::Channel::MODE_NAMED_CLIENT, | 56 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO).get())); |
57 this, | |
58 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); | |
59 } | 57 } |
60 | 58 |
61 void ServiceProcessControl::SetChannel( | 59 void ServiceProcessControl::SetChannel( |
62 std::unique_ptr<IPC::ChannelProxy> channel) { | 60 std::unique_ptr<IPC::ChannelProxy> channel) { |
63 channel_ = std::move(channel); | 61 channel_ = std::move(channel); |
64 } | 62 } |
65 | 63 |
66 void ServiceProcessControl::RunConnectDoneTasks() { | 64 void ServiceProcessControl::RunConnectDoneTasks() { |
67 // The tasks executed here may add more tasks to the vector. So copy | 65 // The tasks executed here may add more tasks to the vector. So copy |
68 // them to the stack before executing them. This way recursion is | 66 // them to the stack before executing them. This way recursion is |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 if (process_.IsValid()) { | 381 if (process_.IsValid()) { |
384 BrowserThread::PostTask( | 382 BrowserThread::PostTask( |
385 BrowserThread::IO, FROM_HERE, | 383 BrowserThread::IO, FROM_HERE, |
386 base::Bind(&Launcher::DoDetectLaunched, this)); | 384 base::Bind(&Launcher::DoDetectLaunched, this)); |
387 } else { | 385 } else { |
388 BrowserThread::PostTask( | 386 BrowserThread::PostTask( |
389 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); | 387 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); |
390 } | 388 } |
391 } | 389 } |
392 #endif // !OS_MACOSX | 390 #endif // !OS_MACOSX |
OLD | NEW |