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 30f6e6aed57e83ac9cfa3f561f6430167a99bc8c..3c3a2a69bb364ca33ec8ca9dffbb3486b86aa09a 100644 |
--- a/chrome/browser/android/data_usage/external_data_use_observer.h |
+++ b/chrome/browser/android/data_usage/external_data_use_observer.h |
@@ -103,6 +103,7 @@ class ExternalDataUseObserver : public data_usage::DataUseAggregator::Observer { |
private: |
friend class DataUseTabModelTest; |
friend class ExternalDataUseObserverTest; |
+ FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, DataUseReportTimedOut); |
FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, SingleRegex); |
FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, TwoRegex); |
FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, MultipleRegex); |
@@ -278,8 +279,15 @@ class ExternalDataUseObserver : public data_usage::DataUseAggregator::Observer { |
// True if callback from |FetchMatchingRulesDone| is currently pending. |
bool matching_rules_fetch_pending_; |
- // True if callback from |SubmitDataUseReportCallback| is currently pending. |
- bool submit_data_report_pending_; |
+ // Time when the currently pending data use report was submitted. |
+ // |last_data_report_submitted_| is null if no data use report is currently |
sclittle
2015/12/02 19:07:54
The NULL timeticks is a valid, real time; it shoul
tbansal1
2015/12/03 03:19:45
That applies only when doing Maths with TimeTicks.
|
+ // pending. |
+ base::TimeTicks last_data_report_submitted_; |
sclittle
2015/12/02 19:07:54
nit: Name this so that it's obvious it's a point i
tbansal1
2015/12/03 03:19:45
Done.
|
+ |
+ // |pending_report_bytes_| is the total byte count in the data use report that |
+ // is currently pending. |pending_report_bytes_| is 0 if no data use report is |
sclittle
2015/12/02 19:07:54
FYI: Be careful here - the DataUseAggregator could
tbansal1
2015/12/03 03:19:45
Added an early return statement to filter out repo
|
+ // currently pending. |
+ int64_t pending_report_bytes_; |
// Contains matching rules. |
std::vector<scoped_ptr<MatchingRule>> matching_rules_; |
@@ -316,6 +324,10 @@ class ExternalDataUseObserver : public data_usage::DataUseAggregator::Observer { |
// submitted. |
const int64_t data_use_report_min_bytes_; |
+ // If a data use report is pending for more than |data_report_submit_timeout_| |
+ // duration, it is considered as timed out. |
+ const base::TimeDelta data_report_submit_timeout_; |
+ |
base::ThreadChecker thread_checker_; |
// |io_weak_factory_| and |ui_weak_factory_| are used for posting tasks on the |