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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 #include "media/media_features.h" | 167 #include "media/media_features.h" |
168 #include "media/renderers/gpu_video_accelerator_factories.h" | 168 #include "media/renderers/gpu_video_accelerator_factories.h" |
169 #include "mojo/edk/js/core.h" | 169 #include "mojo/edk/js/core.h" |
170 #include "mojo/edk/js/support.h" | 170 #include "mojo/edk/js/support.h" |
171 #include "net/base/data_url.h" | 171 #include "net/base/data_url.h" |
172 #include "net/base/load_flags.h" | 172 #include "net/base/load_flags.h" |
173 #include "net/base/net_errors.h" | 173 #include "net/base/net_errors.h" |
174 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 174 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
175 #include "net/http/http_util.h" | 175 #include "net/http/http_util.h" |
176 #include "ppapi/features/features.h" | 176 #include "ppapi/features/features.h" |
177 #include "services/service_manager/public/cpp/connector.h" | |
177 #include "services/service_manager/public/cpp/interface_provider.h" | 178 #include "services/service_manager/public/cpp/interface_provider.h" |
178 #include "services/service_manager/public/cpp/interface_registry.h" | 179 #include "services/service_manager/public/cpp/interface_registry.h" |
179 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" | 180 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" |
180 #include "storage/common/data_element.h" | 181 #include "storage/common/data_element.h" |
181 #include "third_party/WebKit/public/platform/FilePathConversion.h" | 182 #include "third_party/WebKit/public/platform/FilePathConversion.h" |
182 #include "third_party/WebKit/public/platform/URLConversion.h" | 183 #include "third_party/WebKit/public/platform/URLConversion.h" |
183 #include "third_party/WebKit/public/platform/WebCachePolicy.h" | 184 #include "third_party/WebKit/public/platform/WebCachePolicy.h" |
184 #include "third_party/WebKit/public/platform/WebData.h" | 185 #include "third_party/WebKit/public/platform/WebData.h" |
185 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" | 186 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" |
186 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 187 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1308 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 1309 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
1309 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; | 1310 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; |
1310 } | 1311 } |
1311 | 1312 |
1312 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { | 1313 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { |
1313 DCHECK(!blame_context_); | 1314 DCHECK(!blame_context_); |
1314 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); | 1315 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame); |
1315 blame_context_->Initialize(); | 1316 blame_context_->Initialize(); |
1316 } | 1317 } |
1317 | 1318 |
1319 void RenderFrameImpl::GetInterface( | |
Ken Rockot(use gerrit already)
2017/04/26 04:32:48
nit: Should the position of this function definiti
Ben Goodger (Google)
2017/04/26 17:00:07
Yes. This file is a shit-show.
Ben Goodger (Google)
2017/04/26 17:26:58
Actually it does match the function definition ord
| |
1320 const std::string& interface_name, | |
1321 mojo::ScopedMessagePipeHandle interface_pipe) { | |
1322 interface_registry_->BindInterface(interface_name, std::move(interface_pipe)); | |
1323 } | |
1324 | |
1318 RenderWidget* RenderFrameImpl::GetRenderWidget() { | 1325 RenderWidget* RenderFrameImpl::GetRenderWidget() { |
1319 return GetLocalRoot()->render_widget_.get(); | 1326 return GetLocalRoot()->render_widget_.get(); |
1320 } | 1327 } |
1321 | 1328 |
1322 #if BUILDFLAG(ENABLE_PLUGINS) | 1329 #if BUILDFLAG(ENABLE_PLUGINS) |
1323 void RenderFrameImpl::PepperPluginCreated(RendererPpapiHost* host) { | 1330 void RenderFrameImpl::PepperPluginCreated(RendererPpapiHost* host) { |
1324 for (auto& observer : observers_) | 1331 for (auto& observer : observers_) |
1325 observer.DidCreatePepperPlugin(host); | 1332 observer.DidCreatePepperPlugin(host); |
1326 } | 1333 } |
1327 | 1334 |
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2723 return; | 2730 return; |
2724 } | 2731 } |
2725 | 2732 |
2726 engagement_level_ = std::make_pair(origin, level); | 2733 engagement_level_ = std::make_pair(origin, level); |
2727 } | 2734 } |
2728 | 2735 |
2729 // mojom::Frame implementation ------------------------------------------------- | 2736 // mojom::Frame implementation ------------------------------------------------- |
2730 | 2737 |
2731 void RenderFrameImpl::GetInterfaceProvider( | 2738 void RenderFrameImpl::GetInterfaceProvider( |
2732 service_manager::mojom::InterfaceProviderRequest request) { | 2739 service_manager::mojom::InterfaceProviderRequest request) { |
2733 service_manager::ServiceInfo child_info = | |
2734 ChildThreadImpl::current()->GetChildServiceInfo(); | |
2735 service_manager::ServiceInfo browser_info = | 2740 service_manager::ServiceInfo browser_info = |
2736 ChildThreadImpl::current()->GetBrowserServiceInfo(); | 2741 ChildThreadImpl::current()->GetBrowserServiceInfo(); |
2737 | 2742 service_manager::Connector* connector = ChildThread::Get()->GetConnector(); |
2738 service_manager::InterfaceProviderSpec child_spec, browser_spec; | 2743 connector->ApplySpec( |
2739 // TODO(beng): CHECK these return true. | 2744 mojom::kNavigation_FrameSpec, browser_info.identity, std::move(request), |
2740 service_manager::GetInterfaceProviderSpec( | 2745 interface_provider_bindings_.CreateInterfacePtrAndBind(this)); |
2741 mojom::kNavigation_FrameSpec, child_info.interface_provider_specs, | |
2742 &child_spec); | |
2743 service_manager::GetInterfaceProviderSpec( | |
2744 mojom::kNavigation_FrameSpec, browser_info.interface_provider_specs, | |
2745 &browser_spec); | |
2746 interface_registry_->Bind(std::move(request), child_info.identity, child_spec, | |
2747 browser_info.identity, browser_spec); | |
2748 } | 2746 } |
2749 | 2747 |
2750 void RenderFrameImpl::AllowBindings(int32_t enabled_bindings_flags) { | 2748 void RenderFrameImpl::AllowBindings(int32_t enabled_bindings_flags) { |
2751 if (IsMainFrame() && (enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && | 2749 if (IsMainFrame() && (enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && |
2752 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { | 2750 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { |
2753 // TODO(sammc): Move WebUIExtensionData to be a RenderFrameObserver. | 2751 // TODO(sammc): Move WebUIExtensionData to be a RenderFrameObserver. |
2754 // WebUIExtensionData deletes itself when |render_view_| is destroyed. | 2752 // WebUIExtensionData deletes itself when |render_view_| is destroyed. |
2755 new WebUIExtensionData(render_view_); | 2753 new WebUIExtensionData(render_view_); |
2756 } | 2754 } |
2757 | 2755 |
(...skipping 4268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7026 policy(info.default_policy), | 7024 policy(info.default_policy), |
7027 replaces_current_history_item(info.replaces_current_history_item), | 7025 replaces_current_history_item(info.replaces_current_history_item), |
7028 history_navigation_in_new_child_frame( | 7026 history_navigation_in_new_child_frame( |
7029 info.is_history_navigation_in_new_child_frame), | 7027 info.is_history_navigation_in_new_child_frame), |
7030 client_redirect(info.is_client_redirect), | 7028 client_redirect(info.is_client_redirect), |
7031 cache_disabled(info.is_cache_disabled), | 7029 cache_disabled(info.is_cache_disabled), |
7032 form(info.form), | 7030 form(info.form), |
7033 source_location(info.source_location) {} | 7031 source_location(info.source_location) {} |
7034 | 7032 |
7035 } // namespace content | 7033 } // namespace content |
OLD | NEW |