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

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

Issue 7481009: Test birtday error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review Created 9 years, 5 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 session->status_controller()->set_types_needing_local_migration(to_migrate); 93 session->status_controller()->set_types_needing_local_migration(to_migrate);
94 } 94 }
95 95
96 // static 96 // static
97 bool SyncerProtoUtil::VerifyResponseBirthday(syncable::Directory* dir, 97 bool SyncerProtoUtil::VerifyResponseBirthday(syncable::Directory* dir,
98 const ClientToServerResponse* response) { 98 const ClientToServerResponse* response) {
99 99
100 std::string local_birthday = dir->store_birthday(); 100 std::string local_birthday = dir->store_birthday();
101 101
102 if (response->error_code() == ClientToServerResponse::CLEAR_PENDING) { 102 if (response->error_code() == ClientToServerResponse::CLEAR_PENDING ||
103 response->error_code() == ClientToServerResponse::NOT_MY_BIRTHDAY) {
103 // Birthday verification failures result in stopping sync and deleting 104 // Birthday verification failures result in stopping sync and deleting
104 // local sync data. 105 // local sync data.
105 return false; 106 return false;
106 } 107 }
107 108
108 if (local_birthday.empty()) { 109 if (local_birthday.empty()) {
109 if (!response->has_store_birthday()) { 110 if (!response->has_store_birthday()) {
110 LOG(WARNING) << "Expected a birthday on first sync."; 111 LOG(WARNING) << "Expected a birthday on first sync.";
111 return false; 112 return false;
112 } 113 }
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 std::string SyncerProtoUtil::ClientToServerResponseDebugString( 375 std::string SyncerProtoUtil::ClientToServerResponseDebugString(
375 const sync_pb::ClientToServerResponse& response) { 376 const sync_pb::ClientToServerResponse& response) {
376 // Add more handlers as needed. 377 // Add more handlers as needed.
377 std::string output; 378 std::string output;
378 if (response.has_get_updates()) 379 if (response.has_get_updates())
379 output.append(GetUpdatesResponseString(response.get_updates())); 380 output.append(GetUpdatesResponseString(response.get_updates()));
380 return output; 381 return output;
381 } 382 }
382 383
383 } // namespace browser_sync 384 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_harness.h » ('j') | net/tools/testserver/chromiumsync.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698