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

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 7558015: [Sync] Set session sync commit delay to 10s (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.cc
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index d6b4c586afafc0c4dedf58127f53df2c1f7cfef6..e75a6b088a631369533e6b5eadd1d901199c73c3 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -1223,6 +1223,9 @@ class SyncManager::SyncInternal
public syncable::DirectoryChangeDelegate {
static const int kDefaultNudgeDelayMilliseconds;
static const int kPreferencesNudgeDelayMilliseconds;
+ // TODO(akalin): Remove this once we have the delay controllable
+ // from the server.
+ static const int kSessionsNudgeDelayMilliseconds;
public:
explicit SyncInternal(const std::string& name)
: weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
@@ -1635,6 +1638,7 @@ class SyncManager::SyncInternal
};
const int SyncManager::SyncInternal::kDefaultNudgeDelayMilliseconds = 200;
const int SyncManager::SyncInternal::kPreferencesNudgeDelayMilliseconds = 2000;
+const int SyncManager::SyncInternal::kSessionsNudgeDelayMilliseconds = 10000;
SyncManager::Observer::~Observer() {}
@@ -2461,8 +2465,15 @@ void SyncManager::SyncInternal::HandleCalculateChangesChangeEventFromSyncApi(
// Nudge if necessary.
if (mutated_model_type != syncable::UNSPECIFIED) {
- int nudge_delay = (mutated_model_type == syncable::PREFERENCES) ?
- kPreferencesNudgeDelayMilliseconds : kDefaultNudgeDelayMilliseconds;
+ int nudge_delay;
+ switch (mutated_model_type) {
+ case syncable::PREFERENCES:
+ nudge_delay = kPreferencesNudgeDelayMilliseconds;
+ case syncable::SESSIONS:
+ nudge_delay = kSessionsNudgeDelayMilliseconds;
+ default:
+ nudge_delay = kDefaultNudgeDelayMilliseconds;
+ }
syncable::ModelTypeBitSet model_types;
model_types.set(mutated_model_type);
if (weak_handle_this_.IsInitialized()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698