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

Unified Diff: sync/internal_api/sync_manager_impl.cc

Issue 10991005: Added nudge source counters to about:sync. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
« sync/engine/all_status.cc ('K') | « sync/internal_api/sync_manager_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_manager_impl.cc
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 20852f40ab391aa665dcae3a601239c71b314c88..cf28608c356d4d70f7b6f4fc3c34250c642681a8 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -979,10 +979,10 @@ void SyncManagerImpl::RequestNudgeForDataTypes(
base::TimeDelta nudge_delay = NudgeStrategy::GetNudgeDelayTimeDelta(
types.First().Get(),
this);
- scheduler_->ScheduleNudgeAsync(nudge_delay,
- NUDGE_SOURCE_LOCAL,
- types,
- nudge_location);
+ ScheduleNudgeAsync(nudge_delay,
+ NUDGE_SOURCE_LOCAL,
+ types,
+ nudge_location);
}
void SyncManagerImpl::OnSyncEngineEvent(const SyncEngineEvent& event) {
@@ -1273,12 +1273,12 @@ void SyncManagerImpl::OnIncomingInvalidation(
const ModelTypeStateMap& type_state_map =
ObjectIdStateMapToModelTypeStateMap(id_state_map);
if (source == LOCAL_INVALIDATION) {
- scheduler_->ScheduleNudgeWithStatesAsync(
+ ScheduleNudgeWithStatesAsync(
TimeDelta::FromMilliseconds(kSyncRefreshDelayMsec),
NUDGE_SOURCE_LOCAL_REFRESH,
type_state_map, FROM_HERE);
} else if (!type_state_map.empty()) {
- scheduler_->ScheduleNudgeWithStatesAsync(
+ ScheduleNudgeWithStatesAsync(
TimeDelta::FromMilliseconds(kSyncSchedulerDelayMsec),
NUDGE_SOURCE_NOTIFICATION,
type_state_map, FROM_HERE);
@@ -1349,6 +1349,26 @@ SyncEncryptionHandler* SyncManagerImpl::GetEncryptionHandler() {
return sync_encryption_handler_.get();
}
+void SyncManagerImpl::ScheduleNudgeAsync(
+ const base::TimeDelta& delay,
rlarocque 2012/09/24 23:24:37 A TimeDelta isn't very big. It would be cheaper t
+ NudgeSource source,
+ ModelTypeSet types,
+ const tracked_objects::Location& nudge_location) {
+ allstatus_.IncrementNudgeCounter(source);
+ scheduler_->ScheduleNudgeAsync(delay, source,
rlarocque 2012/09/24 23:24:37 nit: This style of line wrapping for parameters is
+ types, nudge_location);
+}
+
+
+void SyncManagerImpl::ScheduleNudgeWithStatesAsync(
+ const base::TimeDelta& delay, NudgeSource source,
+ const ModelTypeStateMap& type_state_map,
+ const tracked_objects::Location& nudge_location) {
+ allstatus_.IncrementNudgeCounter(source);
+ scheduler_->ScheduleNudgeWithStatesAsync(delay, source,
+ type_state_map, nudge_location);
+}
+
// static.
int SyncManagerImpl::GetDefaultNudgeDelay() {
return kDefaultNudgeDelayMilliseconds;
« sync/engine/all_status.cc ('K') | « sync/internal_api/sync_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698