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

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

Issue 2377643002: predictors: Make the resource_prefetch_predictor accessible from Java. (Closed)
Patch Set: Address comments. Created 4 years, 2 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 | « chrome/browser/predictors/resource_prefetcher_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/predictors/resource_prefetcher_manager.cc
diff --git a/chrome/browser/predictors/resource_prefetcher_manager.cc b/chrome/browser/predictors/resource_prefetcher_manager.cc
index 949d4407da0d66a922e2d4d18ebe1f2bd89dc246..476ba79832045499ae21116bf822da2542bb2be5 100644
--- a/chrome/browser/predictors/resource_prefetcher_manager.cc
+++ b/chrome/browser/predictors/resource_prefetcher_manager.cc
@@ -51,12 +51,11 @@ void ResourcePrefetcherManager::ShutdownOnIOThread() {
}
void ResourcePrefetcherManager::MaybeAddPrefetch(
- const NavigationID& navigation_id,
+ const GURL& main_frame_url,
const std::vector<GURL>& urls) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
// Don't add a duplicate prefetch for the same host.
- const GURL& main_frame_url = navigation_id.main_frame_url;
std::string key = main_frame_url.host();
if (base::ContainsKey(prefetcher_map_, key))
return;
@@ -68,17 +67,14 @@ void ResourcePrefetcherManager::MaybeAddPrefetch(
}
void ResourcePrefetcherManager::MaybeRemovePrefetch(
- const NavigationID& navigation_id) {
+ const GURL& main_frame_url) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- const GURL& main_frame_url = navigation_id.main_frame_url;
std::string key = main_frame_url.host();
-
auto it = prefetcher_map_.find(key);
if (it != prefetcher_map_.end() &&
- it->second->main_frame_url() == navigation_id.main_frame_url) {
+ it->second->main_frame_url() == main_frame_url) {
it->second->Stop();
- return;
}
}
« no previous file with comments | « chrome/browser/predictors/resource_prefetcher_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698