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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 10827103: Speculative resource prefetching - fixing missing navigations due to server side redirects. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressing James's comments. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index 21375335366c7f380a4e378bb8fdbc4a98afa155..d0157be18043a254272aace778c8676788b46e56 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -152,9 +152,10 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
throttles);
ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
- if (io_data->resource_prefetch_predictor_observer())
+ if (io_data->resource_prefetch_predictor_observer()) {
io_data->resource_prefetch_predictor_observer()->OnRequestStarted(
request, resource_type, child_id, route_id);
+ }
}
void ChromeResourceDispatcherHostDelegate::DownloadStarting(
@@ -360,6 +361,7 @@ void ChromeResourceDispatcherHostDelegate::OnResponseStarted(
}
void ChromeResourceDispatcherHostDelegate::OnRequestRedirected(
+ const GURL& redirect_url,
net::URLRequest* request,
content::ResourceContext* resource_context,
content::ResourceResponse* response) {
@@ -376,9 +378,10 @@ void ChromeResourceDispatcherHostDelegate::OnRequestRedirected(
#endif
ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
- if (io_data->resource_prefetch_predictor_observer())
+ if (io_data->resource_prefetch_predictor_observer()) {
io_data->resource_prefetch_predictor_observer()->OnRequestRedirected(
- request);
+ redirect_url, request);
+ }
}
void ChromeResourceDispatcherHostDelegate::OnFieldTrialGroupFinalized(

Powered by Google App Engine
This is Rietveld 408576698