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

Unified Diff: chrome/browser/sync/internal_api/sync_manager.h

Issue 8787006: Delay autofill commits to reduce client to server traffic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 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/sync/internal_api/sync_manager.h
diff --git a/chrome/browser/sync/internal_api/sync_manager.h b/chrome/browser/sync/internal_api/sync_manager.h
index eaf5ccb1fe89b0b6f9c2e5a5f8125512dffe2368..5a9b2efb7849108fd501c8e01814852703c31c38 100644
--- a/chrome/browser/sync/internal_api/sync_manager.h
+++ b/chrome/browser/sync/internal_api/sync_manager.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
+#include "base/time.h"
#include "base/threading/thread_checker.h"
#include "chrome/browser/sync/internal_api/change_record.h"
#include "chrome/browser/sync/internal_api/configure_reason.h"
@@ -56,6 +57,21 @@ enum PassphraseRequiredReason {
// was unsuccessful.
};
+// Possible types of nudge delay for datatypes.
+// Note: These are just hints. If a sync happens then all dirty entries
+// would be committed as part of the sync.
+enum NudgeDelayType {
+ // Sync right away.
+ IMMEDIATE,
+
+ // Sync this change while syncing another change.
+ PIGGY_BACK_WITH_ANOTHER_CHANGE,
+
+ // The datatype does not use one of the predefined wait times but defines its
+ // own wait time logic for nudge.
+ CUSTOM,
+};
+
// Contains everything needed to talk to and identify a user account.
struct SyncCredentials {
std::string email;
@@ -583,7 +599,16 @@ class SyncManager {
void TriggerOnIncomingNotificationForTest(
const syncable::ModelTypeBitSet& model_types);
+ static const int kDefaultNudgeDelayMilliseconds;
+ static const int kPreferencesNudgeDelayMilliseconds;
+ static const int kPiggybackNudgeDelay;
+
private:
+ FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, NudgeDelayTest);
+
+ // For unit tests.
+ base::TimeDelta GetNudgeDelayTimeDelta(const syncable::ModelType& model_type);
+
base::ThreadChecker thread_checker_;
// An opaque pointer to the nested private class.

Powered by Google App Engine
This is Rietveld 408576698