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

Side by Side Diff: components/data_usage/core/data_use_aggregator.cc

Issue 2440303002: Remove usage of FOR_EACH_OBSERVER macro in components/ (Closed)
Patch Set: remove superfluous return Created 4 years, 1 month 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_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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698