| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "sync/engine/syncer_proto_util.h" | 5 #include "sync/engine/syncer_proto_util.h" | 
| 6 | 6 | 
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" | 
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" | 
| 9 #include "google_apis/google_api_keys.h" | 9 #include "google_apis/google_api_keys.h" | 
| 10 #include "sync/engine/net/server_connection_manager.h" | 10 #include "sync/engine/net/server_connection_manager.h" | 
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 428     if (command.has_set_sync_poll_interval()) { | 428     if (command.has_set_sync_poll_interval()) { | 
| 429       session->delegate()->OnReceivedShortPollIntervalUpdate( | 429       session->delegate()->OnReceivedShortPollIntervalUpdate( | 
| 430           base::TimeDelta::FromSeconds(command.set_sync_poll_interval())); | 430           base::TimeDelta::FromSeconds(command.set_sync_poll_interval())); | 
| 431     } | 431     } | 
| 432 | 432 | 
| 433     if (command.has_sessions_commit_delay_seconds()) { | 433     if (command.has_sessions_commit_delay_seconds()) { | 
| 434       session->delegate()->OnReceivedSessionsCommitDelay( | 434       session->delegate()->OnReceivedSessionsCommitDelay( | 
| 435           base::TimeDelta::FromSeconds( | 435           base::TimeDelta::FromSeconds( | 
| 436               command.sessions_commit_delay_seconds())); | 436               command.sessions_commit_delay_seconds())); | 
| 437     } | 437     } | 
|  | 438 | 
|  | 439     if (command.has_client_invalidation_hint_buffer_size()) { | 
|  | 440       session->delegate()->OnReceivedClientInvalidationHintBufferSize( | 
|  | 441           command.client_invalidation_hint_buffer_size()); | 
|  | 442     } | 
| 438   } | 443   } | 
| 439 | 444 | 
| 440   // Now do any special handling for the error type and decide on the return | 445   // Now do any special handling for the error type and decide on the return | 
| 441   // value. | 446   // value. | 
| 442   switch (sync_protocol_error.error_type) { | 447   switch (sync_protocol_error.error_type) { | 
| 443     case UNKNOWN_ERROR: | 448     case UNKNOWN_ERROR: | 
| 444       LOG(WARNING) << "Sync protocol out-of-date. The server is using a more " | 449       LOG(WARNING) << "Sync protocol out-of-date. The server is using a more " | 
| 445                    << "recent version."; | 450                    << "recent version."; | 
| 446       return SERVER_RETURN_UNKNOWN_ERROR; | 451       return SERVER_RETURN_UNKNOWN_ERROR; | 
| 447     case SYNC_SUCCESS: | 452     case SYNC_SUCCESS: | 
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 614 std::string SyncerProtoUtil::ClientToServerResponseDebugString( | 619 std::string SyncerProtoUtil::ClientToServerResponseDebugString( | 
| 615     const ClientToServerResponse& response) { | 620     const ClientToServerResponse& response) { | 
| 616   // Add more handlers as needed. | 621   // Add more handlers as needed. | 
| 617   std::string output; | 622   std::string output; | 
| 618   if (response.has_get_updates()) | 623   if (response.has_get_updates()) | 
| 619     output.append(GetUpdatesResponseString(response.get_updates())); | 624     output.append(GetUpdatesResponseString(response.get_updates())); | 
| 620   return output; | 625   return output; | 
| 621 } | 626 } | 
| 622 | 627 | 
| 623 }  // namespace syncer | 628 }  // namespace syncer | 
| OLD | NEW | 
|---|