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 "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 int64_t DataReductionProxySettings::GetDataReductionLastUpdateTime() { | 147 int64_t DataReductionProxySettings::GetDataReductionLastUpdateTime() { |
148 DCHECK(thread_checker_.CalledOnValidThread()); | 148 DCHECK(thread_checker_.CalledOnValidThread()); |
149 DCHECK(data_reduction_proxy_service_->compression_stats()); | 149 DCHECK(data_reduction_proxy_service_->compression_stats()); |
150 return | 150 return |
151 data_reduction_proxy_service_->compression_stats()->GetLastUpdateTime(); | 151 data_reduction_proxy_service_->compression_stats()->GetLastUpdateTime(); |
152 } | 152 } |
153 | 153 |
154 int64_t DataReductionProxySettings::GetHttpReceivedContentLength() { | |
155 DCHECK(thread_checker_.CalledOnValidThread()); | |
156 DCHECK(data_reduction_proxy_service_->compression_stats()); | |
tbansal1
2016/10/25 18:10:04
This DCHECK is unnecessary since if data_reduction
megjablon
2016/10/25 22:14:19
Done.
| |
157 return data_reduction_proxy_service_->compression_stats() | |
158 ->GetHttpReceivedContentLength(); | |
159 } | |
160 | |
161 int64_t DataReductionProxySettings::GetHttpOriginalContentLength() { | |
162 DCHECK(thread_checker_.CalledOnValidThread()); | |
163 DCHECK(data_reduction_proxy_service_->compression_stats()); | |
164 return data_reduction_proxy_service_->compression_stats() | |
165 ->GetHttpOriginalContentLength(); | |
166 } | |
167 | |
154 void DataReductionProxySettings::SetUnreachable(bool unreachable) { | 168 void DataReductionProxySettings::SetUnreachable(bool unreachable) { |
155 unreachable_ = unreachable; | 169 unreachable_ = unreachable; |
156 } | 170 } |
157 | 171 |
158 bool DataReductionProxySettings::IsDataReductionProxyUnreachable() { | 172 bool DataReductionProxySettings::IsDataReductionProxyUnreachable() { |
159 DCHECK(thread_checker_.CalledOnValidThread()); | 173 DCHECK(thread_checker_.CalledOnValidThread()); |
160 return unreachable_; | 174 return unreachable_; |
161 } | 175 } |
162 | 176 |
163 PrefService* DataReductionProxySettings::GetOriginalProfilePrefs() { | 177 PrefService* DataReductionProxySettings::GetOriginalProfilePrefs() { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 int64_t data_used, | 384 int64_t data_used, |
371 int64_t original_size) { | 385 int64_t original_size) { |
372 if (!IsDataReductionProxyEnabled()) | 386 if (!IsDataReductionProxyEnabled()) |
373 return false; | 387 return false; |
374 data_reduction_proxy_service_->compression_stats()->UpdateDataSavings( | 388 data_reduction_proxy_service_->compression_stats()->UpdateDataSavings( |
375 data_usage_host, data_used, original_size); | 389 data_usage_host, data_used, original_size); |
376 return true; | 390 return true; |
377 } | 391 } |
378 | 392 |
379 } // namespace data_reduction_proxy | 393 } // namespace data_reduction_proxy |
OLD | NEW |