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

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

Issue 1393073002: Add external data use observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@datause_accounting_scliitle_cl_do_not_edit_2
Patch Set: Updated Created 5 years, 2 months 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 "net/base/network_change_notifier.h" 7 #include "net/base/network_change_notifier.h"
8 #include "net/url_request/url_request.h" 8 #include "net/url_request/url_request.h"
9 9
10 namespace data_usage { 10 namespace data_usage {
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 void DataUseAggregator::ReportOffTheRecordDataUse(int64_t tx_bytes, 43 void DataUseAggregator::ReportOffTheRecordDataUse(int64_t tx_bytes,
44 int64_t rx_bytes) { 44 int64_t rx_bytes) {
45 DCHECK(thread_checker_.CalledOnValidThread()); 45 DCHECK(thread_checker_.CalledOnValidThread());
46 // TODO(sclittle): Once data usage amortization is implemented, keep track of 46 // TODO(sclittle): Once data usage amortization is implemented, keep track of
47 // the off-the-record bytes so that they can be taken out of the amortized 47 // the off-the-record bytes so that they can be taken out of the amortized
48 // data usage calculations if applicable. 48 // data usage calculations if applicable.
49 } 49 }
50 50
51 void DataUseAggregator::PassExternalObserver(
52 scoped_ptr<Observer> external_observer) {
53 external_observer_ = external_observer.Pass();
54 }
55
51 void DataUseAggregator::NotifyDataUse( 56 void DataUseAggregator::NotifyDataUse(
52 const std::vector<DataUse>& data_use_sequence) { 57 const std::vector<DataUse>& data_use_sequence) {
53 DCHECK(thread_checker_.CalledOnValidThread()); 58 DCHECK(thread_checker_.CalledOnValidThread());
54 FOR_EACH_OBSERVER(Observer, observer_list_, OnDataUse(data_use_sequence)); 59 FOR_EACH_OBSERVER(Observer, observer_list_, OnDataUse(data_use_sequence));
55 } 60 }
56 61
57 } // namespace data_usage 62 } // namespace data_usage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698