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

Unified Diff: chrome/browser/net/resource_prefetch_predictor_observer.cc

Issue 10829195: Speculative resource prefetching - Not modify resource_type for MAIN_FRAME requests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove extra braces. Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/resource_prefetch_predictor_observer.cc
diff --git a/chrome/browser/net/resource_prefetch_predictor_observer.cc b/chrome/browser/net/resource_prefetch_predictor_observer.cc
index 0de2c189a43e64bf2556898aa30599eedf51a6db..f1aad0257e3a427adc78cbd82226d1516dae4ae1 100644
--- a/chrome/browser/net/resource_prefetch_predictor_observer.cc
+++ b/chrome/browser/net/resource_prefetch_predictor_observer.cc
@@ -40,12 +40,14 @@ bool SummarizeResponse(net::URLRequest* request,
request->GetMimeType(&summary->mime_type);
summary->was_cached = request->was_cached();
- // We want to rely on the mime_type to determine the resource type since we
- // dont want types such as PREFETCH, SUB_RESOURCE, etc.
- summary->resource_type =
- ResourcePrefetchPredictor::GetResourceTypeFromMimeType(
- summary->mime_type,
- summary->resource_type);
+ // Use the mime_type to determine the resource type for subresources since
+ // types such as PREFETCH, SUB_RESOURCE, etc are not useful.
+ if (summary->resource_type != ResourceType::MAIN_FRAME) {
+ summary->resource_type =
+ ResourcePrefetchPredictor::GetResourceTypeFromMimeType(
+ summary->mime_type,
+ summary->resource_type);
+ }
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698