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

Unified Diff: sync/sessions/sync_session_context.h

Issue 19309002: sync: Add pre-commit update avoidance mode + flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 7 years, 5 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/sessions/nudge_tracker_unittest.cc ('k') | sync/sessions/sync_session_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/sync_session_context.h
diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h
index b694162c15637e046d1997f51d0d8bcde6d42cb2..76170958eccec5441e4a937cfaaafadffec8765a 100644
--- a/sync/sessions/sync_session_context.h
+++ b/sync/sessions/sync_session_context.h
@@ -55,6 +55,7 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
DebugInfoGetter* debug_info_getter,
TrafficRecorder* traffic_recorder,
bool keystore_encryption_enabled,
+ bool client_enabled_pre_commit_update_avoidance,
const std::string& invalidator_client_id);
~SyncSessionContext();
@@ -129,6 +130,15 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
return invalidator_client_id_;
}
+ bool ShouldFetchUpdatesBeforeCommit() const {
+ return !(server_enabled_pre_commit_update_avoidance_ ||
+ client_enabled_pre_commit_update_avoidance_);
+ }
+
+ void set_server_enabled_pre_commit_update_avoidance(bool value) {
+ server_enabled_pre_commit_update_avoidance_ = value;
+ }
+
private:
// Rather than force clients to set and null-out various context members, we
// extend our encapsulation boundary to scoped helpers that take care of this
@@ -181,6 +191,15 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
// prevent us from receiving notifications of changes we make ourselves.
const std::string invalidator_client_id_;
+ // Flag to enable or disable the no pre-commit GetUpdates experiment. When
+ // this flag is set to false, the syncer has the option of not performing at
+ // GetUpdates request when there is nothing to fetch.
+ bool server_enabled_pre_commit_update_avoidance_;
+
+ // If true, indicates that we've been passed a command-line flag to force
+ // enable the pre-commit update avoidance experiment described above.
+ const bool client_enabled_pre_commit_update_avoidance_;
+
DISALLOW_COPY_AND_ASSIGN(SyncSessionContext);
};
« no previous file with comments | « sync/sessions/nudge_tracker_unittest.cc ('k') | sync/sessions/sync_session_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698