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

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

Issue 2925903004: Add support for blob urls for subresources. (Closed)
Patch Set: Created 3 years, 6 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>
(...skipping 4279 matching lines...) Expand 10 before | Expand all | Expand 10 after
4290 // was a navigation initiated by the renderer to the new RequestExtraData 4290 // was a navigation initiated by the renderer to the new RequestExtraData
4291 // instance. 4291 // instance.
4292 RequestExtraData* current_request_data = 4292 RequestExtraData* current_request_data =
4293 static_cast<RequestExtraData*>(request.GetExtraData()); 4293 static_cast<RequestExtraData*>(request.GetExtraData());
4294 if (current_request_data) { 4294 if (current_request_data) {
4295 extra_data->set_navigation_initiated_by_renderer( 4295 extra_data->set_navigation_initiated_by_renderer(
4296 current_request_data->navigation_initiated_by_renderer()); 4296 current_request_data->navigation_initiated_by_renderer());
4297 } 4297 }
4298 } 4298 }
4299 4299
4300 extra_data->set_url_loader_factory_override(url_loader_factory_.get()); 4300 // TODO: generalize how non-network schemes are sent to the renderer and used.
4301 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
4302 switches::kEnableNetworkService)) {
4303 if (request.Url().ProtocolIs(url::kBlobScheme)) {
4304 extra_data->set_url_loader_factory_override(
4305 RenderThreadImpl::current()->GetBlobURLLoaderFactory());
4306 }
4307 }
4308
4309 if (!extra_data->url_loader_factory_override())
4310 extra_data->set_url_loader_factory_override(url_loader_factory_.get());
4311
4301 // TODO(kinuko, yzshen): We need to set up throttles for some worker cases 4312 // TODO(kinuko, yzshen): We need to set up throttles for some worker cases
4302 // that don't go through here. 4313 // that don't go through here.
4303 extra_data->set_url_loader_throttles(std::move(throttles)); 4314 extra_data->set_url_loader_throttles(std::move(throttles));
4304 4315
4305 request.SetExtraData(extra_data); 4316 request.SetExtraData(extra_data);
4306 4317
4307 if (request.GetPreviewsState() == WebURLRequest::kPreviewsUnspecified) { 4318 if (request.GetPreviewsState() == WebURLRequest::kPreviewsUnspecified) {
4308 if (is_main_frame_ && !navigation_state->request_committed()) { 4319 if (is_main_frame_ && !navigation_state->request_committed()) {
4309 request.SetPreviewsState(static_cast<WebURLRequest::PreviewsState>( 4320 request.SetPreviewsState(static_cast<WebURLRequest::PreviewsState>(
4310 navigation_state->common_params().previews_state)); 4321 navigation_state->common_params().previews_state));
(...skipping 2471 matching lines...) Expand 10 before | Expand all | Expand 10 after
6782 policy(info.default_policy), 6793 policy(info.default_policy),
6783 replaces_current_history_item(info.replaces_current_history_item), 6794 replaces_current_history_item(info.replaces_current_history_item),
6784 history_navigation_in_new_child_frame( 6795 history_navigation_in_new_child_frame(
6785 info.is_history_navigation_in_new_child_frame), 6796 info.is_history_navigation_in_new_child_frame),
6786 client_redirect(info.is_client_redirect), 6797 client_redirect(info.is_client_redirect),
6787 cache_disabled(info.is_cache_disabled), 6798 cache_disabled(info.is_cache_disabled),
6788 form(info.form), 6799 form(info.form),
6789 source_location(info.source_location) {} 6800 source_location(info.source_location) {}
6790 6801
6791 } // namespace content 6802 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698