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

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: Fix mac test 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void SyncerProtoUtil::HandleMigrationDoneResponse( 84 void SyncerProtoUtil::HandleMigrationDoneResponse(
85 const sync_pb::ClientToServerResponse* response, 85 const sync_pb::ClientToServerResponse* response,
86 sessions::SyncSession* session) { 86 sessions::SyncSession* session) {
87 LOG_IF(ERROR, 0 >= response->migrated_data_type_id_size()) 87 LOG_IF(ERROR, 0 >= response->migrated_data_type_id_size())
88 << "MIGRATION_DONE but no types specified."; 88 << "MIGRATION_DONE but no types specified.";
89 syncable::ModelTypeSet to_migrate; 89 syncable::ModelTypeSet to_migrate;
90 for (int i = 0; i < response->migrated_data_type_id_size(); i++) { 90 for (int i = 0; i < response->migrated_data_type_id_size(); i++) {
91 to_migrate.insert(syncable::GetModelTypeFromExtensionFieldNumber( 91 to_migrate.insert(syncable::GetModelTypeFromExtensionFieldNumber(
92 response->migrated_data_type_id(i))); 92 response->migrated_data_type_id(i)));
93 } 93 }
94 // TODO(akalin): This should be a set union.
94 session->status_controller()->set_types_needing_local_migration(to_migrate); 95 session->status_controller()->set_types_needing_local_migration(to_migrate);
95 } 96 }
96 97
97 // static 98 // static
98 bool SyncerProtoUtil::VerifyResponseBirthday(syncable::Directory* dir, 99 bool SyncerProtoUtil::VerifyResponseBirthday(syncable::Directory* dir,
99 const ClientToServerResponse* response) { 100 const ClientToServerResponse* response) {
100 101
101 std::string local_birthday = dir->store_birthday(); 102 std::string local_birthday = dir->store_birthday();
102 103
103 if (response->error_code() == ClientToServerResponse::CLEAR_PENDING || 104 if (response->error_code() == ClientToServerResponse::CLEAR_PENDING ||
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 std::string SyncerProtoUtil::ClientToServerResponseDebugString( 391 std::string SyncerProtoUtil::ClientToServerResponseDebugString(
391 const sync_pb::ClientToServerResponse& response) { 392 const sync_pb::ClientToServerResponse& response) {
392 // Add more handlers as needed. 393 // Add more handlers as needed.
393 std::string output; 394 std::string output;
394 if (response.has_get_updates()) 395 if (response.has_get_updates())
395 output.append(GetUpdatesResponseString(response.get_updates())); 396 output.append(GetUpdatesResponseString(response.get_updates()));
396 return output; 397 return output;
397 } 398 }
398 399
399 } // namespace browser_sync 400 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698