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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.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: add comments explaing why skip is set to ::Controlling for fallback requests 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 // Hang on to a reference to ensure the blob is not released prior 1560 // Hang on to a reference to ensure the blob is not released prior
1561 // to the job being started. 1561 // to the job being started.
1562 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( 1562 storage::BlobProtocolHandler::SetRequestedBlobDataHandle(
1563 new_request.get(), 1563 new_request.get(),
1564 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL( 1564 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL(
1565 new_request->url())); 1565 new_request->url()));
1566 } 1566 }
1567 1567
1568 // Initialize the service worker handler for the request. We don't use 1568 // Initialize the service worker handler for the request. We don't use
1569 // ServiceWorker for synchronous loads to avoid renderer deadlocks. 1569 // ServiceWorker for synchronous loads to avoid renderer deadlocks.
1570 const bool should_skip_service_worker = 1570 const SkipServiceWorker should_skip_service_worker =
1571 request_data.skip_service_worker || is_sync_load; 1571 is_sync_load ? SkipServiceWorker::ALL : request_data.skip_service_worker;
1572 ServiceWorkerRequestHandler::InitializeHandler( 1572 ServiceWorkerRequestHandler::InitializeHandler(
1573 new_request.get(), filter_->service_worker_context(), blob_context, 1573 new_request.get(), filter_->service_worker_context(), blob_context,
1574 child_id, request_data.service_worker_provider_id, 1574 child_id, request_data.service_worker_provider_id,
1575 should_skip_service_worker, 1575 should_skip_service_worker != SkipServiceWorker::NONE,
1576 request_data.fetch_request_mode, request_data.fetch_credentials_mode, 1576 request_data.fetch_request_mode, request_data.fetch_credentials_mode,
1577 request_data.fetch_redirect_mode, request_data.resource_type, 1577 request_data.fetch_redirect_mode, request_data.resource_type,
1578 request_data.fetch_request_context_type, request_data.fetch_frame_type, 1578 request_data.fetch_request_context_type, request_data.fetch_frame_type,
1579 request_data.request_body); 1579 request_data.request_body);
1580 1580
1581 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 1581 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
1582 switches::kEnableExperimentalWebPlatformFeatures)) { 1582 switches::kEnableExperimentalWebPlatformFeatures)) {
1583 ForeignFetchRequestHandler::InitializeHandler( 1583 ForeignFetchRequestHandler::InitializeHandler(
1584 new_request.get(), filter_->service_worker_context(), blob_context, 1584 new_request.get(), filter_->service_worker_context(), blob_context,
1585 child_id, request_data.service_worker_provider_id, 1585 child_id, request_data.service_worker_provider_id,
1586 should_skip_service_worker, 1586 should_skip_service_worker, request_data.fetch_request_mode,
1587 request_data.fetch_request_mode, request_data.fetch_credentials_mode, 1587 request_data.fetch_credentials_mode, request_data.fetch_redirect_mode,
1588 request_data.fetch_redirect_mode, request_data.resource_type, 1588 request_data.resource_type, request_data.fetch_request_context_type,
1589 request_data.fetch_request_context_type, request_data.fetch_frame_type, 1589 request_data.fetch_frame_type, request_data.request_body,
1590 request_data.request_body, request_data.initiated_in_secure_context); 1590 request_data.initiated_in_secure_context);
1591 } 1591 }
1592 1592
1593 // Have the appcache associate its extra info with the request. 1593 // Have the appcache associate its extra info with the request.
1594 AppCacheInterceptor::SetExtraRequestInfo( 1594 AppCacheInterceptor::SetExtraRequestInfo(
1595 new_request.get(), filter_->appcache_service(), child_id, 1595 new_request.get(), filter_->appcache_service(), child_id,
1596 request_data.appcache_host_id, request_data.resource_type, 1596 request_data.appcache_host_id, request_data.resource_type,
1597 request_data.should_reset_appcache); 1597 request_data.should_reset_appcache);
1598 1598
1599 std::unique_ptr<ResourceHandler> handler(CreateResourceHandler( 1599 std::unique_ptr<ResourceHandler> handler(CreateResourceHandler(
1600 new_request.get(), request_data, sync_result, route_id, process_type, 1600 new_request.get(), request_data, sync_result, route_id, process_type,
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
2632 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); 2632 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id);
2633 response->head.security_info = SerializeSecurityInfo(ssl); 2633 response->head.security_info = SerializeSecurityInfo(ssl);
2634 } 2634 }
2635 2635
2636 CertStore* ResourceDispatcherHostImpl::GetCertStore() { 2636 CertStore* ResourceDispatcherHostImpl::GetCertStore() {
2637 return cert_store_for_testing_ ? cert_store_for_testing_ 2637 return cert_store_for_testing_ ? cert_store_for_testing_
2638 : CertStore::GetInstance(); 2638 : CertStore::GetInstance();
2639 } 2639 }
2640 2640
2641 } // namespace content 2641 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698