| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 RunConnectDoneTasks(); | 65 RunConnectDoneTasks(); |
| 66 return; | 66 return; |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Actually going to connect. | 69 // Actually going to connect. |
| 70 DVLOG(1) << "Connecting to Service Process IPC Server"; | 70 DVLOG(1) << "Connecting to Service Process IPC Server"; |
| 71 | 71 |
| 72 mojo::MessagePipe pipe; | 72 mojo::MessagePipe pipe; |
| 73 BrowserThread::PostBlockingPoolTask( | 73 BrowserThread::PostBlockingPoolTask( |
| 74 FROM_HERE, base::Bind(&ConnectOnBlockingPool, base::Passed(&pipe.handle1), | 74 FROM_HERE, base::Bind(&ConnectOnBlockingPool, base::Passed(&pipe.handle1), |
| 75 mojo::edk::NamedPlatformHandle( | 75 GetServiceProcessChannel())); |
| 76 GetServiceProcessChannel().name))); | |
| 77 // TODO(hclam): Handle error connecting to channel. | 76 // TODO(hclam): Handle error connecting to channel. |
| 78 auto io_task_runner = | 77 auto io_task_runner = |
| 79 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); | 78 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
| 80 SetChannel( | 79 SetChannel( |
| 81 IPC::ChannelProxy::Create(IPC::ChannelMojo::CreateClientFactory( | 80 IPC::ChannelProxy::Create(IPC::ChannelMojo::CreateClientFactory( |
| 82 std::move(pipe.handle0), io_task_runner), | 81 std::move(pipe.handle0), io_task_runner), |
| 83 this, io_task_runner)); | 82 this, io_task_runner)); |
| 84 } | 83 } |
| 85 | 84 |
| 86 void ServiceProcessControl::SetChannel( | 85 void ServiceProcessControl::SetChannel( |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 if (process_.IsValid()) { | 407 if (process_.IsValid()) { |
| 409 BrowserThread::PostTask( | 408 BrowserThread::PostTask( |
| 410 BrowserThread::IO, FROM_HERE, | 409 BrowserThread::IO, FROM_HERE, |
| 411 base::Bind(&Launcher::DoDetectLaunched, this)); | 410 base::Bind(&Launcher::DoDetectLaunched, this)); |
| 412 } else { | 411 } else { |
| 413 BrowserThread::PostTask( | 412 BrowserThread::PostTask( |
| 414 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); | 413 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); |
| 415 } | 414 } |
| 416 } | 415 } |
| 417 #endif // !OS_MACOSX | 416 #endif // !OS_MACOSX |
| OLD | NEW |