Chromium Code Reviews| Index: components/data_use_measurement/content/data_use_measurement.h |
| diff --git a/components/data_use_measurement/content/data_use_measurement.h b/components/data_use_measurement/content/data_use_measurement.h |
| index a5b8f7136359a70c26fe085c11fb0471549bb004..015df5c164b24010e45d1c8138c81ff32ab9344d 100644 |
| --- a/components/data_use_measurement/content/data_use_measurement.h |
| +++ b/components/data_use_measurement/content/data_use_measurement.h |
| @@ -9,10 +9,12 @@ |
| #include <string> |
| +#include "base/callback.h" |
| #include "base/macros.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "build/build_config.h" |
| #include "components/data_use_measurement/core/data_use_user_data.h" |
| +#include "components/metrics/data_use_tracker.h" |
| #if defined(OS_ANDROID) |
| #include "base/android/application_status_listener.h" |
| @@ -32,7 +34,8 @@ namespace data_use_measurement { |
| // http://crbug.com/527460 |
| class DataUseMeasurement { |
| public: |
| - DataUseMeasurement(); |
| + explicit DataUseMeasurement( |
| + const metrics::UpdateUsagePrefCallbackType& metrics_data_use_forwarder); |
| ~DataUseMeasurement(); |
| // Records the data use of the |request|, thus |request| must be non-null. |
| @@ -63,7 +66,9 @@ class DataUseMeasurement { |
| // ("Downstream") path, whether the app was in the "Foreground" or |
| // "Background", and whether a "Cellular" or "WiFi" network was use. For |
| // example, "Prefix.Upstream.Foreground.Cellular" is a possible output. |
| - std::string GetHistogramName(const char* prefix, TrafficDirection dir) const; |
| + std::string GetHistogramName(const char* prefix, |
| + TrafficDirection dir, |
| + bool is_conn_cellular) const; |
|
bengr
2016/04/06 20:57:11
nit: is_connection_cellular
gayane -on leave until 09-2017
2016/04/07 15:30:39
Done.
Alexei Svitkine (slow)
2016/04/07 15:43:29
Seems you still have some places that use the old
gayane -on leave until 09-2017
2016/04/07 18:53:49
Done.
|
| #if defined(OS_ANDROID) |
| // Called whenever the application transitions from foreground to background |
| @@ -79,8 +84,15 @@ class DataUseMeasurement { |
| void ReportDataUsageServices( |
| data_use_measurement::DataUseUserData::ServiceName service, |
| TrafficDirection dir, |
| + bool is_conn_cellular, |
| int64_t message_size) const; |
| + // Callback for updating data use prefs. |
| + // Note: If similar mechanism would need be used for components other than |
|
bengr
2016/04/06 20:57:11
If -> If a
gayane -on leave until 09-2017
2016/04/07 15:30:39
Done.
|
| + // metrics, then the better approach would be to refactor this class to |
| + // support registering arbitrary observers. |
|
bengr
2016/04/06 20:57:11
Add a TODO(rajendrant), and reference crbug.com/60
gayane -on leave until 09-2017
2016/04/07 15:30:39
Done.
Alexei Svitkine (slow)
2016/04/07 15:43:29
I don't see this being done?
gayane -on leave until 09-2017
2016/04/07 18:53:49
Done.
|
| + metrics::UpdateUsagePrefCallbackType metrics_data_use_forwarder_; |
| + |
| #if defined(OS_ANDROID) |
| // Application listener store the last known state of the application in this |
| // field. |