| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/android/data_usage/external_data_use_reporter.h" | 5 #include "chrome/browser/android/data_usage/external_data_use_reporter.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram_base.h" | 10 #include "base/metrics/histogram_base.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 base::Bind(&ExternalDataUseReporter::OnApplicationStateChange, | 124 base::Bind(&ExternalDataUseReporter::OnApplicationStateChange, |
| 125 base::Unretained(this)))); | 125 base::Unretained(this)))); |
| 126 #endif | 126 #endif |
| 127 } | 127 } |
| 128 | 128 |
| 129 ExternalDataUseReporter::~ExternalDataUseReporter() { | 129 ExternalDataUseReporter::~ExternalDataUseReporter() { |
| 130 DCHECK(thread_checker_.CalledOnValidThread()); | 130 DCHECK(thread_checker_.CalledOnValidThread()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void ExternalDataUseReporter::OnDataUse( | 133 void ExternalDataUseReporter::OnDataUse( |
| 134 std::unique_ptr<const std::deque<const data_usage::DataUse>> | 134 std::unique_ptr<const std::vector<const data_usage::DataUse>> |
| 135 data_use_list) { | 135 data_use_list) { |
| 136 DCHECK(thread_checker_.CalledOnValidThread()); | 136 DCHECK(thread_checker_.CalledOnValidThread()); |
| 137 DCHECK(data_use_list); | 137 DCHECK(data_use_list); |
| 138 | 138 |
| 139 const base::Time now_time = base::Time::Now(); | 139 const base::Time now_time = base::Time::Now(); |
| 140 DataUseTabModel::TrackingInfo tracking_info; | 140 DataUseTabModel::TrackingInfo tracking_info; |
| 141 | 141 |
| 142 for (const auto& data_use : *data_use_list) { | 142 for (const auto& data_use : *data_use_list) { |
| 143 if (!get_tracking_info_callback_.Run( | 143 if (!get_tracking_info_callback_.Run( |
| 144 data_use.tab_id, data_use.request_start, &tracking_info)) { | 144 data_use.tab_id, data_use.request_start, &tracking_info)) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 hash = hash * 23 + hash_function(k.label); | 326 hash = hash * 23 + hash_function(k.label); |
| 327 hash = hash * 31 + hash_function(k.tag); | 327 hash = hash * 31 + hash_function(k.tag); |
| 328 hash = hash * 43 + k.connection_type; | 328 hash = hash * 43 + k.connection_type; |
| 329 hash = hash * 83 + hash_function(k.mcc_mnc); | 329 hash = hash * 83 + hash_function(k.mcc_mnc); |
| 330 return hash; | 330 return hash; |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace android | 333 } // namespace android |
| 334 | 334 |
| 335 } // namespace chrome | 335 } // namespace chrome |
| OLD | NEW |