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_usage/core/data_use_aggregator.h" | 5 #include "components/data_usage/core/data_use_aggregator.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if (amortization_callback_.is_null()) { | 121 if (amortization_callback_.is_null()) { |
122 amortization_callback_ = | 122 amortization_callback_ = |
123 base::Bind(&DataUseAggregator::OnAmortizationComplete, GetWeakPtr()); | 123 base::Bind(&DataUseAggregator::OnAmortizationComplete, GetWeakPtr()); |
124 } | 124 } |
125 amortizer_->AmortizeDataUse(std::move(data_use), amortization_callback_); | 125 amortizer_->AmortizeDataUse(std::move(data_use), amortization_callback_); |
126 } | 126 } |
127 | 127 |
128 void DataUseAggregator::OnAmortizationComplete( | 128 void DataUseAggregator::OnAmortizationComplete( |
129 std::unique_ptr<DataUse> amortized_data_use) { | 129 std::unique_ptr<DataUse> amortized_data_use) { |
130 DCHECK(thread_checker_.CalledOnValidThread()); | 130 DCHECK(thread_checker_.CalledOnValidThread()); |
131 FOR_EACH_OBSERVER(Observer, observer_list_, OnDataUse(*amortized_data_use)); | 131 for (Observer& observer : observer_list_) |
| 132 observer.OnDataUse(*amortized_data_use); |
132 } | 133 } |
133 | 134 |
134 } // namespace data_usage | 135 } // namespace data_usage |
OLD | NEW |