| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/mojo/mojo_child_connection.h" | 5 #include "content/browser/mojo/mojo_child_connection.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 application_name, instance_id, connector, std::move(service_pipe), | 149 application_name, instance_id, connector, std::move(service_pipe), |
| 150 io_task_runner, | 150 io_task_runner, |
| 151 base::Bind(&MojoChildConnection::GetInterface, | 151 base::Bind(&MojoChildConnection::GetInterface, |
| 152 weak_factory_.GetWeakPtr())); | 152 weak_factory_.GetWeakPtr())); |
| 153 remote_interfaces_.Forward( | 153 remote_interfaces_.Forward( |
| 154 base::Bind(&CallBinderOnTaskRunner, | 154 base::Bind(&CallBinderOnTaskRunner, |
| 155 base::Bind(&IOThreadContext::GetRemoteInterfaceOnIOThread, | 155 base::Bind(&IOThreadContext::GetRemoteInterfaceOnIOThread, |
| 156 context_), io_task_runner)); | 156 context_), io_task_runner)); |
| 157 | 157 |
| 158 #if defined(OS_ANDROID) | 158 #if defined(OS_ANDROID) |
| 159 service_registry_android_ = | 159 interface_registry_android_ = |
| 160 ServiceRegistryAndroid::Create(&interface_registry_, &remote_interfaces_); | 160 InterfaceRegistryAndroid::Create(&interface_registry_); |
| 161 #endif | 161 #endif |
| 162 } | 162 } |
| 163 | 163 |
| 164 MojoChildConnection::~MojoChildConnection() { | 164 MojoChildConnection::~MojoChildConnection() { |
| 165 context_->ShutDown(); | 165 context_->ShutDown(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void MojoChildConnection::SetProcessHandle(base::ProcessHandle handle) { | 168 void MojoChildConnection::SetProcessHandle(base::ProcessHandle handle) { |
| 169 context_->SetProcessHandle(handle); | 169 context_->SetProcessHandle(handle); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void MojoChildConnection::GetInterface( | 172 void MojoChildConnection::GetInterface( |
| 173 const mojo::String& interface_name, | 173 const mojo::String& interface_name, |
| 174 mojo::ScopedMessagePipeHandle request_handle) { | 174 mojo::ScopedMessagePipeHandle request_handle) { |
| 175 static_cast<shell::mojom::InterfaceProvider*>(&interface_registry_) | 175 static_cast<shell::mojom::InterfaceProvider*>(&interface_registry_) |
| 176 ->GetInterface(interface_name, std::move(request_handle)); | 176 ->GetInterface(interface_name, std::move(request_handle)); |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace content | 179 } // namespace content |
| OLD | NEW |