| 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/frame_host/frame_mojo_shell.h" | 5 #include "content/browser/frame_host/frame_mojo_shell.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/browser/mojo/mojo_shell_context.h" | 10 #include "content/browser/mojo/service_manager_context_impl.h" |
| 11 #include "content/public/browser/content_browser_client.h" | 11 #include "content/public/browser/content_browser_client.h" |
| 12 #include "content/public/browser/render_frame_host.h" | 12 #include "content/public/browser/render_frame_host.h" |
| 13 #include "content/public/browser/render_process_host.h" | 13 #include "content/public/browser/render_process_host.h" |
| 14 #include "content/public/browser/site_instance.h" | 14 #include "content/public/browser/site_instance.h" |
| 15 #include "content/public/common/content_client.h" | 15 #include "content/public/common/content_client.h" |
| 16 #include "services/shell/public/cpp/interface_registry.h" | 16 #include "services/shell/public/cpp/interface_registry.h" |
| 17 | 17 |
| 18 #if defined(OS_ANDROID) && defined(ENABLE_MOJO_CDM) | 18 #if defined(OS_ANDROID) && defined(ENABLE_MOJO_CDM) |
| 19 #include "content/browser/media/android/provision_fetcher_impl.h" | 19 #include "content/browser/media/android/provision_fetcher_impl.h" |
| 20 #endif | 20 #endif |
| (...skipping 28 matching lines...) Expand all Loading... |
| 49 // future we may need to support both. | 49 // future we may need to support both. |
| 50 void FrameMojoShell::Connect( | 50 void FrameMojoShell::Connect( |
| 51 shell::mojom::IdentityPtr target, | 51 shell::mojom::IdentityPtr target, |
| 52 shell::mojom::InterfaceProviderRequest interfaces, | 52 shell::mojom::InterfaceProviderRequest interfaces, |
| 53 shell::mojom::InterfaceProviderPtr /* exposed_interfaces */, | 53 shell::mojom::InterfaceProviderPtr /* exposed_interfaces */, |
| 54 shell::mojom::ClientProcessConnectionPtr client_process_connection, | 54 shell::mojom::ClientProcessConnectionPtr client_process_connection, |
| 55 const shell::mojom::Connector::ConnectCallback& callback) { | 55 const shell::mojom::Connector::ConnectCallback& callback) { |
| 56 shell::mojom::InterfaceProviderPtr frame_interfaces; | 56 shell::mojom::InterfaceProviderPtr frame_interfaces; |
| 57 interface_provider_bindings_.AddBinding(GetInterfaceRegistry(), | 57 interface_provider_bindings_.AddBinding(GetInterfaceRegistry(), |
| 58 GetProxy(&frame_interfaces)); | 58 GetProxy(&frame_interfaces)); |
| 59 MojoShellContext::ConnectToApplication( | 59 ServiceManagerContextImpl::ConnectToApplication( |
| 60 shell::mojom::kRootUserID, target->name, | 60 shell::mojom::kRootUserID, target->name, |
| 61 frame_host_->GetSiteInstance()->GetSiteURL().spec(), | 61 frame_host_->GetSiteInstance()->GetSiteURL().spec(), |
| 62 std::move(interfaces), | 62 std::move(interfaces), |
| 63 std::move(frame_interfaces), callback); | 63 std::move(frame_interfaces), callback); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void FrameMojoShell::Clone(shell::mojom::ConnectorRequest request) { | 66 void FrameMojoShell::Clone(shell::mojom::ConnectorRequest request) { |
| 67 connectors_.AddBinding(this, std::move(request)); | 67 connectors_.AddBinding(this, std::move(request)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 shell::InterfaceRegistry* FrameMojoShell::GetInterfaceRegistry() { | 70 shell::InterfaceRegistry* FrameMojoShell::GetInterfaceRegistry() { |
| 71 if (!interface_registry_) { | 71 if (!interface_registry_) { |
| 72 interface_registry_.reset(new shell::InterfaceRegistry(nullptr)); | 72 interface_registry_.reset(new shell::InterfaceRegistry(nullptr)); |
| 73 | 73 |
| 74 // TODO(rockot/xhwang): Currently all applications connected share the same | 74 // TODO(rockot/xhwang): Currently all applications connected share the same |
| 75 // set of interfaces registered in the |registry|. We may want to provide | 75 // set of interfaces registered in the |registry|. We may want to provide |
| 76 // different interfaces for different apps for better isolation. | 76 // different interfaces for different apps for better isolation. |
| 77 RegisterFrameMojoShellInterfaces(interface_registry_.get(), frame_host_); | 77 RegisterFrameMojoShellInterfaces(interface_registry_.get(), frame_host_); |
| 78 GetContentClient()->browser()->RegisterFrameMojoShellInterfaces( | 78 GetContentClient()->browser()->RegisterFrameMojoShellInterfaces( |
| 79 interface_registry_.get(), frame_host_); | 79 interface_registry_.get(), frame_host_); |
| 80 } | 80 } |
| 81 | 81 |
| 82 return interface_registry_.get(); | 82 return interface_registry_.get(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace content | 85 } // namespace content |
| OLD | NEW |