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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2321543002: Merge CrossSiteResourceHandler and NavigationResourceThrottle (Closed)
Patch Set: Fixed test compilation error Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index cf677edce7ffbaa4b1e23e8ad41e2cc8120a33a6..e02e704eacac48e4b1635ee8bf974c4435f2e560 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -45,7 +45,6 @@
#include "content/browser/frame_host/navigator.h"
#include "content/browser/loader/async_resource_handler.h"
#include "content/browser/loader/async_revalidation_manager.h"
-#include "content/browser/loader/cross_site_resource_handler.h"
#include "content/browser/loader/detachable_resource_handler.h"
#include "content/browser/loader/intercepting_resource_handler.h"
#include "content/browser/loader/loader_delegate.h"
@@ -1150,8 +1149,8 @@ void ResourceDispatcherHostImpl::UpdateRequestForTransfer(
// If a certificate is stored with the ResourceResponse, it has to be
// updated to be associated with the new process.
- if (loader->transferring_response()) {
- UpdateResponseCertificateForTransfer(loader->transferring_response(),
+ if (loader->response()) {
+ UpdateResponseCertificateForTransfer(loader->response(),
loader->request(),
info);
}
@@ -1202,9 +1201,6 @@ void ResourceDispatcherHostImpl::UpdateRequestForTransfer(
child_id, request_data.service_worker_provider_id);
}
}
-
- // We should have a CrossSiteResourceHandler to finish the transfer.
- DCHECK(info->cross_site_handler());
}
void ResourceDispatcherHostImpl::BeginRequest(
@@ -1595,28 +1591,6 @@ ResourceDispatcherHostImpl::CreateResourceHandler(
std::move(handler)));
}
- // PlzNavigate: If using --enable-browser-side-navigation, the
- // CrossSiteResourceHandler is not needed. This codepath is not used for the
- // actual navigation request, but only the subsequent blob URL load. This does
- // not require request transfers.
- if (!IsBrowserSideNavigationEnabled()) {
- // Install a CrossSiteResourceHandler for all main frame requests. This will
- // check whether a transfer is required and, if so, pause for the UI thread
- // to drive the transfer.
- bool is_swappable_navigation =
- request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME;
- // If out-of-process iframes are possible, then all subframe requests need
- // to go through the CrossSiteResourceHandler to enforce the site isolation
- // policy.
- if (!is_swappable_navigation &&
- SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
- is_swappable_navigation =
- request_data.resource_type == RESOURCE_TYPE_SUB_FRAME;
- }
- if (is_swappable_navigation && process_type == PROCESS_TYPE_RENDERER)
- handler.reset(new CrossSiteResourceHandler(std::move(handler), request));
- }
-
return AddStandardHandlers(
request, request_data.resource_type, resource_context,
request_data.fetch_request_context_type, filter_->appcache_service(),
@@ -1861,8 +1835,8 @@ void ResourceDispatcherHostImpl::OnRenderViewHostSetIsLoading(int child_id,
void ResourceDispatcherHostImpl::MarkAsTransferredNavigation(
const GlobalRequestID& id,
- const scoped_refptr<ResourceResponse>& response) {
- GetLoader(id)->MarkAsTransferring(response);
+ const base::Closure& on_transfer_complete_callback) {
+ GetLoader(id)->MarkAsTransferring(on_transfer_complete_callback);
}
void ResourceDispatcherHostImpl::CancelTransferringNavigation(

Powered by Google App Engine
This is Rietveld 408576698