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..4ec0b77809030400519bd1a20b3f68f746f58ac1 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 should_fetch_updates_before_commit() const { |
|
tim (not reviewing)
2013/07/19 20:11:36
nit - Style Guide Says: Use CamelCase for this ver
rlarocque
2013/07/19 20:35:46
Done.
|
| + 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. |
| + bool client_enabled_pre_commit_update_avoidance_; |
|
tim (not reviewing)
2013/07/19 20:11:36
This one should be const.
rlarocque
2013/07/19 20:35:46
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); |
| }; |