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

Side by Side Diff: chrome/browser/predictors/resource_prefetch_predictor.cc

Issue 2373443002: predictors: Key the resource prefetcher by URL, not navigation. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 5 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 std::vector<GURL> urls; 555 std::vector<GURL> urls;
556 PrefetchKeyType key_type; 556 PrefetchKeyType key_type;
557 if (!GetPrefetchData(navigation_id, &urls, &key_type)) { 557 if (!GetPrefetchData(navigation_id, &urls, &key_type)) {
558 // No prefetching data at host or URL level. 558 // No prefetching data at host or URL level.
559 return; 559 return;
560 } 560 }
561 561
562 BrowserThread::PostTask( 562 BrowserThread::PostTask(
563 BrowserThread::IO, FROM_HERE, 563 BrowserThread::IO, FROM_HERE,
564 base::Bind(&ResourcePrefetcherManager::MaybeAddPrefetch, 564 base::Bind(&ResourcePrefetcherManager::MaybeAddPrefetch,
565 prefetch_manager_, navigation_id, key_type, urls)); 565 prefetch_manager_, navigation_id, urls));
566 } 566 }
567 567
568 void ResourcePrefetchPredictor::StopPrefetching( 568 void ResourcePrefetchPredictor::StopPrefetching(
569 const NavigationID& navigation_id) { 569 const NavigationID& navigation_id) {
570 if (!prefetch_manager_.get()) // Not enabled. 570 if (!prefetch_manager_.get()) // Not enabled.
571 return; 571 return;
572 572
573 BrowserThread::PostTask( 573 BrowserThread::PostTask(
574 BrowserThread::IO, FROM_HERE, 574 BrowserThread::IO, FROM_HERE,
575 base::Bind(&ResourcePrefetcherManager::MaybeRemovePrefetch, 575 base::Bind(&ResourcePrefetcherManager::MaybeRemovePrefetch,
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 // HistoryService is already loaded. Continue with Initialization. 927 // HistoryService is already loaded. Continue with Initialization.
928 OnHistoryAndCacheLoaded(); 928 OnHistoryAndCacheLoaded();
929 return; 929 return;
930 } 930 }
931 DCHECK(!history_service_observer_.IsObserving(history_service)); 931 DCHECK(!history_service_observer_.IsObserving(history_service));
932 history_service_observer_.Add(history_service); 932 history_service_observer_.Add(history_service);
933 return; 933 return;
934 } 934 }
935 935
936 } // namespace predictors 936 } // namespace predictors
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698