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 3343b8fdb9849ba46492e99df934ff9be6491a49..b2b37e99b6b291aec5478adb9202b338b3f0e4b0 100644 |
| --- a/components/data_use_measurement/content/data_use_measurement.h |
| +++ b/components/data_use_measurement/content/data_use_measurement.h |
| @@ -12,6 +12,7 @@ |
| #include "base/callback.h" |
| #include "base/macros.h" |
| +#include "base/time/time.h" |
| #include "build/build_config.h" |
| #include "components/data_use_measurement/core/data_use_user_data.h" |
| #include "components/metrics/data_use_tracker.h" |
| @@ -67,6 +68,8 @@ class DataUseMeasurement { |
| private: |
| friend class DataUseMeasurementTest; |
| + FRIEND_TEST_ALL_PREFIXES(DataUseMeasurementTest, |
| + TimeOfBackgroundDownstreamBytes); |
| // Specifies that data is received or sent, respectively. |
| enum TrafficDirection { DOWNSTREAM, UPSTREAM }; |
| @@ -103,8 +106,8 @@ class DataUseMeasurement { |
| // |dir| is the direction (which is upstream or downstream) and |bytes| is the |
| // number of bytes in the direction. |
| void ReportDataUseUMA(const net::URLRequest& request, |
| - TrafficDirection dir, |
| - int64_t bytes) const; |
| + TrafficDirection dir, |
| + int64_t bytes); |
| // Updates the data use of the |request|, thus |request| must be non-null. |
| void UpdateDataUsePrefs(const net::URLRequest& request) const; |
| @@ -147,6 +150,13 @@ class DataUseMeasurement { |
| // delegate since the operating system was last queried for traffic |
| // statistics. |
| int64_t bytes_transferred_since_last_traffic_stats_query_; |
| + |
| + // The time at which Chromium app state changed to background. Can be null if |
| + // app is not in background. |
| + base::TimeTicks last_app_background_time_; |
| + |
| + // True if app is in background and first network read has not yet happened. |
| + bool first_read_after_background_; |
|
Not at Google. Contact bengr
2016/10/14 23:10:57
The comment and the variable name imply different
Raj
2016/10/15 19:36:14
Done.
|
| #endif |
| DISALLOW_COPY_AND_ASSIGN(DataUseMeasurement); |