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

Unified Diff: sync/engine/all_status.cc

Issue 10991005: Added nudge source counters to about:sync. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed indentation Created 8 years, 3 months 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
« no previous file with comments | « sync/engine/all_status.h ('k') | sync/internal_api/public/engine/sync_status.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/all_status.cc
diff --git a/sync/engine/all_status.cc b/sync/engine/all_status.cc
index 656d6e0b861b2b922f1eef66f514762afe1af69c..82457e466ee3fd07b0a96b4b307d4faf5412246d 100644
--- a/sync/engine/all_status.cc
+++ b/sync/engine/all_status.cc
@@ -174,6 +174,29 @@ void AllStatus::SetUniqueId(const std::string& guid) {
status_.unique_id = guid;
}
+void AllStatus::IncrementNudgeCounter(NudgeSource source) {
+ ScopedStatusLock lock(this);
+ switch(source) {
+ case NUDGE_SOURCE_LOCAL_REFRESH:
+ status_.nudge_source_local_refresh++;
+ return;
+ case NUDGE_SOURCE_LOCAL:
+ status_.nudge_source_local++;
+ return;
+ case NUDGE_SOURCE_NOTIFICATION:
+ status_.nudge_source_notification++;
+ return;
+ case NUDGE_SOURCE_CONTINUATION:
+ status_.nudge_source_continuation++;
+ return;
+ case NUDGE_SOURCE_UNKNOWN:
+ break;
+ }
+ // If we're here, the source is most likely
+ // NUDGE_SOURCE_UNKNOWN. That shouldn't happen.
+ NOTREACHED();
+}
+
ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus)
: allstatus_(allstatus) {
allstatus->mutex_.Acquire();
« no previous file with comments | « sync/engine/all_status.h ('k') | sync/internal_api/public/engine/sync_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698