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

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: 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
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..bdac0a6f6e6035ee9525d60587e6871d0418f569 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 always_fetch_updates_before_commit,
const std::string& invalidator_client_id);
~SyncSessionContext();
@@ -129,6 +130,15 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
return invalidator_client_id_;
}
+ const bool should_fetch_updates_before_commit() const {
+ return !(pre_commit_update_avoidance_experiment_enabled_ ||
+ force_enable_pre_commit_update_avoidance_);
+ }
+
+ void set_pre_commit_update_avoidance_experiment_enabled(bool value) {
+ pre_commit_update_avoidance_experiment_enabled_ = 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 pre_commit_update_avoidance_experiment_enabled_;
Nicolas Zea 2013/07/16 00:24:32 Do we plan for this to stick around (i.e. is the e
rlarocque 2013/07/16 01:08:27 Good point. I was hoping to remove this flag and
+
+ // If true, indicates that we've been passed a command-line flag to force
+ // enable the pre-commit update avoidance experiment described above.
+ bool force_enable_pre_commit_update_avoidance_;
+
DISALLOW_COPY_AND_ASSIGN(SyncSessionContext);
};

Powered by Google App Engine
This is Rietveld 408576698