| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/syncable/syncable_util.h" | 5 #include "sync/syncable/syncable_util.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/base64.h" | 9 #include "base/base64.h" |
| 8 #include "base/location.h" | 10 #include "base/location.h" |
| 9 #include "base/logging.h" | 11 #include "base/logging.h" |
| 10 #include "base/sha1.h" | 12 #include "base/sha1.h" |
| 11 #include "sync/syncable/directory.h" | 13 #include "sync/syncable/directory.h" |
| 12 #include "sync/syncable/entry.h" | 14 #include "sync/syncable/entry.h" |
| 13 #include "sync/syncable/mutable_entry.h" | 15 #include "sync/syncable/mutable_entry.h" |
| 14 #include "sync/syncable/syncable_id.h" | 16 #include "sync/syncable/syncable_id.h" |
| 15 #include "sync/syncable/syncable_write_transaction.h" | 17 #include "sync/syncable/syncable_write_transaction.h" |
| 16 | 18 |
| 17 namespace syncer { | 19 namespace syncer { |
| 18 namespace syncable { | 20 namespace syncable { |
| 19 | 21 |
| 20 // Returns the number of unsynced entries. | 22 // Returns the number of unsynced entries. |
| 21 int GetUnsyncedEntries(BaseTransaction* trans, | 23 int GetUnsyncedEntries(BaseTransaction* trans, std::vector<int64_t>* handles) { |
| 22 std::vector<int64> *handles) { | |
| 23 trans->directory()->GetUnsyncedMetaHandles(trans, handles); | 24 trans->directory()->GetUnsyncedMetaHandles(trans, handles); |
| 24 DVLOG_IF(1, !handles->empty()) << "Have " << handles->size() | 25 DVLOG_IF(1, !handles->empty()) << "Have " << handles->size() |
| 25 << " unsynced items."; | 26 << " unsynced items."; |
| 26 return handles->size(); | 27 return handles->size(); |
| 27 } | 28 } |
| 28 | 29 |
| 29 bool IsLegalNewParent(BaseTransaction* trans, const Id& entry_id, | 30 bool IsLegalNewParent(BaseTransaction* trans, const Id& entry_id, |
| 30 const Id& new_parent_id) { | 31 const Id& new_parent_id) { |
| 31 DCHECK(!entry_id.IsNull()); | 32 DCHECK(!entry_id.IsNull()); |
| 32 DCHECK(!new_parent_id.IsNull()); | 33 DCHECK(!new_parent_id.IsNull()); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 113 |
| 113 std::string GenerateSyncableBookmarkHash( | 114 std::string GenerateSyncableBookmarkHash( |
| 114 const std::string& originator_cache_guid, | 115 const std::string& originator_cache_guid, |
| 115 const std::string& originator_client_item_id) { | 116 const std::string& originator_client_item_id) { |
| 116 return syncable::GenerateSyncableHash( | 117 return syncable::GenerateSyncableHash( |
| 117 BOOKMARKS, originator_cache_guid + originator_client_item_id); | 118 BOOKMARKS, originator_cache_guid + originator_client_item_id); |
| 118 } | 119 } |
| 119 | 120 |
| 120 } // namespace syncable | 121 } // namespace syncable |
| 121 } // namespace syncer | 122 } // namespace syncer |
| OLD | NEW |