Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3295)

Unified Diff: chrome/browser/android/data_usage/external_data_use_observer.h

Issue 1491793002: Add histograms for ExternalDataUseObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698