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

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

Issue 956223002: Rename DataReductionProxyUsageStats to DataReductionProxyBypassStats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 8 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_io_d ata.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/prefs/pref_member.h" 9 #include "base/prefs/pref_member.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypa ss_protocol.h" 11 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypa ss_protocol.h"
12 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypa ss_stats.h"
12 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig.h" 13 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig.h"
13 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_service_client.h" 14 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_service_client.h"
14 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h" 15 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h"
15 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_dele gate.h" 16 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_dele gate.h"
16 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_inte rceptor.h" 17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_inte rceptor.h"
17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_muta ble_config_values.h" 18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_muta ble_config_values.h"
18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h" 19 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h"
19 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h" 20 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h"
20 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 21 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
21 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h" 22 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h"
22 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usag e_stats.h"
23 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h" 23 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h"
24 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" 24 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
25 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h" 25 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h"
26 #include "net/base/net_log.h" 26 #include "net/base/net_log.h"
27 27
28 namespace data_reduction_proxy { 28 namespace data_reduction_proxy {
29 29
30 DataReductionProxyIOData::DataReductionProxyIOData( 30 DataReductionProxyIOData::DataReductionProxyIOData(
31 const Client& client, 31 const Client& client,
32 int param_flags, 32 int param_flags,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 DCHECK(io_task_runner_->BelongsToCurrentThread()); 108 DCHECK(io_task_runner_->BelongsToCurrentThread());
109 return enabled_.GetValue() || 109 return enabled_.GetValue() ||
110 base::CommandLine::ForCurrentProcess()->HasSwitch( 110 base::CommandLine::ForCurrentProcess()->HasSwitch(
111 switches::kEnableDataReductionProxy); 111 switches::kEnableDataReductionProxy);
112 } 112 }
113 113
114 scoped_ptr<net::URLRequestInterceptor> 114 scoped_ptr<net::URLRequestInterceptor>
115 DataReductionProxyIOData::CreateInterceptor() { 115 DataReductionProxyIOData::CreateInterceptor() {
116 DCHECK(io_task_runner_->BelongsToCurrentThread()); 116 DCHECK(io_task_runner_->BelongsToCurrentThread());
117 return make_scoped_ptr(new DataReductionProxyInterceptor( 117 return make_scoped_ptr(new DataReductionProxyInterceptor(
118 config_.get(), usage_stats_.get(), event_store_.get())); 118 config_.get(), bypass_stats_.get(), event_store_.get()));
119 } 119 }
120 120
121 scoped_ptr<DataReductionProxyNetworkDelegate> 121 scoped_ptr<DataReductionProxyNetworkDelegate>
122 DataReductionProxyIOData::CreateNetworkDelegate( 122 DataReductionProxyIOData::CreateNetworkDelegate(
123 scoped_ptr<net::NetworkDelegate> wrapped_network_delegate, 123 scoped_ptr<net::NetworkDelegate> wrapped_network_delegate,
124 bool track_proxy_bypass_statistics) { 124 bool track_proxy_bypass_statistics) {
125 DCHECK(io_task_runner_->BelongsToCurrentThread()); 125 DCHECK(io_task_runner_->BelongsToCurrentThread());
126 scoped_ptr<DataReductionProxyNetworkDelegate> network_delegate( 126 scoped_ptr<DataReductionProxyNetworkDelegate> network_delegate(
127 new DataReductionProxyNetworkDelegate( 127 new DataReductionProxyNetworkDelegate(
128 wrapped_network_delegate.Pass(), config_.get(), 128 wrapped_network_delegate.Pass(), config_.get(),
129 request_options_.get(), configurator_.get())); 129 request_options_.get(), configurator_.get()));
130 if (track_proxy_bypass_statistics && !usage_stats_) { 130 if (track_proxy_bypass_statistics && !bypass_stats_) {
131 usage_stats_.reset(new DataReductionProxyUsageStats( 131 bypass_stats_.reset(new DataReductionProxyBypassStats(
132 config_.get(), base::Bind(&DataReductionProxyIOData::SetUnreachable, 132 config_.get(), base::Bind(&DataReductionProxyIOData::SetUnreachable,
133 base::Unretained(this)), ui_task_runner_)); 133 base::Unretained(this)), ui_task_runner_));
134 network_delegate->InitIODataAndUMA(ui_task_runner_, this, &enabled_, 134 network_delegate->InitIODataAndUMA(ui_task_runner_, this, &enabled_,
135 usage_stats_.get()); 135 bypass_stats_.get());
136 } 136 }
137 return network_delegate.Pass(); 137 return network_delegate.Pass();
138 } 138 }
139 139
140 void DataReductionProxyIOData::SetUnreachable(bool unreachable) { 140 void DataReductionProxyIOData::SetUnreachable(bool unreachable) {
141 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 141 DCHECK(ui_task_runner_->BelongsToCurrentThread());
142 if (service_) 142 if (service_)
143 service_->settings()->SetUnreachable(unreachable); 143 service_->settings()->SetUnreachable(unreachable);
144 } 144 }
145 145
146 } // namespace data_reduction_proxy 146 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698