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

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: 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..ef918bd8dd2bbf79cd7deb858aea926bd495a981 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,9 @@ 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 is no navigation entry yet.
dominich 2012/07/31 23:08:50 nit: the -> there
Shishir 2012/07/31 23:29:35 Done.
+ if (!navigation_id.main_frame_url.is_empty())
dominich 2012/07/31 23:08:50 Also, expand the comment to explain 1) when this m
Shishir 2012/07/31 23:29:35 Its the way the GetUrl() function call in webconte
+ OnNavigationComplete(navigation_id);
dominich 2012/07/31 23:08:50 When do we erase this from inflight navigations if
Shishir 2012/07/31 23:29:35 In CleanupOldNavigations.
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