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

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: s/WebScheduler.h/web_scheduler.h/ Created 3 years, 7 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
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 17 matching lines...) Expand all
172 #include "net/base/load_flags.h" 175 #include "net/base/load_flags.h"
173 #include "net/base/net_errors.h" 176 #include "net/base/net_errors.h"
174 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 177 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
175 #include "net/http/http_util.h" 178 #include "net/http/http_util.h"
176 #include "ppapi/features/features.h" 179 #include "ppapi/features/features.h"
177 #include "services/service_manager/public/cpp/interface_provider.h" 180 #include "services/service_manager/public/cpp/interface_provider.h"
178 #include "services/service_manager/public/cpp/interface_registry.h" 181 #include "services/service_manager/public/cpp/interface_registry.h"
179 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" 182 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
180 #include "storage/common/data_element.h" 183 #include "storage/common/data_element.h"
181 #include "third_party/WebKit/public/platform/FilePathConversion.h" 184 #include "third_party/WebKit/public/platform/FilePathConversion.h"
185 #include "third_party/WebKit/public/platform/InterfaceProvider.h"
182 #include "third_party/WebKit/public/platform/URLConversion.h" 186 #include "third_party/WebKit/public/platform/URLConversion.h"
183 #include "third_party/WebKit/public/platform/WebCachePolicy.h" 187 #include "third_party/WebKit/public/platform/WebCachePolicy.h"
184 #include "third_party/WebKit/public/platform/WebData.h" 188 #include "third_party/WebKit/public/platform/WebData.h"
185 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" 189 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h"
186 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" 190 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
187 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h" 191 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h"
188 #include "third_party/WebKit/public/platform/WebPoint.h" 192 #include "third_party/WebKit/public/platform/WebPoint.h"
189 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" 193 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
190 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" 194 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h"
191 #include "third_party/WebKit/public/platform/WebString.h" 195 #include "third_party/WebKit/public/platform/WebString.h"
(...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after
3019 } 3023 }
3020 3024
3021 blink::WebWorkerContentSettingsClientProxy* 3025 blink::WebWorkerContentSettingsClientProxy*
3022 RenderFrameImpl::CreateWorkerContentSettingsClientProxy() { 3026 RenderFrameImpl::CreateWorkerContentSettingsClientProxy() {
3023 if (!frame_ || !frame_->View()) 3027 if (!frame_ || !frame_->View())
3024 return NULL; 3028 return NULL;
3025 return GetContentClient()->renderer()->CreateWorkerContentSettingsClientProxy( 3029 return GetContentClient()->renderer()->CreateWorkerContentSettingsClientProxy(
3026 this, frame_); 3030 this, frame_);
3027 } 3031 }
3028 3032
3033 std::unique_ptr<blink::WebWorkerFetchContext>
3034 RenderFrameImpl::CreateWorkerFetchContext() {
3035 DCHECK(base::FeatureList::IsEnabled(features::kOffMainThreadFetch));
3036 mojom::WorkerURLLoaderFactoryProviderPtr worker_url_loader_factory_provider;
3037 RenderThreadImpl::current()
3038 ->blink_platform_impl()
3039 ->GetInterfaceProvider()
3040 ->GetInterface(mojo::MakeRequest(&worker_url_loader_factory_provider));
3041 std::unique_ptr<WorkerFetchContextImpl> worker_fetch_context =
3042 base::MakeUnique<WorkerFetchContextImpl>(
3043 worker_url_loader_factory_provider.PassInterface());
3044 blink::WebServiceWorkerNetworkProvider* web_provider =
3045 frame_->DataSource()->GetServiceWorkerNetworkProvider();
3046 if (web_provider) {
3047 ServiceWorkerNetworkProvider* provider =
3048 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider(
3049 web_provider);
3050 worker_fetch_context->set_service_worker_provider_id(
3051 provider->provider_id());
3052 worker_fetch_context->set_is_controlled_by_service_worker(
3053 provider->IsControlledByServiceWorker());
3054 }
3055 return std::move(worker_fetch_context);
3056 }
3057
3029 WebExternalPopupMenu* RenderFrameImpl::CreateExternalPopupMenu( 3058 WebExternalPopupMenu* RenderFrameImpl::CreateExternalPopupMenu(
3030 const WebPopupMenuInfo& popup_menu_info, 3059 const WebPopupMenuInfo& popup_menu_info,
3031 WebExternalPopupMenuClient* popup_menu_client) { 3060 WebExternalPopupMenuClient* popup_menu_client) {
3032 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 3061 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
3033 // An IPC message is sent to the browser to build and display the actual 3062 // An IPC message is sent to the browser to build and display the actual
3034 // popup. The user could have time to click a different select by the time 3063 // popup. The user could have time to click a different select by the time
3035 // the popup is shown. In that case external_popup_menu_ is non NULL. 3064 // the popup is shown. In that case external_popup_menu_ is non NULL.
3036 // By returning NULL in that case, we instruct Blink to cancel that new 3065 // By returning NULL in that case, we instruct Blink to cancel that new
3037 // popup. So from the user perspective, only the first one will show, and 3066 // popup. So from the user perspective, only the first one will show, and
3038 // will have to close the first one before another one can be shown. 3067 // will have to close the first one before another one can be shown.
(...skipping 3987 matching lines...) Expand 10 before | Expand all | Expand 10 after
7026 policy(info.default_policy), 7055 policy(info.default_policy),
7027 replaces_current_history_item(info.replaces_current_history_item), 7056 replaces_current_history_item(info.replaces_current_history_item),
7028 history_navigation_in_new_child_frame( 7057 history_navigation_in_new_child_frame(
7029 info.is_history_navigation_in_new_child_frame), 7058 info.is_history_navigation_in_new_child_frame),
7030 client_redirect(info.is_client_redirect), 7059 client_redirect(info.is_client_redirect),
7031 cache_disabled(info.is_cache_disabled), 7060 cache_disabled(info.is_cache_disabled),
7032 form(info.form), 7061 form(info.form),
7033 source_location(info.source_location) {} 7062 source_location(info.source_location) {}
7034 7063
7035 } // namespace content 7064 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698