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

Unified Diff: sync/engine/syncer_proto_util.cc

Issue 10909160: sync: Process client commands on commit response (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Inline client command processing Created 8 years, 3 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/engine/syncer.cc ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer_proto_util.cc
diff --git a/sync/engine/syncer_proto_util.cc b/sync/engine/syncer_proto_util.cc
index 8149ad8e5301500f0c3044e2d4acc97cf3323854..e6be1b38de7dd063d90076ac9ec5ec868b8dc80b 100644
--- a/sync/engine/syncer_proto_util.cc
+++ b/sync/engine/syncer_proto_util.cc
@@ -394,6 +394,31 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage(
// Inform the delegate of the error we got.
session->delegate()->OnSyncProtocolError(session->TakeSnapshot());
+ // Update our state for any other commands we've received.
+ if (response->has_client_command()) {
+ const sync_pb::ClientCommand& command = response->client_command();
+ if (command.has_max_commit_batch_size()) {
+ session->context()->set_max_commit_batch_size(
+ command.max_commit_batch_size());
+ }
+
+ if (command.has_set_sync_long_poll_interval()) {
+ session->delegate()->OnReceivedLongPollIntervalUpdate(
+ base::TimeDelta::FromSeconds(command.set_sync_long_poll_interval()));
+ }
+
+ if (command.has_set_sync_poll_interval()) {
+ session->delegate()->OnReceivedShortPollIntervalUpdate(
+ base::TimeDelta::FromSeconds(command.set_sync_poll_interval()));
+ }
+
+ if (command.has_sessions_commit_delay_seconds()) {
+ session->delegate()->OnReceivedSessionsCommitDelay(
+ base::TimeDelta::FromSeconds(
+ command.sessions_commit_delay_seconds()));
+ }
+ }
+
// Now do any special handling for the error type and decide on the return
// value.
switch (sync_protocol_error.error_type) {
« no previous file with comments | « sync/engine/syncer.cc ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698