| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/engine/syncer_proto_util.h" | 5 #include "chrome/browser/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 "chrome/browser/sync/engine/net/server_connection_manager.h" | 9 #include "chrome/browser/sync/engine/net/server_connection_manager.h" |
| 10 #include "chrome/browser/sync/engine/syncer.h" | 10 #include "chrome/browser/sync/engine/syncer.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 void SyncerProtoUtil::HandleMigrationDoneResponse( | 86 void SyncerProtoUtil::HandleMigrationDoneResponse( |
| 87 const sync_pb::ClientToServerResponse* response, | 87 const sync_pb::ClientToServerResponse* response, |
| 88 sessions::SyncSession* session) { | 88 sessions::SyncSession* session) { |
| 89 LOG_IF(ERROR, 0 >= response->migrated_data_type_id_size()) | 89 LOG_IF(ERROR, 0 >= response->migrated_data_type_id_size()) |
| 90 << "MIGRATION_DONE but no types specified."; | 90 << "MIGRATION_DONE but no types specified."; |
| 91 syncable::ModelTypeSet to_migrate; | 91 syncable::ModelTypeSet to_migrate; |
| 92 for (int i = 0; i < response->migrated_data_type_id_size(); i++) { | 92 for (int i = 0; i < response->migrated_data_type_id_size(); i++) { |
| 93 to_migrate.insert(syncable::GetModelTypeFromExtensionFieldNumber( | 93 to_migrate.insert(syncable::GetModelTypeFromExtensionFieldNumber( |
| 94 response->migrated_data_type_id(i))); | 94 response->migrated_data_type_id(i))); |
| 95 } | 95 } |
| 96 // TODO(akalin): This should be a set union. |
| 96 session->status_controller()->set_types_needing_local_migration(to_migrate); | 97 session->status_controller()->set_types_needing_local_migration(to_migrate); |
| 97 } | 98 } |
| 98 | 99 |
| 99 // static | 100 // static |
| 100 bool SyncerProtoUtil::VerifyResponseBirthday(syncable::Directory* dir, | 101 bool SyncerProtoUtil::VerifyResponseBirthday(syncable::Directory* dir, |
| 101 const ClientToServerResponse* response) { | 102 const ClientToServerResponse* response) { |
| 102 | 103 |
| 103 std::string local_birthday = dir->store_birthday(); | 104 std::string local_birthday = dir->store_birthday(); |
| 104 | 105 |
| 105 // TODO(lipalani) : Remove this check here. When the new implementation | 106 // TODO(lipalani) : Remove this check here. When the new implementation |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 std::string SyncerProtoUtil::ClientToServerResponseDebugString( | 506 std::string SyncerProtoUtil::ClientToServerResponseDebugString( |
| 506 const sync_pb::ClientToServerResponse& response) { | 507 const sync_pb::ClientToServerResponse& response) { |
| 507 // Add more handlers as needed. | 508 // Add more handlers as needed. |
| 508 std::string output; | 509 std::string output; |
| 509 if (response.has_get_updates()) | 510 if (response.has_get_updates()) |
| 510 output.append(GetUpdatesResponseString(response.get_updates())); | 511 output.append(GetUpdatesResponseString(response.get_updates())); |
| 511 return output; | 512 return output; |
| 512 } | 513 } |
| 513 | 514 |
| 514 } // namespace browser_sync | 515 } // namespace browser_sync |
| OLD | NEW |