| Index: chrome/browser/android/data_usage/external_data_use_reporter.h
|
| diff --git a/chrome/browser/android/data_usage/external_data_use_reporter.h b/chrome/browser/android/data_usage/external_data_use_reporter.h
|
| index 5999050c89dbc2dbb246fc72fa357eaecd98399c..87e0ff5f8c7f154ada495631f0e7567d227b18cb 100644
|
| --- a/chrome/browser/android/data_usage/external_data_use_reporter.h
|
| +++ b/chrome/browser/android/data_usage/external_data_use_reporter.h
|
| @@ -11,11 +11,13 @@
|
| #include <memory>
|
| #include <string>
|
|
|
| +#include "base/callback.h"
|
| #include "base/containers/hash_tables.h"
|
| #include "base/gtest_prod_util.h"
|
| #include "base/macros.h"
|
| #include "base/threading/thread_checker.h"
|
| #include "base/time/time.h"
|
| +#include "chrome/browser/android/data_usage/data_use_tab_model.h"
|
| #include "net/base/network_change_notifier.h"
|
|
|
| #if defined(OS_ANDROID)
|
| @@ -30,9 +32,6 @@ namespace chrome {
|
|
|
| namespace android {
|
|
|
| -class DataUseTabModel;
|
| -class ExternalDataUseObserverBridge;
|
| -
|
| // This class receives data use observations from ExternalDataUseObserver,
|
| // labels the data use using DataUseTabModel, and buffers the data use report.
|
| // The buffered reports are submitted to the platform when a minimum number of
|
| @@ -41,6 +40,21 @@ class ExternalDataUseObserverBridge;
|
| // must only be accessed on UI thread.
|
| class ExternalDataUseReporter {
|
| public:
|
| + typedef base::Callback<bool(SessionID::id_type,
|
| + const base::TimeTicks,
|
| + DataUseTabModel::TrackingInfo*)>
|
| + GetTrackingInfoCallback;
|
| +
|
| + typedef base::Callback<void(const std::string&,
|
| + const std::string&,
|
| + net::NetworkChangeNotifier::ConnectionType,
|
| + const std::string&,
|
| + const base::Time,
|
| + const base::Time,
|
| + int64_t,
|
| + int64_t)>
|
| + ReportDataUseCallback;
|
| +
|
| // Result of data usage report submission. This enum must remain synchronized
|
| // with the enum of the same name in metrics/histograms/histograms.xml.
|
| enum DataUsageReportSubmissionResult {
|
| @@ -61,8 +75,9 @@ class ExternalDataUseReporter {
|
| // paramenters from.
|
| ExternalDataUseReporter(
|
| const char* field_trial,
|
| - DataUseTabModel* data_use_tab_model,
|
| - ExternalDataUseObserverBridge* external_data_use_observer_bridge);
|
| + const GetTrackingInfoCallback& get_tracking_info_callback,
|
| + const ReportDataUseCallback& report_data_use_callback);
|
| +
|
| virtual ~ExternalDataUseReporter();
|
|
|
| void InitOnUIThread();
|
| @@ -189,12 +204,11 @@ class ExternalDataUseReporter {
|
| void OnApplicationStateChange(base::android::ApplicationState new_state);
|
| #endif
|
|
|
| - // Pointer to the ExternalDataUseObserverBridge in UI thread. Not owned by
|
| - // |this|.
|
| - ExternalDataUseObserverBridge* external_data_use_observer_bridge_;
|
| + // Callback to be run to get the tracking info for a tab at a particular time.
|
| + const GetTrackingInfoCallback get_tracking_info_callback_;
|
|
|
| - // Pointer to the DataUseTabModel in UI thread, Not owned by |this|.
|
| - DataUseTabModel* data_use_tab_model_;
|
| + // Callback to be run to report the data usage to the underlying platform.
|
| + const ReportDataUseCallback report_data_use_callback_;
|
|
|
| #if defined(OS_ANDROID)
|
| // Listens to when Chromium gets backgrounded and submits buffered data use
|
|
|