Chromium Code Reviews| 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); |
| }; |