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

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

Issue 2847183002: predictors: Introduce GlowplugPredictor. (Closed)
Patch Set: GlowplugPredictor -> LoadingPredictor Created 3 years, 7 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
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_prefetcher_manager.h" 5 #include "chrome/browser/predictors/resource_prefetcher_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 12 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
13 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
14 #include "net/url_request/url_request.h" 14 #include "net/url_request/url_request.h"
15 #include "net/url_request/url_request_context_getter.h" 15 #include "net/url_request/url_request_context_getter.h"
16 16
17 using content::BrowserThread; 17 using content::BrowserThread;
18 18
19 namespace predictors { 19 namespace predictors {
20 20
21 ResourcePrefetcherManager::ResourcePrefetcherManager( 21 ResourcePrefetcherManager::ResourcePrefetcherManager(
22 ResourcePrefetchPredictor* predictor, 22 ResourcePrefetchPredictor* predictor,
23 const ResourcePrefetchPredictorConfig& config, 23 const LoadingPredictorConfig& config,
24 net::URLRequestContextGetter* context_getter) 24 net::URLRequestContextGetter* context_getter)
25 : predictor_(predictor), 25 : predictor_(predictor), config_(config), context_getter_(context_getter) {
26 config_(config),
27 context_getter_(context_getter) {
28 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 26 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
29 CHECK(predictor_); 27 CHECK(predictor_);
30 CHECK(context_getter_); 28 CHECK(context_getter_);
31 } 29 }
32 30
33 ResourcePrefetcherManager::~ResourcePrefetcherManager() { 31 ResourcePrefetcherManager::~ResourcePrefetcherManager() {
34 DCHECK(prefetcher_map_.empty()) 32 DCHECK(prefetcher_map_.empty())
35 << "Did not call ShutdownOnUIThread or ShutdownOnIOThread. " 33 << "Did not call ShutdownOnUIThread or ShutdownOnIOThread. "
36 " Will leak Prefetcher pointers."; 34 " Will leak Prefetcher pointers.";
37 } 35 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 prefetcher_map_.erase(it); 96 prefetcher_map_.erase(it);
99 } 97 }
100 98
101 net::URLRequestContext* ResourcePrefetcherManager::GetURLRequestContext() { 99 net::URLRequestContext* ResourcePrefetcherManager::GetURLRequestContext() {
102 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 100 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
103 101
104 return context_getter_->GetURLRequestContext(); 102 return context_getter_->GetURLRequestContext();
105 } 103 }
106 104
107 } // namespace predictors 105 } // namespace predictors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698