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

Unified Diff: components/data_usage/core/data_use_aggregator.h

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 side-by-side diff with in-line comments
Download patch
Index: components/data_usage/core/data_use_aggregator.h
diff --git a/components/data_usage/core/data_use_aggregator.h b/components/data_usage/core/data_use_aggregator.h
index 4c14ec1c3d3b38273096d94fc940b563d2ef1834..ad9a41d5b557d5dcf3389c967398ff20ebb79456 100644
--- a/components/data_usage/core/data_use_aggregator.h
+++ b/components/data_usage/core/data_use_aggregator.h
@@ -50,12 +50,18 @@ class DataUseAggregator {
// Virtual for testing.
virtual void ReportOffTheRecordDataUse(int64_t tx_bytes, int64_t rx_bytes);
+ // Passes the ownership of an external observer to DataUseAggregator.
+ void PassExternalObserver(scoped_ptr<Observer> external_observer);
+
private:
void NotifyDataUse(const std::vector<DataUse>& data_use_sequence);
base::ThreadChecker thread_checker_;
base::ObserverList<Observer> observer_list_;
+ // An observer which is external to Chromium.
+ scoped_ptr<Observer> external_observer_;
sclittle 2015/10/09 22:59:28 Making the DataUseAggregator own one of its observ
tbansal1 2015/10/12 16:47:36 changed the owner to IO thread globals.
+
DISALLOW_COPY_AND_ASSIGN(DataUseAggregator);
};

Powered by Google App Engine
This is Rietveld 408576698