OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/navigator_connect/service_port_provider.h" | 5 #include "content/child/navigator_connect/service_port_provider.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 ServicePortServicePtr& ServicePortProvider::GetServicePortServicePtr() { | 119 ServicePortServicePtr& ServicePortProvider::GetServicePortServicePtr() { |
120 if (!service_port_service_.get()) { | 120 if (!service_port_service_.get()) { |
121 mojo::InterfaceRequest<ServicePortService> request = | 121 mojo::InterfaceRequest<ServicePortService> request = |
122 mojo::GetProxy(&service_port_service_); | 122 mojo::GetProxy(&service_port_service_); |
123 main_loop_->PostTask(FROM_HERE, base::Bind(&ConnectToServiceOnMainThread, | 123 main_loop_->PostTask(FROM_HERE, base::Bind(&ConnectToServiceOnMainThread, |
124 base::Passed(&request))); | 124 base::Passed(&request))); |
125 | 125 |
126 // Setup channel for browser to post events back to this class. | 126 // Setup channel for browser to post events back to this class. |
127 ServicePortServiceClientPtr client_ptr; | 127 service_port_service_->SetClient(binding_.CreateInterfacePtrAndBind()); |
128 binding_.Bind(GetProxy(&client_ptr)); | |
129 service_port_service_->SetClient(std::move(client_ptr)); | |
130 } | 128 } |
131 return service_port_service_; | 129 return service_port_service_; |
132 } | 130 } |
133 | 131 |
134 } // namespace content | 132 } // namespace content |
OLD | NEW |