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

Side by Side Diff: content/child/web_url_request_util.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
« no previous file with comments | « content/child/web_url_request_util.h ('k') | content/common/resource_messages.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/child/web_url_request_util.h" 5 #include "content/child/web_url_request_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XML_HTTP_REQUEST, 449 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XML_HTTP_REQUEST,
450 WebURLRequest::RequestContextXMLHttpRequest); 450 WebURLRequest::RequestContextXMLHttpRequest);
451 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XSLT, 451 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XSLT,
452 WebURLRequest::RequestContextXSLT); 452 WebURLRequest::RequestContextXSLT);
453 453
454 RequestContextType GetRequestContextTypeForWebURLRequest( 454 RequestContextType GetRequestContextTypeForWebURLRequest(
455 const blink::WebURLRequest& request) { 455 const blink::WebURLRequest& request) {
456 return static_cast<RequestContextType>(request.getRequestContext()); 456 return static_cast<RequestContextType>(request.getRequestContext());
457 } 457 }
458 458
459 STATIC_ASSERT_ENUM(SkipServiceWorker::NONE,
460 WebURLRequest::SkipServiceWorker::None);
461 STATIC_ASSERT_ENUM(SkipServiceWorker::CONTROLLING,
462 WebURLRequest::SkipServiceWorker::Controlling);
463 STATIC_ASSERT_ENUM(SkipServiceWorker::ALL,
464 WebURLRequest::SkipServiceWorker::All);
465
466 SkipServiceWorker GetSkipServiceWorkerForWebURLRequest(
467 const blink::WebURLRequest& request) {
468 return static_cast<SkipServiceWorker>(request.skipServiceWorker());
469 }
470
459 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url, 471 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url,
460 bool stale_copy_in_cache, 472 bool stale_copy_in_cache,
461 int reason) { 473 int reason) {
462 blink::WebURLError error; 474 blink::WebURLError error;
463 error.domain = WebString::fromUTF8(net::kErrorDomain); 475 error.domain = WebString::fromUTF8(net::kErrorDomain);
464 error.reason = reason; 476 error.reason = reason;
465 error.unreachableURL = unreachable_url; 477 error.unreachableURL = unreachable_url;
466 error.staleCopyInCache = stale_copy_in_cache; 478 error.staleCopyInCache = stale_copy_in_cache;
467 if (reason == net::ERR_ABORTED) { 479 if (reason == net::ERR_ABORTED) {
468 error.isCancellation = true; 480 error.isCancellation = true;
(...skipping 11 matching lines...) Expand all
480 bool stale_copy_in_cache, 492 bool stale_copy_in_cache,
481 int reason, 493 int reason,
482 bool was_ignored_by_handler) { 494 bool was_ignored_by_handler) {
483 blink::WebURLError error = 495 blink::WebURLError error =
484 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); 496 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason);
485 error.wasIgnoredByHandler = was_ignored_by_handler; 497 error.wasIgnoredByHandler = was_ignored_by_handler;
486 return error; 498 return error;
487 } 499 }
488 500
489 } // namespace content 501 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_url_request_util.h ('k') | content/common/resource_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698