| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/engine/verify_updates_command.h" | 5 #include "sync/engine/verify_updates_command.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "sync/engine/syncer.h" | 10 #include "sync/engine/syncer.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 status->increment_num_reflected_updates_downloaded_by(1); | 142 status->increment_num_reflected_updates_downloaded_by(1); |
| 143 if (update.deleted()) | 143 if (update.deleted()) |
| 144 status->increment_num_tombstone_updates_downloaded_by(1); | 144 status->increment_num_tombstone_updates_downloaded_by(1); |
| 145 } | 145 } |
| 146 | 146 |
| 147 return SYNCER_OK; | 147 return SYNCER_OK; |
| 148 } | 148 } |
| 149 | 149 |
| 150 VerifyUpdatesCommand::VerifyUpdateResult VerifyUpdatesCommand::VerifyUpdate( | 150 VerifyUpdatesCommand::VerifyUpdateResult VerifyUpdatesCommand::VerifyUpdate( |
| 151 syncable::WriteTransaction* trans, const sync_pb::SyncEntity& entry, | 151 syncable::WriteTransaction* trans, const sync_pb::SyncEntity& entry, |
| 152 const ModelTypeSet& requested_types, | 152 ModelTypeSet requested_types, |
| 153 const ModelSafeRoutingInfo& routes) { | 153 const ModelSafeRoutingInfo& routes) { |
| 154 syncable::Id id = SyncableIdFromProto(entry.id_string()); | 154 syncable::Id id = SyncableIdFromProto(entry.id_string()); |
| 155 VerifyUpdateResult result = {VERIFY_FAIL, GROUP_PASSIVE}; | 155 VerifyUpdateResult result = {VERIFY_FAIL, GROUP_PASSIVE}; |
| 156 | 156 |
| 157 const bool deleted = entry.has_deleted() && entry.deleted(); | 157 const bool deleted = entry.has_deleted() && entry.deleted(); |
| 158 const bool is_directory = IsFolder(entry); | 158 const bool is_directory = IsFolder(entry); |
| 159 const ModelType model_type = GetModelType(entry); | 159 const ModelType model_type = GetModelType(entry); |
| 160 | 160 |
| 161 if (!id.ServerKnows()) { | 161 if (!id.ServerKnows()) { |
| 162 LOG(ERROR) << "Illegal negative id in received updates"; | 162 LOG(ERROR) << "Illegal negative id in received updates"; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 deleted, is_directory, model_type); | 201 deleted, is_directory, model_type); |
| 202 } | 202 } |
| 203 | 203 |
| 204 if (VERIFY_UNDECIDED == result.value) | 204 if (VERIFY_UNDECIDED == result.value) |
| 205 result.value = VERIFY_SUCCESS; // No news is good news. | 205 result.value = VERIFY_SUCCESS; // No news is good news. |
| 206 | 206 |
| 207 return result; // This might be VERIFY_SUCCESS as well | 207 return result; // This might be VERIFY_SUCCESS as well |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace syncer | 210 } // namespace syncer |
| OLD | NEW |