OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 #include "content/public/common/isolated_world_ids.h" | 89 #include "content/public/common/isolated_world_ids.h" |
90 #include "content/public/common/service_manager_connection.h" | 90 #include "content/public/common/service_manager_connection.h" |
91 #include "content/public/common/url_constants.h" | 91 #include "content/public/common/url_constants.h" |
92 #include "content/public/common/url_utils.h" | 92 #include "content/public/common/url_utils.h" |
93 #include "device/generic_sensor/sensor_provider_impl.h" | 93 #include "device/generic_sensor/sensor_provider_impl.h" |
94 #include "device/geolocation/geolocation_service_context.h" | 94 #include "device/geolocation/geolocation_service_context.h" |
95 #include "device/vibration/vibration_manager_impl.h" | 95 #include "device/vibration/vibration_manager_impl.h" |
96 #include "device/wake_lock/wake_lock_service_context.h" | 96 #include "device/wake_lock/wake_lock_service_context.h" |
97 #include "media/base/media_switches.h" | 97 #include "media/base/media_switches.h" |
98 #include "media/mojo/interfaces/media_service.mojom.h" | 98 #include "media/mojo/interfaces/media_service.mojom.h" |
99 #include "media/mojo/interfaces/service_factory.mojom.h" | |
100 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 99 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
101 #include "mojo/public/cpp/bindings/strong_binding.h" | 100 #include "mojo/public/cpp/bindings/strong_binding.h" |
102 #include "services/service_manager/public/cpp/connector.h" | 101 #include "services/service_manager/public/cpp/connector.h" |
103 #include "services/service_manager/public/cpp/interface_provider.h" | 102 #include "services/service_manager/public/cpp/interface_provider.h" |
104 #include "third_party/WebKit/public/platform/modules/shapedetection/shapedetecti
on.mojom.h" | 103 #include "third_party/WebKit/public/platform/modules/shapedetection/shapedetecti
on.mojom.h" |
105 #include "ui/accessibility/ax_tree.h" | 104 #include "ui/accessibility/ax_tree.h" |
106 #include "ui/accessibility/ax_tree_update.h" | 105 #include "ui/accessibility/ax_tree_update.h" |
107 #include "ui/gfx/geometry/quad_f.h" | 106 #include "ui/gfx/geometry/quad_f.h" |
108 #include "url/gurl.h" | 107 #include "url/gurl.h" |
109 | 108 |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 // The renderer process is gone, so this frame can no longer be loading. | 803 // The renderer process is gone, so this frame can no longer be loading. |
805 ResetLoadingState(); | 804 ResetLoadingState(); |
806 | 805 |
807 // Any future UpdateState or UpdateTitle messages from this or a recreated | 806 // Any future UpdateState or UpdateTitle messages from this or a recreated |
808 // process should be ignored until the next commit. | 807 // process should be ignored until the next commit. |
809 set_nav_entry_id(0); | 808 set_nav_entry_id(0); |
810 } | 809 } |
811 | 810 |
812 void RenderFrameHostImpl::Create( | 811 void RenderFrameHostImpl::Create( |
813 const service_manager::Identity& remote_identity, | 812 const service_manager::Identity& remote_identity, |
814 media::mojom::ServiceFactoryRequest request) { | 813 media::mojom::InterfaceFactoryRequest request) { |
815 std::unique_ptr<service_manager::InterfaceRegistry> registry( | 814 std::unique_ptr<service_manager::InterfaceRegistry> registry( |
816 new service_manager::InterfaceRegistry); | 815 new service_manager::InterfaceRegistry); |
817 #if defined(OS_ANDROID) && defined(ENABLE_MOJO_CDM) | 816 #if defined(OS_ANDROID) && defined(ENABLE_MOJO_CDM) |
818 registry->AddInterface( | 817 registry->AddInterface( |
819 base::Bind(&ProvisionFetcherImpl::Create, this)); | 818 base::Bind(&ProvisionFetcherImpl::Create, this)); |
820 #endif | 819 #endif |
821 GetContentClient()->browser()->ExposeInterfacesToMediaService(registry.get(), | 820 GetContentClient()->browser()->ExposeInterfacesToMediaService(registry.get(), |
822 this); | 821 this); |
823 service_manager::mojom::InterfaceProviderPtr interfaces; | 822 service_manager::mojom::InterfaceProviderPtr interfaces; |
824 registry->Bind(GetProxy(&interfaces)); | 823 registry->Bind(GetProxy(&interfaces)); |
825 media_registries_.push_back(std::move(registry)); | 824 media_registries_.push_back(std::move(registry)); |
826 | 825 |
827 // TODO(slan): Use the BrowserContext Connector instead. See crbug.com/638950. | 826 // TODO(slan): Use the BrowserContext Connector instead. See crbug.com/638950. |
828 media::mojom::MediaServicePtr media_service; | 827 media::mojom::MediaServicePtr media_service; |
829 service_manager::Connector* connector = | 828 service_manager::Connector* connector = |
830 ServiceManagerConnection::GetForProcess()->GetConnector(); | 829 ServiceManagerConnection::GetForProcess()->GetConnector(); |
831 connector->ConnectToInterface("service:media", &media_service); | 830 connector->ConnectToInterface("service:media", &media_service); |
832 media_service->CreateServiceFactory(std::move(request), | 831 media_service->CreateInterfaceFactory(std::move(request), |
833 std::move(interfaces)); | 832 std::move(interfaces)); |
834 } | 833 } |
835 | 834 |
836 bool RenderFrameHostImpl::CreateRenderFrame(int proxy_routing_id, | 835 bool RenderFrameHostImpl::CreateRenderFrame(int proxy_routing_id, |
837 int opener_routing_id, | 836 int opener_routing_id, |
838 int parent_routing_id, | 837 int parent_routing_id, |
839 int previous_sibling_routing_id) { | 838 int previous_sibling_routing_id) { |
840 TRACE_EVENT0("navigation", "RenderFrameHostImpl::CreateRenderFrame"); | 839 TRACE_EVENT0("navigation", "RenderFrameHostImpl::CreateRenderFrame"); |
841 DCHECK(!IsRenderFrameLive()) << "Creating frame twice"; | 840 DCHECK(!IsRenderFrameLive()) << "Creating frame twice"; |
842 | 841 |
843 // The process may (if we're sharing a process with another host that already | 842 // The process may (if we're sharing a process with another host that already |
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_MACOSX) | 2179 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_MACOSX) |
2181 enable_web_bluetooth = true; | 2180 enable_web_bluetooth = true; |
2182 #endif | 2181 #endif |
2183 | 2182 |
2184 if (enable_web_bluetooth) { | 2183 if (enable_web_bluetooth) { |
2185 GetInterfaceRegistry()->AddInterface(base::Bind( | 2184 GetInterfaceRegistry()->AddInterface(base::Bind( |
2186 base::IgnoreResult(&RenderFrameHostImpl::CreateWebBluetoothService), | 2185 base::IgnoreResult(&RenderFrameHostImpl::CreateWebBluetoothService), |
2187 base::Unretained(this))); | 2186 base::Unretained(this))); |
2188 } | 2187 } |
2189 | 2188 |
2190 GetInterfaceRegistry()->AddInterface<media::mojom::ServiceFactory>(this); | 2189 GetInterfaceRegistry()->AddInterface<media::mojom::InterfaceFactory>(this); |
2191 | 2190 |
2192 // This is to support usage of WebSockets in cases in which there is an | 2191 // This is to support usage of WebSockets in cases in which there is an |
2193 // associated RenderFrame. This is important for showing the correct security | 2192 // associated RenderFrame. This is important for showing the correct security |
2194 // state of the page and also honoring user override of bad certificates. | 2193 // state of the page and also honoring user override of bad certificates. |
2195 GetInterfaceRegistry()->AddInterface( | 2194 GetInterfaceRegistry()->AddInterface( |
2196 base::Bind(&WebSocketManager::CreateWebSocket, | 2195 base::Bind(&WebSocketManager::CreateWebSocket, |
2197 process_->GetID(), | 2196 process_->GetID(), |
2198 routing_id_)); | 2197 routing_id_)); |
2199 | 2198 |
2200 #if defined(ENABLE_WEBVR) | 2199 #if defined(ENABLE_WEBVR) |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3139 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3138 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3140 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3139 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3141 return web_bluetooth_service_.get(); | 3140 return web_bluetooth_service_.get(); |
3142 } | 3141 } |
3143 | 3142 |
3144 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3143 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3145 web_bluetooth_service_.reset(); | 3144 web_bluetooth_service_.reset(); |
3146 } | 3145 } |
3147 | 3146 |
3148 } // namespace content | 3147 } // namespace content |
OLD | NEW |