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> |
11 | 11 |
12 #include "base/auto_reset.h" | 12 #include "base/auto_reset.h" |
13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/debug/alias.h" | 15 #include "base/debug/alias.h" |
16 #include "base/debug/asan_invalid_access.h" | 16 #include "base/debug/asan_invalid_access.h" |
17 #include "base/debug/crash_logging.h" | 17 #include "base/debug/crash_logging.h" |
18 #include "base/debug/dump_without_crashing.h" | 18 #include "base/debug/dump_without_crashing.h" |
| 19 #include "base/feature_list.h" |
19 #include "base/files/file.h" | 20 #include "base/files/file.h" |
20 #include "base/i18n/char_iterator.h" | 21 #include "base/i18n/char_iterator.h" |
21 #include "base/logging.h" | 22 #include "base/logging.h" |
22 #include "base/macros.h" | 23 #include "base/macros.h" |
23 #include "base/memory/ptr_util.h" | 24 #include "base/memory/ptr_util.h" |
24 #include "base/memory/shared_memory.h" | 25 #include "base/memory/shared_memory.h" |
25 #include "base/memory/weak_ptr.h" | 26 #include "base/memory/weak_ptr.h" |
26 #include "base/metrics/field_trial.h" | 27 #include "base/metrics/field_trial.h" |
27 #include "base/metrics/field_trial_params.h" | 28 #include "base/metrics/field_trial_params.h" |
28 #include "base/metrics/histogram_macros.h" | 29 #include "base/metrics/histogram_macros.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "content/common/frame_owner_properties.h" | 63 #include "content/common/frame_owner_properties.h" |
63 #include "content/common/frame_replication_state.h" | 64 #include "content/common/frame_replication_state.h" |
64 #include "content/common/input_messages.h" | 65 #include "content/common/input_messages.h" |
65 #include "content/common/navigation_params.h" | 66 #include "content/common/navigation_params.h" |
66 #include "content/common/page_messages.h" | 67 #include "content/common/page_messages.h" |
67 #include "content/common/savable_subframe.h" | 68 #include "content/common/savable_subframe.h" |
68 #include "content/common/service_worker/service_worker_types.h" | 69 #include "content/common/service_worker/service_worker_types.h" |
69 #include "content/common/site_isolation_policy.h" | 70 #include "content/common/site_isolation_policy.h" |
70 #include "content/common/swapped_out_messages.h" | 71 #include "content/common/swapped_out_messages.h" |
71 #include "content/common/view_messages.h" | 72 #include "content/common/view_messages.h" |
| 73 #include "content/common/worker_url_loader_factory_provider.mojom.h" |
72 #include "content/public/common/appcache_info.h" | 74 #include "content/public/common/appcache_info.h" |
73 #include "content/public/common/associated_interface_provider.h" | 75 #include "content/public/common/associated_interface_provider.h" |
74 #include "content/public/common/bindings_policy.h" | 76 #include "content/public/common/bindings_policy.h" |
75 #include "content/public/common/browser_side_navigation_policy.h" | 77 #include "content/public/common/browser_side_navigation_policy.h" |
76 #include "content/public/common/content_constants.h" | 78 #include "content/public/common/content_constants.h" |
77 #include "content/public/common/content_features.h" | 79 #include "content/public/common/content_features.h" |
78 #include "content/public/common/content_switches.h" | 80 #include "content/public/common/content_switches.h" |
79 #include "content/public/common/context_menu_params.h" | 81 #include "content/public/common/context_menu_params.h" |
80 #include "content/public/common/file_chooser_file_info.h" | 82 #include "content/public/common/file_chooser_file_info.h" |
81 #include "content/public/common/file_chooser_params.h" | 83 #include "content/public/common/file_chooser_params.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 #include "content/renderer/render_frame_proxy.h" | 137 #include "content/renderer/render_frame_proxy.h" |
136 #include "content/renderer/render_process.h" | 138 #include "content/renderer/render_process.h" |
137 #include "content/renderer/render_thread_impl.h" | 139 #include "content/renderer/render_thread_impl.h" |
138 #include "content/renderer/render_view_impl.h" | 140 #include "content/renderer/render_view_impl.h" |
139 #include "content/renderer/render_widget_fullscreen_pepper.h" | 141 #include "content/renderer/render_widget_fullscreen_pepper.h" |
140 #include "content/renderer/renderer_blink_platform_impl.h" | 142 #include "content/renderer/renderer_blink_platform_impl.h" |
141 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 143 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
142 #include "content/renderer/renderer_webcolorchooser_impl.h" | 144 #include "content/renderer/renderer_webcolorchooser_impl.h" |
143 #include "content/renderer/savable_resources.h" | 145 #include "content/renderer/savable_resources.h" |
144 #include "content/renderer/screen_orientation/screen_orientation_dispatcher.h" | 146 #include "content/renderer/screen_orientation/screen_orientation_dispatcher.h" |
| 147 #include "content/renderer/service_worker/worker_fetch_context_impl.h" |
145 #include "content/renderer/shared_worker/shared_worker_repository.h" | 148 #include "content/renderer/shared_worker/shared_worker_repository.h" |
146 #include "content/renderer/shared_worker/websharedworker_proxy.h" | 149 #include "content/renderer/shared_worker/websharedworker_proxy.h" |
147 #include "content/renderer/skia_benchmarking_extension.h" | 150 #include "content/renderer/skia_benchmarking_extension.h" |
148 #include "content/renderer/stats_collection_controller.h" | 151 #include "content/renderer/stats_collection_controller.h" |
149 #include "content/renderer/web_frame_utils.h" | 152 #include "content/renderer/web_frame_utils.h" |
150 #include "content/renderer/web_ui_extension.h" | 153 #include "content/renderer/web_ui_extension.h" |
151 #include "content/renderer/web_ui_extension_data.h" | 154 #include "content/renderer/web_ui_extension_data.h" |
152 #include "crypto/sha2.h" | 155 #include "crypto/sha2.h" |
153 #include "gin/modules/console.h" | 156 #include "gin/modules/console.h" |
154 #include "gin/modules/module_registry.h" | 157 #include "gin/modules/module_registry.h" |
(...skipping 16 matching lines...) Expand all Loading... |
171 #include "net/base/load_flags.h" | 174 #include "net/base/load_flags.h" |
172 #include "net/base/net_errors.h" | 175 #include "net/base/net_errors.h" |
173 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 176 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
174 #include "net/http/http_util.h" | 177 #include "net/http/http_util.h" |
175 #include "ppapi/features/features.h" | 178 #include "ppapi/features/features.h" |
176 #include "services/service_manager/public/cpp/interface_provider.h" | 179 #include "services/service_manager/public/cpp/interface_provider.h" |
177 #include "services/service_manager/public/cpp/interface_registry.h" | 180 #include "services/service_manager/public/cpp/interface_registry.h" |
178 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" | 181 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" |
179 #include "storage/common/data_element.h" | 182 #include "storage/common/data_element.h" |
180 #include "third_party/WebKit/public/platform/FilePathConversion.h" | 183 #include "third_party/WebKit/public/platform/FilePathConversion.h" |
| 184 #include "third_party/WebKit/public/platform/InterfaceProvider.h" |
181 #include "third_party/WebKit/public/platform/URLConversion.h" | 185 #include "third_party/WebKit/public/platform/URLConversion.h" |
182 #include "third_party/WebKit/public/platform/WebCachePolicy.h" | 186 #include "third_party/WebKit/public/platform/WebCachePolicy.h" |
183 #include "third_party/WebKit/public/platform/WebData.h" | 187 #include "third_party/WebKit/public/platform/WebData.h" |
184 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" | 188 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" |
185 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 189 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
186 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h" | 190 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h" |
187 #include "third_party/WebKit/public/platform/WebPoint.h" | 191 #include "third_party/WebKit/public/platform/WebPoint.h" |
188 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 192 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
189 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" | 193 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" |
190 #include "third_party/WebKit/public/platform/WebString.h" | 194 #include "third_party/WebKit/public/platform/WebString.h" |
(...skipping 2796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2987 } | 2991 } |
2988 | 2992 |
2989 blink::WebWorkerContentSettingsClientProxy* | 2993 blink::WebWorkerContentSettingsClientProxy* |
2990 RenderFrameImpl::CreateWorkerContentSettingsClientProxy() { | 2994 RenderFrameImpl::CreateWorkerContentSettingsClientProxy() { |
2991 if (!frame_ || !frame_->View()) | 2995 if (!frame_ || !frame_->View()) |
2992 return NULL; | 2996 return NULL; |
2993 return GetContentClient()->renderer()->CreateWorkerContentSettingsClientProxy( | 2997 return GetContentClient()->renderer()->CreateWorkerContentSettingsClientProxy( |
2994 this, frame_); | 2998 this, frame_); |
2995 } | 2999 } |
2996 | 3000 |
| 3001 blink::WebWorkerFetchContext* RenderFrameImpl::CreateWorkerFetchContext() { |
| 3002 if (!base::FeatureList::IsEnabled(features::kOffMainThreadFetch)) |
| 3003 return nullptr; |
| 3004 mojom::WorkerURLLoaderFactoryProviderPtr worker_url_loader_factory_provider; |
| 3005 RenderThreadImpl::current() |
| 3006 ->blink_platform_impl() |
| 3007 ->GetInterfaceProvider() |
| 3008 ->GetInterface(mojo::MakeRequest(&worker_url_loader_factory_provider)); |
| 3009 WorkerFetchContextImpl* worker_fetch_context = new WorkerFetchContextImpl( |
| 3010 worker_url_loader_factory_provider.PassInterface()); |
| 3011 worker_fetch_context->SetParentFrameID(routing_id_); |
| 3012 worker_fetch_context->SetIsSecureContext( |
| 3013 frame_->GetDocument().IsSecureContext()); |
| 3014 |
| 3015 blink::WebServiceWorkerNetworkProvider* web_provider = |
| 3016 frame_->DataSource()->GetServiceWorkerNetworkProvider(); |
| 3017 if (web_provider) { |
| 3018 ServiceWorkerNetworkProvider* provider = |
| 3019 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider( |
| 3020 web_provider); |
| 3021 worker_fetch_context->SetServiceWorkerProviderID(provider->provider_id()); |
| 3022 worker_fetch_context->SetIsControlledByServiceWorker( |
| 3023 provider->IsControlledByServiceWorker()); |
| 3024 } |
| 3025 return worker_fetch_context; |
| 3026 } |
| 3027 |
2997 WebExternalPopupMenu* RenderFrameImpl::CreateExternalPopupMenu( | 3028 WebExternalPopupMenu* RenderFrameImpl::CreateExternalPopupMenu( |
2998 const WebPopupMenuInfo& popup_menu_info, | 3029 const WebPopupMenuInfo& popup_menu_info, |
2999 WebExternalPopupMenuClient* popup_menu_client) { | 3030 WebExternalPopupMenuClient* popup_menu_client) { |
3000 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 3031 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
3001 // An IPC message is sent to the browser to build and display the actual | 3032 // An IPC message is sent to the browser to build and display the actual |
3002 // popup. The user could have time to click a different select by the time | 3033 // popup. The user could have time to click a different select by the time |
3003 // the popup is shown. In that case external_popup_menu_ is non NULL. | 3034 // the popup is shown. In that case external_popup_menu_ is non NULL. |
3004 // By returning NULL in that case, we instruct Blink to cancel that new | 3035 // By returning NULL in that case, we instruct Blink to cancel that new |
3005 // popup. So from the user perspective, only the first one will show, and | 3036 // popup. So from the user perspective, only the first one will show, and |
3006 // will have to close the first one before another one can be shown. | 3037 // will have to close the first one before another one can be shown. |
(...skipping 3975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6982 policy(info.default_policy), | 7013 policy(info.default_policy), |
6983 replaces_current_history_item(info.replaces_current_history_item), | 7014 replaces_current_history_item(info.replaces_current_history_item), |
6984 history_navigation_in_new_child_frame( | 7015 history_navigation_in_new_child_frame( |
6985 info.is_history_navigation_in_new_child_frame), | 7016 info.is_history_navigation_in_new_child_frame), |
6986 client_redirect(info.is_client_redirect), | 7017 client_redirect(info.is_client_redirect), |
6987 cache_disabled(info.is_cache_disabled), | 7018 cache_disabled(info.is_cache_disabled), |
6988 form(info.form), | 7019 form(info.form), |
6989 source_location(info.source_location) {} | 7020 source_location(info.source_location) {} |
6990 | 7021 |
6991 } // namespace content | 7022 } // namespace content |
OLD | NEW |