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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 #include "mojo/edk/js/core.h" | 172 #include "mojo/edk/js/core.h" |
173 #include "mojo/edk/js/support.h" | 173 #include "mojo/edk/js/support.h" |
174 #include "net/base/data_url.h" | 174 #include "net/base/data_url.h" |
175 #include "net/base/load_flags.h" | 175 #include "net/base/load_flags.h" |
176 #include "net/base/net_errors.h" | 176 #include "net/base/net_errors.h" |
177 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 177 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
178 #include "net/http/http_util.h" | 178 #include "net/http/http_util.h" |
179 #include "ppapi/features/features.h" | 179 #include "ppapi/features/features.h" |
180 #include "services/service_manager/public/cpp/connector.h" | 180 #include "services/service_manager/public/cpp/connector.h" |
181 #include "services/service_manager/public/cpp/interface_provider.h" | 181 #include "services/service_manager/public/cpp/interface_provider.h" |
182 #include "services/service_manager/public/cpp/interface_registry.h" | |
183 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" | 182 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" |
184 #include "storage/common/data_element.h" | 183 #include "storage/common/data_element.h" |
185 #include "third_party/WebKit/public/platform/FilePathConversion.h" | 184 #include "third_party/WebKit/public/platform/FilePathConversion.h" |
186 #include "third_party/WebKit/public/platform/InterfaceProvider.h" | 185 #include "third_party/WebKit/public/platform/InterfaceProvider.h" |
187 #include "third_party/WebKit/public/platform/URLConversion.h" | 186 #include "third_party/WebKit/public/platform/URLConversion.h" |
188 #include "third_party/WebKit/public/platform/WebCachePolicy.h" | 187 #include "third_party/WebKit/public/platform/WebCachePolicy.h" |
189 #include "third_party/WebKit/public/platform/WebData.h" | 188 #include "third_party/WebKit/public/platform/WebData.h" |
190 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" | 189 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" |
191 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 190 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
192 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h" | 191 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h" |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 #if BUILDFLAG(ENABLE_PLUGINS) | 1145 #if BUILDFLAG(ENABLE_PLUGINS) |
1147 focused_pepper_plugin_(nullptr), | 1146 focused_pepper_plugin_(nullptr), |
1148 pepper_last_mouse_event_target_(nullptr), | 1147 pepper_last_mouse_event_target_(nullptr), |
1149 #endif | 1148 #endif |
1150 engagement_binding_(this), | 1149 engagement_binding_(this), |
1151 frame_binding_(this), | 1150 frame_binding_(this), |
1152 host_zoom_binding_(this), | 1151 host_zoom_binding_(this), |
1153 frame_bindings_control_binding_(this), | 1152 frame_bindings_control_binding_(this), |
1154 has_accessed_initial_document_(false), | 1153 has_accessed_initial_document_(false), |
1155 weak_factory_(this) { | 1154 weak_factory_(this) { |
1156 // We don't have a service_manager::Connection at this point, so use empty | 1155 interface_registry_ = base::MakeUnique<service_manager::BinderRegistry>(); |
1157 // identity/specs. | |
1158 // TODO(beng): We should fix this, so we can apply policy about which | |
1159 // interfaces get exposed. | |
1160 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( | |
1161 mojom::kNavigation_FrameSpec); | |
1162 service_manager::mojom::InterfaceProviderPtr remote_interfaces; | 1156 service_manager::mojom::InterfaceProviderPtr remote_interfaces; |
1163 pending_remote_interface_provider_request_ = MakeRequest(&remote_interfaces); | 1157 pending_remote_interface_provider_request_ = MakeRequest(&remote_interfaces); |
1164 remote_interfaces_.reset(new service_manager::InterfaceProvider); | 1158 remote_interfaces_.reset(new service_manager::InterfaceProvider); |
1165 remote_interfaces_->Bind(std::move(remote_interfaces)); | 1159 remote_interfaces_->Bind(std::move(remote_interfaces)); |
1166 blink_interface_provider_.reset(new BlinkInterfaceProviderImpl( | 1160 blink_interface_provider_.reset(new BlinkInterfaceProviderImpl( |
1167 remote_interfaces_->GetWeakPtr())); | 1161 remote_interfaces_->GetWeakPtr())); |
1168 blink_interface_registry_.reset( | 1162 blink_interface_registry_.reset( |
1169 new BlinkInterfaceRegistryImpl(interface_registry_->GetWeakPtr())); | 1163 new BlinkInterfaceRegistryImpl(interface_registry_->GetWeakPtr())); |
1170 | 1164 |
1171 std::pair<RoutingIDFrameMap::iterator, bool> result = | 1165 std::pair<RoutingIDFrameMap::iterator, bool> result = |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 | 1310 |
1317 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { | 1311 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { |
1318 DCHECK(!blame_context_); | 1312 DCHECK(!blame_context_); |
1319 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); | 1313 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); |
1320 blame_context_->Initialize(); | 1314 blame_context_->Initialize(); |
1321 } | 1315 } |
1322 | 1316 |
1323 void RenderFrameImpl::GetInterface( | 1317 void RenderFrameImpl::GetInterface( |
1324 const std::string& interface_name, | 1318 const std::string& interface_name, |
1325 mojo::ScopedMessagePipeHandle interface_pipe) { | 1319 mojo::ScopedMessagePipeHandle interface_pipe) { |
1326 interface_registry_->BindInterface(interface_name, std::move(interface_pipe)); | 1320 // TODO(beng): We should be getting this info from the frame factory request. |
| 1321 service_manager::ServiceInfo browser_info = |
| 1322 ChildThreadImpl::current()->GetBrowserServiceInfo(); |
| 1323 interface_registry_->BindInterface(browser_info.identity, interface_name, |
| 1324 std::move(interface_pipe)); |
1327 } | 1325 } |
1328 | 1326 |
1329 RenderWidget* RenderFrameImpl::GetRenderWidget() { | 1327 RenderWidget* RenderFrameImpl::GetRenderWidget() { |
1330 return GetLocalRoot()->render_widget_.get(); | 1328 return GetLocalRoot()->render_widget_.get(); |
1331 } | 1329 } |
1332 | 1330 |
1333 #if BUILDFLAG(ENABLE_PLUGINS) | 1331 #if BUILDFLAG(ENABLE_PLUGINS) |
1334 void RenderFrameImpl::PepperPluginCreated(RendererPpapiHost* host) { | 1332 void RenderFrameImpl::PepperPluginCreated(RendererPpapiHost* host) { |
1335 for (auto& observer : observers_) | 1333 for (auto& observer : observers_) |
1336 observer.DidCreatePepperPlugin(host); | 1334 observer.DidCreatePepperPlugin(host); |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2564 WebString::FromUTF8("UTF-8"), GURL(kUnreachableWebDataURL), | 2562 WebString::FromUTF8("UTF-8"), GURL(kUnreachableWebDataURL), |
2565 error.unreachable_url, true, | 2563 error.unreachable_url, true, |
2566 blink::WebFrameLoadType::kStandard, blink::WebHistoryItem(), | 2564 blink::WebFrameLoadType::kStandard, blink::WebHistoryItem(), |
2567 blink::kWebHistoryDifferentDocumentLoad, true); | 2565 blink::kWebHistoryDifferentDocumentLoad, true); |
2568 } | 2566 } |
2569 | 2567 |
2570 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { | 2568 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { |
2571 OnJavaScriptExecuteRequest(javascript, 0, false); | 2569 OnJavaScriptExecuteRequest(javascript, 0, false); |
2572 } | 2570 } |
2573 | 2571 |
2574 service_manager::InterfaceRegistry* RenderFrameImpl::GetInterfaceRegistry() { | 2572 service_manager::BinderRegistry* RenderFrameImpl::GetInterfaceRegistry() { |
2575 return interface_registry_.get(); | 2573 return interface_registry_.get(); |
2576 } | 2574 } |
2577 | 2575 |
2578 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() { | 2576 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() { |
2579 return remote_interfaces_.get(); | 2577 return remote_interfaces_.get(); |
2580 } | 2578 } |
2581 | 2579 |
2582 AssociatedInterfaceRegistry* | 2580 AssociatedInterfaceRegistry* |
2583 RenderFrameImpl::GetAssociatedInterfaceRegistry() { | 2581 RenderFrameImpl::GetAssociatedInterfaceRegistry() { |
2584 return &associated_interfaces_; | 2582 return &associated_interfaces_; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2734 return; | 2732 return; |
2735 } | 2733 } |
2736 | 2734 |
2737 engagement_level_ = std::make_pair(origin, level); | 2735 engagement_level_ = std::make_pair(origin, level); |
2738 } | 2736 } |
2739 | 2737 |
2740 // mojom::Frame implementation ------------------------------------------------- | 2738 // mojom::Frame implementation ------------------------------------------------- |
2741 | 2739 |
2742 void RenderFrameImpl::GetInterfaceProvider( | 2740 void RenderFrameImpl::GetInterfaceProvider( |
2743 service_manager::mojom::InterfaceProviderRequest request) { | 2741 service_manager::mojom::InterfaceProviderRequest request) { |
| 2742 // TODO(beng): We should be getting this info from the frame factory request. |
2744 service_manager::ServiceInfo browser_info = | 2743 service_manager::ServiceInfo browser_info = |
2745 ChildThreadImpl::current()->GetBrowserServiceInfo(); | 2744 ChildThreadImpl::current()->GetBrowserServiceInfo(); |
2746 service_manager::Connector* connector = ChildThread::Get()->GetConnector(); | 2745 service_manager::Connector* connector = ChildThread::Get()->GetConnector(); |
2747 connector->FilterInterfaces( | 2746 connector->FilterInterfaces( |
2748 mojom::kNavigation_FrameSpec, browser_info.identity, std::move(request), | 2747 mojom::kNavigation_FrameSpec, browser_info.identity, std::move(request), |
2749 interface_provider_bindings_.CreateInterfacePtrAndBind(this)); | 2748 interface_provider_bindings_.CreateInterfacePtrAndBind(this)); |
2750 } | 2749 } |
2751 | 2750 |
2752 void RenderFrameImpl::AllowBindings(int32_t enabled_bindings_flags) { | 2751 void RenderFrameImpl::AllowBindings(int32_t enabled_bindings_flags) { |
2753 if (IsMainFrame() && (enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && | 2752 if (IsMainFrame() && (enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && |
(...skipping 4296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7050 policy(info.default_policy), | 7049 policy(info.default_policy), |
7051 replaces_current_history_item(info.replaces_current_history_item), | 7050 replaces_current_history_item(info.replaces_current_history_item), |
7052 history_navigation_in_new_child_frame( | 7051 history_navigation_in_new_child_frame( |
7053 info.is_history_navigation_in_new_child_frame), | 7052 info.is_history_navigation_in_new_child_frame), |
7054 client_redirect(info.is_client_redirect), | 7053 client_redirect(info.is_client_redirect), |
7055 cache_disabled(info.is_cache_disabled), | 7054 cache_disabled(info.is_cache_disabled), |
7056 form(info.form), | 7055 form(info.form), |
7057 source_location(info.source_location) {} | 7056 source_location(info.source_location) {} |
7058 | 7057 |
7059 } // namespace content | 7058 } // namespace content |
OLD | NEW |