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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor.cc

Issue 10825118: Speculative resource prefetching - Test fixes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing comment. 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
« 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/predictors/resource_prefetch_predictor.cc
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc
index 5f247e0151d04ad6f3cc1ed8c07f0dfe897ad7d6..a65f5d5967bff06fc78f6409c9c9fb3dcf4c4697 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
@@ -326,14 +326,6 @@ void ResourcePrefetchPredictor::OnMainFrameRequest(
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_EQ(INITIALIZED, initialization_state_);
- // TODO(shishir): Remove this code after verifying that the same navigation is
- // not seen multiple times.
- NavigationMap::const_iterator it =
- inflight_navigations_.find(request.navigation_id);
- if (it != inflight_navigations_.end()) {
- DCHECK(it->first.creation_time != request.navigation_id.creation_time);
- }
-
// Cleanup older navigations.
CleanupAbandonedNavigations(request.navigation_id);
@@ -416,7 +408,10 @@ void ResourcePrefetchPredictor::Observe(
const content::WebContents* web_contents =
content::Source<content::WebContents>(source).ptr();
NavigationID navigation_id(*web_contents);
- OnNavigationComplete(navigation_id);
+ // WebContents can return an empty URL if the navigation entry
+ // corresponding to the navigation has not been created yet.
+ if (!navigation_id.main_frame_url.is_empty())
+ OnNavigationComplete(navigation_id);
break;
}
« 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