Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2804843005: Implement the infrastructure of creating WorkerFetchContext in worker global scope. (Closed)
Patch Set: incorporated kinuko's comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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 2802 matching lines...) Expand 10 before | Expand all | Expand 10 after
2993 } 2997 }
2994 2998
2995 blink::WebWorkerContentSettingsClientProxy* 2999 blink::WebWorkerContentSettingsClientProxy*
2996 RenderFrameImpl::CreateWorkerContentSettingsClientProxy() { 3000 RenderFrameImpl::CreateWorkerContentSettingsClientProxy() {
2997 if (!frame_ || !frame_->View()) 3001 if (!frame_ || !frame_->View())
2998 return NULL; 3002 return NULL;
2999 return GetContentClient()->renderer()->CreateWorkerContentSettingsClientProxy( 3003 return GetContentClient()->renderer()->CreateWorkerContentSettingsClientProxy(
3000 this, frame_); 3004 this, frame_);
3001 } 3005 }
3002 3006
3007 blink::WebWorkerFetchContext* RenderFrameImpl::CreateWorkerFetchContext() {
3008 if (!base::FeatureList::IsEnabled(features::kOffMainThreadFetch))
nhiroki 2017/04/20 04:16:06 DCHECK(base::FeatureList::IsEnabled(features::kOff
horo 2017/04/20 08:35:43 Done.
3009 return nullptr;
3010 mojom::WorkerURLLoaderFactoryProviderPtr worker_url_loader_factory_provider;
3011 RenderThreadImpl::current()
3012 ->blink_platform_impl()
3013 ->GetInterfaceProvider()
3014 ->GetInterface(mojo::MakeRequest(&worker_url_loader_factory_provider));
3015 WorkerFetchContextImpl* worker_fetch_context = new WorkerFetchContextImpl(
3016 worker_url_loader_factory_provider.PassInterface());
3017 blink::WebServiceWorkerNetworkProvider* web_provider =
3018 frame_->DataSource()->GetServiceWorkerNetworkProvider();
3019 if (web_provider) {
3020 ServiceWorkerNetworkProvider* provider =
3021 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider(
3022 web_provider);
3023 worker_fetch_context->SetServiceWorkerProviderID(provider->provider_id());
3024 worker_fetch_context->SetIsControlledByServiceWorker(
3025 provider->IsControlledByServiceWorker());
3026 }
3027 return worker_fetch_context;
3028 }
3029
3003 WebExternalPopupMenu* RenderFrameImpl::CreateExternalPopupMenu( 3030 WebExternalPopupMenu* RenderFrameImpl::CreateExternalPopupMenu(
3004 const WebPopupMenuInfo& popup_menu_info, 3031 const WebPopupMenuInfo& popup_menu_info,
3005 WebExternalPopupMenuClient* popup_menu_client) { 3032 WebExternalPopupMenuClient* popup_menu_client) {
3006 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 3033 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
3007 // An IPC message is sent to the browser to build and display the actual 3034 // An IPC message is sent to the browser to build and display the actual
3008 // popup. The user could have time to click a different select by the time 3035 // popup. The user could have time to click a different select by the time
3009 // the popup is shown. In that case external_popup_menu_ is non NULL. 3036 // the popup is shown. In that case external_popup_menu_ is non NULL.
3010 // By returning NULL in that case, we instruct Blink to cancel that new 3037 // By returning NULL in that case, we instruct Blink to cancel that new
3011 // popup. So from the user perspective, only the first one will show, and 3038 // popup. So from the user perspective, only the first one will show, and
3012 // will have to close the first one before another one can be shown. 3039 // 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
6988 policy(info.default_policy), 7015 policy(info.default_policy),
6989 replaces_current_history_item(info.replaces_current_history_item), 7016 replaces_current_history_item(info.replaces_current_history_item),
6990 history_navigation_in_new_child_frame( 7017 history_navigation_in_new_child_frame(
6991 info.is_history_navigation_in_new_child_frame), 7018 info.is_history_navigation_in_new_child_frame),
6992 client_redirect(info.is_client_redirect), 7019 client_redirect(info.is_client_redirect),
6993 cache_disabled(info.is_cache_disabled), 7020 cache_disabled(info.is_cache_disabled),
6994 form(info.form), 7021 form(info.form),
6995 source_location(info.source_location) {} 7022 source_location(info.source_location) {}
6996 7023
6997 } // namespace content 7024 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698