| 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 "components/sync/engine_impl/syncer_proto_util.h" | 5 #include "components/sync/engine_impl/syncer_proto_util.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 return SERVER_RETURN_NOT_MY_BIRTHDAY; | 491 return SERVER_RETURN_NOT_MY_BIRTHDAY; |
| 492 case DISABLED_BY_ADMIN: | 492 case DISABLED_BY_ADMIN: |
| 493 return SERVER_RETURN_DISABLED_BY_ADMIN; | 493 return SERVER_RETURN_DISABLED_BY_ADMIN; |
| 494 case PARTIAL_FAILURE: | 494 case PARTIAL_FAILURE: |
| 495 // This only happens when partial throttling during GetUpdates. | 495 // This only happens when partial throttling during GetUpdates. |
| 496 if (!sync_protocol_error.error_data_types.Empty()) { | 496 if (!sync_protocol_error.error_data_types.Empty()) { |
| 497 DLOG(WARNING) << "Some types throttled by syncer during GetUpdates."; | 497 DLOG(WARNING) << "Some types throttled by syncer during GetUpdates."; |
| 498 cycle->delegate()->OnTypesThrottled( | 498 cycle->delegate()->OnTypesThrottled( |
| 499 sync_protocol_error.error_data_types, GetThrottleDelay(*response)); | 499 sync_protocol_error.error_data_types, GetThrottleDelay(*response)); |
| 500 } | 500 } |
| 501 if (partial_failure_data_types != NULL) { | 501 if (partial_failure_data_types != nullptr) { |
| 502 *partial_failure_data_types = sync_protocol_error.error_data_types; | 502 *partial_failure_data_types = sync_protocol_error.error_data_types; |
| 503 } | 503 } |
| 504 return SERVER_RETURN_PARTIAL_FAILURE; | 504 return SERVER_RETURN_PARTIAL_FAILURE; |
| 505 case CLIENT_DATA_OBSOLETE: | 505 case CLIENT_DATA_OBSOLETE: |
| 506 return SERVER_RETURN_CLIENT_DATA_OBSOLETE; | 506 return SERVER_RETURN_CLIENT_DATA_OBSOLETE; |
| 507 default: | 507 default: |
| 508 NOTREACHED(); | 508 NOTREACHED(); |
| 509 return UNSET; | 509 return UNSET; |
| 510 } | 510 } |
| 511 } | 511 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 std::string SyncerProtoUtil::ClientToServerResponseDebugString( | 594 std::string SyncerProtoUtil::ClientToServerResponseDebugString( |
| 595 const ClientToServerResponse& response) { | 595 const ClientToServerResponse& response) { |
| 596 // Add more handlers as needed. | 596 // Add more handlers as needed. |
| 597 std::string output; | 597 std::string output; |
| 598 if (response.has_get_updates()) | 598 if (response.has_get_updates()) |
| 599 output.append(GetUpdatesResponseString(response.get_updates())); | 599 output.append(GetUpdatesResponseString(response.get_updates())); |
| 600 return output; | 600 return output; |
| 601 } | 601 } |
| 602 | 602 |
| 603 } // namespace syncer | 603 } // namespace syncer |
| OLD | NEW |