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

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

Issue 2844037: Fix handling of undeletion within the syncer. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Whitespace. Created 10 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 5
6 #include "chrome/browser/sync/engine/verify_updates_command.h" 6 #include "chrome/browser/sync/engine/verify_updates_command.h"
7 7
8 #include "chrome/browser/sync/engine/syncer.h" 8 #include "chrome/browser/sync/engine/syncer.h"
9 #include "chrome/browser/sync/engine/syncer_proto_util.h" 9 #include "chrome/browser/sync/engine/syncer_proto_util.h"
10 #include "chrome/browser/sync/engine/syncer_types.h" 10 #include "chrome/browser/sync/engine/syncer_types.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 VerifyUpdateResult result = {VERIFY_FAIL, GROUP_PASSIVE}; 87 VerifyUpdateResult result = {VERIFY_FAIL, GROUP_PASSIVE};
88 88
89 const bool deleted = entry.has_deleted() && entry.deleted(); 89 const bool deleted = entry.has_deleted() && entry.deleted();
90 const bool is_directory = entry.IsFolder(); 90 const bool is_directory = entry.IsFolder();
91 const syncable::ModelType model_type = entry.GetModelType(); 91 const syncable::ModelType model_type = entry.GetModelType();
92 92
93 if (!id.ServerKnows()) { 93 if (!id.ServerKnows()) {
94 LOG(ERROR) << "Illegal negative id in received updates"; 94 LOG(ERROR) << "Illegal negative id in received updates";
95 return result; 95 return result;
96 } 96 }
97 if (!entry.parent_id().ServerKnows()) {
98 LOG(ERROR) << "Illegal parent id in received updates";
99 return result;
100 }
101 { 97 {
102 const std::string name = SyncerProtoUtil::NameFromSyncEntity(entry); 98 const std::string name = SyncerProtoUtil::NameFromSyncEntity(entry);
103 if (name.empty() && !deleted) { 99 if (name.empty() && !deleted) {
104 LOG(ERROR) << "Zero length name in non-deleted update"; 100 LOG(ERROR) << "Zero length name in non-deleted update";
105 return result; 101 return result;
106 } 102 }
107 } 103 }
108 104
109 syncable::MutableEntry same_id(trans, GET_BY_ID, id); 105 syncable::MutableEntry same_id(trans, GET_BY_ID, id);
110 result.value = SyncerUtil::VerifyNewEntry(entry, &same_id, deleted); 106 result.value = SyncerUtil::VerifyNewEntry(entry, &same_id, deleted);
(...skipping 18 matching lines...) Expand all
129 deleted, is_directory, model_type); 125 deleted, is_directory, model_type);
130 } 126 }
131 127
132 if (VERIFY_UNDECIDED == result.value) 128 if (VERIFY_UNDECIDED == result.value)
133 result.value = VERIFY_SUCCESS; // No news is good news. 129 result.value = VERIFY_SUCCESS; // No news is good news.
134 130
135 return result; // This might be VERIFY_SUCCESS as well 131 return result; // This might be VERIFY_SUCCESS as well
136 } 132 }
137 133
138 } // namespace browser_sync 134 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncproto.h ('k') | chrome/browser/sync/sessions/status_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698