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/strings/stringprintf.h" | 8 #include "base/strings/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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 if (command.has_sessions_commit_delay_seconds()) { | 426 if (command.has_sessions_commit_delay_seconds()) { |
427 session->delegate()->OnReceivedSessionsCommitDelay( | 427 session->delegate()->OnReceivedSessionsCommitDelay( |
428 base::TimeDelta::FromSeconds( | 428 base::TimeDelta::FromSeconds( |
429 command.sessions_commit_delay_seconds())); | 429 command.sessions_commit_delay_seconds())); |
430 } | 430 } |
431 | 431 |
432 if (command.has_client_invalidation_hint_buffer_size()) { | 432 if (command.has_client_invalidation_hint_buffer_size()) { |
433 session->delegate()->OnReceivedClientInvalidationHintBufferSize( | 433 session->delegate()->OnReceivedClientInvalidationHintBufferSize( |
434 command.client_invalidation_hint_buffer_size()); | 434 command.client_invalidation_hint_buffer_size()); |
435 } | 435 } |
| 436 |
| 437 if (command.has_gu_retry_delay_seconds()) { |
| 438 session->delegate()->OnReceivedGuRetryDelay( |
| 439 base::TimeDelta::FromSeconds(command.gu_retry_delay_seconds())); |
| 440 } |
436 } | 441 } |
437 | 442 |
438 // Now do any special handling for the error type and decide on the return | 443 // Now do any special handling for the error type and decide on the return |
439 // value. | 444 // value. |
440 switch (sync_protocol_error.error_type) { | 445 switch (sync_protocol_error.error_type) { |
441 case UNKNOWN_ERROR: | 446 case UNKNOWN_ERROR: |
442 LOG(WARNING) << "Sync protocol out-of-date. The server is using a more " | 447 LOG(WARNING) << "Sync protocol out-of-date. The server is using a more " |
443 << "recent version."; | 448 << "recent version."; |
444 return SERVER_RETURN_UNKNOWN_ERROR; | 449 return SERVER_RETURN_UNKNOWN_ERROR; |
445 case SYNC_SUCCESS: | 450 case SYNC_SUCCESS: |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 std::string SyncerProtoUtil::ClientToServerResponseDebugString( | 578 std::string SyncerProtoUtil::ClientToServerResponseDebugString( |
574 const ClientToServerResponse& response) { | 579 const ClientToServerResponse& response) { |
575 // Add more handlers as needed. | 580 // Add more handlers as needed. |
576 std::string output; | 581 std::string output; |
577 if (response.has_get_updates()) | 582 if (response.has_get_updates()) |
578 output.append(GetUpdatesResponseString(response.get_updates())); | 583 output.append(GetUpdatesResponseString(response.get_updates())); |
579 return output; | 584 return output; |
580 } | 585 } |
581 | 586 |
582 } // namespace syncer | 587 } // namespace syncer |
OLD | NEW |