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

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_service.cc

Issue 949533004: Rename DataReductionProxyStatisticsPrefs to DataReductionProxyCompressionStats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h"
6 6
7 #include "base/sequenced_task_runner.h" 7 #include "base/sequenced_task_runner.h"
8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h" 8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h"
9 #include "net/base/load_flags.h" 9 #include "net/base/load_flags.h"
10 #include "net/url_request/url_fetcher.h" 10 #include "net/url_request/url_fetcher.h"
11 #include "net/url_request/url_request_status.h" 11 #include "net/url_request/url_request_status.h"
12 12
13 namespace data_reduction_proxy { 13 namespace data_reduction_proxy {
14 14
15 DataReductionProxyService::DataReductionProxyService( 15 DataReductionProxyService::DataReductionProxyService(
16 scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs, 16 scoped_ptr<DataReductionProxyCompressionStats> statistics_prefs,
17 DataReductionProxySettings* settings, 17 DataReductionProxySettings* settings,
18 net::URLRequestContextGetter* request_context_getter) 18 net::URLRequestContextGetter* request_context_getter)
19 : url_request_context_getter_(request_context_getter), 19 : url_request_context_getter_(request_context_getter),
20 settings_(settings), 20 settings_(settings),
21 weak_factory_(this) { 21 weak_factory_(this) {
22 DCHECK(settings); 22 DCHECK(settings);
23 statistics_prefs_ = statistics_prefs.Pass(); 23 statistics_prefs_ = statistics_prefs.Pass();
24 } 24 }
25 25
26 DataReductionProxyService::~DataReductionProxyService() { 26 DataReductionProxyService::~DataReductionProxyService() {
27 } 27 }
28 28
29 void DataReductionProxyService::Shutdown() { 29 void DataReductionProxyService::Shutdown() {
30 DCHECK(CalledOnValidThread()); 30 DCHECK(CalledOnValidThread());
31 weak_factory_.InvalidateWeakPtrs(); 31 weak_factory_.InvalidateWeakPtrs();
32 } 32 }
33 33
34 void DataReductionProxyService::EnableCompressionStatisticsLogging( 34 void DataReductionProxyService::EnableCompressionStatisticsLogging(
35 PrefService* prefs, 35 PrefService* prefs,
36 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, 36 scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
37 const base::TimeDelta& commit_delay) { 37 const base::TimeDelta& commit_delay) {
38 DCHECK(!statistics_prefs_); 38 DCHECK(!statistics_prefs_);
39 statistics_prefs_.reset(new DataReductionProxyStatisticsPrefs( 39 statistics_prefs_.reset(new DataReductionProxyCompressionStats(
40 prefs, ui_task_runner, commit_delay)); 40 prefs, ui_task_runner, commit_delay));
41 } 41 }
42 42
43 base::WeakPtr<DataReductionProxyService> 43 base::WeakPtr<DataReductionProxyService>
44 DataReductionProxyService::GetWeakPtr() { 44 DataReductionProxyService::GetWeakPtr() {
45 DCHECK(CalledOnValidThread()); 45 DCHECK(CalledOnValidThread());
46 return weak_factory_.GetWeakPtr(); 46 return weak_factory_.GetWeakPtr();
47 } 47 }
48 48
49 void DataReductionProxyService::OnURLFetchComplete( 49 void DataReductionProxyService::OnURLFetchComplete(
(...skipping 30 matching lines...) Expand all
80 DCHECK(CalledOnValidThread()); 80 DCHECK(CalledOnValidThread());
81 net::URLFetcher* fetcher = GetURLFetcherForProbe(probe_url); 81 net::URLFetcher* fetcher = GetURLFetcherForProbe(probe_url);
82 if (!fetcher) 82 if (!fetcher)
83 return; 83 return;
84 fetcher_.reset(fetcher); 84 fetcher_.reset(fetcher);
85 fetcher_callback_ = fetcher_callback; 85 fetcher_callback_ = fetcher_callback;
86 fetcher_->Start(); 86 fetcher_->Start();
87 } 87 }
88 88
89 } // namespace data_reduction_proxy 89 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698