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

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

Issue 15476003: Move TransferNavigationResourceThrottle into CrossSiteResourceHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up Created 7 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 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 531b382c42151b47fa08afbb80d811ef7065ad4f..1ef06748fca51433dcc14d57c936e850c823de59 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -40,7 +40,6 @@
#include "content/browser/loader/stream_resource_handler.h"
#include "content/browser/loader/sync_resource_handler.h"
#include "content/browser/loader/throttling_resource_handler.h"
-#include "content/browser/loader/transfer_navigation_resource_throttle.h"
#include "content/browser/plugin_service_impl.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
@@ -1071,16 +1070,14 @@ void ResourceDispatcherHostImpl::BeginRequest(
new RedirectToFileResourceHandler(handler.Pass(), child_id, this));
}
- // Install a CrossSiteResourceHandler if this request is coming from a
- // RenderViewHost with a pending cross-site request. We only check this for
- // MAIN_FRAME requests. Unblock requests only come from a blocked page, do
- // not count as cross-site, otherwise it gets blocked indefinitely.
+ // Install a CrossSiteResourceHandler for all main frame requests. This will
+ // let us check whether a transfer is required and pause for the unload
+ // handler either if so or if a cross-process navigation is already under way.
+ // We skip this if we have a deferred_loader, since we have already gone
+ // through the transition in that case.
if (request_data.resource_type == ResourceType::MAIN_FRAME &&
process_type == PROCESS_TYPE_RENDERER &&
- CrossSiteRequestManager::GetInstance()->
- HasPendingCrossSiteRequest(child_id, route_id)) {
- // Wrap the event handler to be sure the current page's onunload handler
- // has a chance to run before we render the new page.
+ !deferred_loader.get()) {
handler.reset(new CrossSiteResourceHandler(handler.Pass(), child_id,
route_id, request));
}
@@ -1109,12 +1106,6 @@ void ResourceDispatcherHostImpl::BeginRequest(
throttles.push_back(new PowerSaveBlockResourceThrottle());
}
- if (request_data.resource_type == ResourceType::MAIN_FRAME) {
- throttles.insert(
- throttles.begin(),
- new TransferNavigationResourceThrottle(request));
- }
-
throttles.push_back(
scheduler_->ScheduleRequest(child_id, route_id, request).release());
@@ -1212,7 +1203,6 @@ ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo(
true); // is_async
}
-
void ResourceDispatcherHostImpl::OnDidLoadResourceFromMemoryCache(
const GURL& url,
const std::string& security_info,

Powered by Google App Engine
This is Rietveld 408576698