OLD | NEW |
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_expe
riments_stats.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_expe
riments_stats.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_retrieval_params.h" | 8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_retrieval_params.h" |
9 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" | 9 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 UpdateSimulatedConfig(); | 39 UpdateSimulatedConfig(); |
40 config_refresh_time_.Start( | 40 config_refresh_time_.Start( |
41 FROM_HERE, config_retrieval_params_->refresh_interval(), this, | 41 FROM_HERE, config_retrieval_params_->refresh_interval(), this, |
42 &DataReductionProxyExperimentsStats::UpdateSimulatedConfig); | 42 &DataReductionProxyExperimentsStats::UpdateSimulatedConfig); |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 void DataReductionProxyExperimentsStats::RecordBytes( | 46 void DataReductionProxyExperimentsStats::RecordBytes( |
47 const base::Time& request_time, | 47 const base::Time& request_time, |
48 DataReductionProxyRequestType request_type, | 48 DataReductionProxyRequestType request_type, |
49 int64 received_content_length, | 49 int64_t received_content_length, |
50 int64 original_content_length) { | 50 int64_t original_content_length) { |
51 DCHECK(thread_checker_.CalledOnValidThread()); | 51 DCHECK(thread_checker_.CalledOnValidThread()); |
52 if (config_retrieval_params_) { | 52 if (config_retrieval_params_) { |
53 // Only measure requests which flowed through the Data Reduction Proxy. | 53 // Only measure requests which flowed through the Data Reduction Proxy. |
54 if (request_type == VIA_DATA_REDUCTION_PROXY) { | 54 if (request_type == VIA_DATA_REDUCTION_PROXY) { |
55 config_retrieval_params_->RecordStats( | 55 config_retrieval_params_->RecordStats( |
56 request_time, received_content_length, original_content_length); | 56 request_time, received_content_length, original_content_length); |
57 } | 57 } |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 void DataReductionProxyExperimentsStats::UpdateSimulatedConfig() { | 61 void DataReductionProxyExperimentsStats::UpdateSimulatedConfig() { |
62 DCHECK(config_retrieval_params_); | 62 DCHECK(config_retrieval_params_); |
63 value_setter_.Run(prefs::kSimulatedConfigRetrieveTime, | 63 value_setter_.Run(prefs::kSimulatedConfigRetrieveTime, |
64 base::Time::Now().ToInternalValue()); | 64 base::Time::Now().ToInternalValue()); |
65 } | 65 } |
66 | 66 |
67 } // namespace data_reduction_proxy | 67 } // namespace data_reduction_proxy |
OLD | NEW |