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

Side by Side Diff: content/renderer/pepper/pepper_url_loader_host.cc

Issue 2105503002: Skip foreign fetch when the skipServiceWorker flag is set on a request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rephrase SkipServiceWorker comments. Created 4 years, 5 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/pepper/pepper_url_loader_host.h" 5 #include "content/renderer/pepper/pepper_url_loader_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" 9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
10 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" 10 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (!CreateWebURLRequest( 257 if (!CreateWebURLRequest(
258 pp_instance(), &filled_in_request_data, frame, &web_request)) { 258 pp_instance(), &filled_in_request_data, frame, &web_request)) {
259 return PP_ERROR_FAILED; 259 return PP_ERROR_FAILED;
260 } 260 }
261 261
262 web_request.setRequestContext(WebURLRequest::RequestContextPlugin); 262 web_request.setRequestContext(WebURLRequest::RequestContextPlugin);
263 web_request.setRequestorProcessID(renderer_ppapi_host_->GetPluginPID()); 263 web_request.setRequestorProcessID(renderer_ppapi_host_->GetPluginPID());
264 // The requests from the plugins with private permission which can bypass same 264 // The requests from the plugins with private permission which can bypass same
265 // origin must skip the ServiceWorker. 265 // origin must skip the ServiceWorker.
266 web_request.setSkipServiceWorker( 266 web_request.setSkipServiceWorker(
267 host()->permissions().HasPermission(ppapi::PERMISSION_PRIVATE)); 267 host()->permissions().HasPermission(ppapi::PERMISSION_PRIVATE)
268 ? blink::WebURLRequest::SkipServiceWorker::All
269 : blink::WebURLRequest::SkipServiceWorker::None);
268 270
269 WebURLLoaderOptions options; 271 WebURLLoaderOptions options;
270 if (has_universal_access_) { 272 if (has_universal_access_) {
271 options.allowCredentials = true; 273 options.allowCredentials = true;
272 options.crossOriginRequestPolicy = 274 options.crossOriginRequestPolicy =
273 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; 275 WebURLLoaderOptions::CrossOriginRequestPolicyAllow;
274 } else { 276 } else {
275 // All other HTTP requests are untrusted. 277 // All other HTTP requests are untrusted.
276 options.untrustedHTTP = true; 278 options.untrustedHTTP = true;
277 if (filled_in_request_data.allow_cross_origin_requests) { 279 if (filled_in_request_data.allow_cross_origin_requests) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 ppapi::proxy::ResourceMessageReplyParams params; 437 ppapi::proxy::ResourceMessageReplyParams params;
436 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress( 438 SendUpdateToPlugin(new PpapiPluginMsg_URLLoader_UpdateProgress(
437 record_upload ? bytes_sent_ : -1, 439 record_upload ? bytes_sent_ : -1,
438 record_upload ? total_bytes_to_be_sent_ : -1, 440 record_upload ? total_bytes_to_be_sent_ : -1,
439 record_download ? bytes_received_ : -1, 441 record_download ? bytes_received_ : -1,
440 record_download ? total_bytes_to_be_received_ : -1)); 442 record_download ? total_bytes_to_be_received_ : -1));
441 } 443 }
442 } 444 }
443 445
444 } // namespace content 446 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/fetchers/resource_fetcher_impl.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698