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

Side by Side Diff: chrome/browser/sync/engine/syncer_proto_util.cc

Issue 7655055: [Sync] Make BackendMigrator not wait for full sync cycles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address more comments Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_end_command.cc ('k') | chrome/browser/sync/glue/data_type_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698