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

Unified Diff: chrome/browser/android/data_usage/external_data_use_observer.h

Issue 2169773002: Batch data use objects in ExternalDataUseObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/android/data_usage/external_data_use_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/data_usage/external_data_use_observer.h
diff --git a/chrome/browser/android/data_usage/external_data_use_observer.h b/chrome/browser/android/data_usage/external_data_use_observer.h
index 7ec350fe4e9e8364e556dd745c6dc1deebb30235..97d8f95554d1d9b18fb01ef57fc4406a0841605e 100644
--- a/chrome/browser/android/data_usage/external_data_use_observer.h
+++ b/chrome/browser/android/data_usage/external_data_use_observer.h
@@ -5,6 +5,9 @@
#ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_
#define CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_
+#include <deque>
+#include <memory>
+
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -91,6 +94,9 @@ class ExternalDataUseObserver : public data_usage::DataUseAggregator::Observer {
// data_usage::DataUseAggregator::Observer implementation:
void OnDataUse(const data_usage::DataUse& data_use) override;
+ // Called when a batch of data use objects are added to |data_use_list_|.
+ void OnDataUseBatchComplete();
+
// Aggregator that sends data use observations to |this|.
data_usage::DataUseAggregator* data_use_aggregator_;
@@ -107,6 +113,14 @@ class ExternalDataUseObserver : public data_usage::DataUseAggregator::Observer {
// created on IO thread but afterwards, should only be accessed on UI thread.
ExternalDataUseReporter* external_data_use_reporter_;
+ // Batches the data use objects reported by DataUseAggregator. This will be
+ // created when data use batching starts and released when the batching ends.
+ // This will be null if there is no ongoing batching of data use objects.
+ std::unique_ptr<std::deque<const data_usage::DataUse>> data_use_list_;
+
+ // |io_task_runner_| is used to call methods on IO thread.
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
+
// |ui_task_runner_| is used to call methods on UI thread.
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
« no previous file with comments | « no previous file | chrome/browser/android/data_usage/external_data_use_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698