| OLD | NEW |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 VerifyResult VerifyUpdatesCommand::VerifyUpdate( | 56 VerifyResult VerifyUpdatesCommand::VerifyUpdate( |
| 57 syncable::WriteTransaction* trans, const SyncEntity& entry) { | 57 syncable::WriteTransaction* trans, const SyncEntity& entry) { |
| 58 syncable::Id id = entry.id(); | 58 syncable::Id id = entry.id(); |
| 59 | 59 |
| 60 const bool deleted = entry.has_deleted() && entry.deleted(); | 60 const bool deleted = entry.has_deleted() && entry.deleted(); |
| 61 const bool is_directory = entry.IsFolder(); | 61 const bool is_directory = entry.IsFolder(); |
| 62 const bool is_bookmark = | 62 const bool is_bookmark = |
| 63 SyncerUtil::GetSyncDataType(entry) == SYNC_TYPE_BOOKMARK; | 63 SyncerUtil::GetModelType(entry) == syncable::BOOKMARKS; |
| 64 | 64 |
| 65 if (!id.ServerKnows()) { | 65 if (!id.ServerKnows()) { |
| 66 LOG(ERROR) << "Illegal negative id in received updates"; | 66 LOG(ERROR) << "Illegal negative id in received updates"; |
| 67 return VERIFY_FAIL; | 67 return VERIFY_FAIL; |
| 68 } | 68 } |
| 69 if (!entry.parent_id().ServerKnows()) { | 69 if (!entry.parent_id().ServerKnows()) { |
| 70 LOG(ERROR) << "Illegal parent id in received updates"; | 70 LOG(ERROR) << "Illegal parent id in received updates"; |
| 71 return VERIFY_FAIL; | 71 return VERIFY_FAIL; |
| 72 } | 72 } |
| 73 { | 73 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 94 deleted, is_directory, is_bookmark); | 94 deleted, is_directory, is_bookmark); |
| 95 } | 95 } |
| 96 | 96 |
| 97 if (VERIFY_UNDECIDED == result) | 97 if (VERIFY_UNDECIDED == result) |
| 98 return VERIFY_SUCCESS; // No news is good news. | 98 return VERIFY_SUCCESS; // No news is good news. |
| 99 else | 99 else |
| 100 return result; // This might be VERIFY_SUCCESS as well | 100 return result; // This might be VERIFY_SUCCESS as well |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace browser_sync | 103 } // namespace browser_sync |
| OLD | NEW |