Chromium Code Reviews| 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..14b06d74a5f9f1dcab413853ed9dbd2b4d7539dd 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,7 +32,6 @@ namespace chrome { |
| namespace android { |
| -class DataUseTabModel; |
| class ExternalDataUseObserverBridge; |
| // This class receives data use observations from ExternalDataUseObserver, |
| @@ -61,8 +62,19 @@ class ExternalDataUseReporter { |
| // paramenters from. |
| ExternalDataUseReporter( |
| const char* field_trial, |
| - DataUseTabModel* data_use_tab_model, |
| - ExternalDataUseObserverBridge* external_data_use_observer_bridge); |
| + const base::Callback<bool(SessionID::id_type, |
| + const base::TimeTicks&, |
| + DataUseTabModel::TrackingInfo*)>& |
| + get_tracking_info_callback, |
| + const base::Callback<void(const std::string&, |
| + const std::string&, |
| + net::NetworkChangeNotifier::ConnectionType, |
| + const std::string&, |
| + const base::Time&, |
| + const base::Time&, |
|
tbansal1
2016/07/21 00:19:30
Pass by value.
Raj
2016/07/21 04:09:16
Done.
|
| + int64_t, |
| + int64_t)>& report_data_use_callback); |
| + |
| virtual ~ExternalDataUseReporter(); |
| void InitOnUIThread(); |
| @@ -189,12 +201,22 @@ 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_; |
| - |
| - // Pointer to the DataUseTabModel in UI thread, Not owned by |this|. |
| - DataUseTabModel* data_use_tab_model_; |
| + // Callback to be run to get the tracking info for a tab at a particular time. |
| + const base::Callback<bool(SessionID::id_type, |
|
tbansal1
2016/07/21 00:19:30
Can this be typedef'ed so there is no need to type
Raj
2016/07/21 04:09:17
Done.
|
| + const base::TimeTicks&, |
| + DataUseTabModel::TrackingInfo*)> |
| + get_tracking_info_callback_; |
| + |
| + // Callback to be run to report the data usage to the underlying platform. |
| + const base::Callback<void(const std::string&, |
|
tbansal1
2016/07/21 00:19:30
Same here, typedefing may make it more readable.
Raj
2016/07/21 04:09:16
Done.
|
| + const std::string&, |
| + net::NetworkChangeNotifier::ConnectionType, |
| + const std::string&, |
| + const base::Time&, |
| + const base::Time&, |
| + int64_t, |
| + int64_t)> |
| + report_data_use_callback_; |
| #if defined(OS_ANDROID) |
| // Listens to when Chromium gets backgrounded and submits buffered data use |