OLD | NEW |
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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 } | 418 } |
419 | 419 |
420 void ResourcePrefetchPredictor::FinishedPrefetchForNavigation( | 420 void ResourcePrefetchPredictor::FinishedPrefetchForNavigation( |
421 const NavigationID& navigation_id, | 421 const NavigationID& navigation_id, |
422 PrefetchKeyType key_type, | 422 PrefetchKeyType key_type, |
423 ResourcePrefetcher::RequestVector* requests) { | 423 ResourcePrefetcher::RequestVector* requests) { |
424 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 424 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
425 | 425 |
426 scoped_ptr<Result> result(new Result(key_type, requests)); | 426 scoped_ptr<Result> result(new Result(key_type, requests)); |
427 // Add the results to the results map. | 427 // Add the results to the results map. |
428 if (!results_map_.insert(std::make_pair(navigation_id, result.Pass())).second) | 428 if (!results_map_.insert(std::make_pair(navigation_id, std::move(result))) |
| 429 .second) |
429 DLOG(FATAL) << "Returning results for existing navigation."; | 430 DLOG(FATAL) << "Returning results for existing navigation."; |
430 } | 431 } |
431 | 432 |
432 void ResourcePrefetchPredictor::Shutdown() { | 433 void ResourcePrefetchPredictor::Shutdown() { |
433 if (prefetch_manager_.get()) { | 434 if (prefetch_manager_.get()) { |
434 prefetch_manager_->ShutdownOnUIThread(); | 435 prefetch_manager_->ShutdownOnUIThread(); |
435 prefetch_manager_ = NULL; | 436 prefetch_manager_ = NULL; |
436 } | 437 } |
437 history_service_observer_.RemoveAll(); | 438 history_service_observer_.RemoveAll(); |
438 } | 439 } |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 // HistoryService is already loaded. Continue with Initialization. | 1336 // HistoryService is already loaded. Continue with Initialization. |
1336 OnHistoryAndCacheLoaded(); | 1337 OnHistoryAndCacheLoaded(); |
1337 return; | 1338 return; |
1338 } | 1339 } |
1339 DCHECK(!history_service_observer_.IsObserving(history_service)); | 1340 DCHECK(!history_service_observer_.IsObserving(history_service)); |
1340 history_service_observer_.Add(history_service); | 1341 history_service_observer_.Add(history_service); |
1341 return; | 1342 return; |
1342 } | 1343 } |
1343 | 1344 |
1344 } // namespace predictors | 1345 } // namespace predictors |
OLD | NEW |