| 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 #ifndef SYNC_SYNCABLE_MUTABLE_ENTRY_H_ | 5 #ifndef SYNC_SYNCABLE_MUTABLE_ENTRY_H_ |
| 6 #define SYNC_SYNCABLE_MUTABLE_ENTRY_H_ | 6 #define SYNC_SYNCABLE_MUTABLE_ENTRY_H_ |
| 7 | 7 |
| 8 #include "sync/internal_api/public/base/node_ordinal.h" |
| 8 #include "sync/syncable/entry.h" | 9 #include "sync/syncable/entry.h" |
| 9 #include "sync/syncable/metahandle_set.h" | 10 #include "sync/syncable/metahandle_set.h" |
| 10 | 11 |
| 11 namespace syncer { | 12 namespace syncer { |
| 12 class WriteNode; | 13 class WriteNode; |
| 13 | 14 |
| 14 namespace syncable { | 15 namespace syncable { |
| 15 | 16 |
| 16 class WriteTransaction; | 17 class WriteTransaction; |
| 17 | 18 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 42 return write_transaction_; | 43 return write_transaction_; |
| 43 } | 44 } |
| 44 | 45 |
| 45 // Field Accessors. Some of them trigger the re-indexing of the entry. | 46 // Field Accessors. Some of them trigger the re-indexing of the entry. |
| 46 // Return true on success, return false on failure, which means | 47 // Return true on success, return false on failure, which means |
| 47 // that putting the value would have caused a duplicate in the index. | 48 // that putting the value would have caused a duplicate in the index. |
| 48 // TODO(chron): Remove some of these unecessary return values. | 49 // TODO(chron): Remove some of these unecessary return values. |
| 49 bool Put(Int64Field field, const int64& value); | 50 bool Put(Int64Field field, const int64& value); |
| 50 bool Put(TimeField field, const base::Time& value); | 51 bool Put(TimeField field, const base::Time& value); |
| 51 bool Put(IdField field, const Id& value); | 52 bool Put(IdField field, const Id& value); |
| 53 bool Put(OrdinalField field, const NodeOrdinal& value); |
| 52 | 54 |
| 53 // Do a simple property-only update if the PARENT_ID field. Use with caution. | 55 // Do a simple property-only update if the PARENT_ID field. Use with caution. |
| 54 // | 56 // |
| 55 // The normal Put(IS_PARENT) call will move the item to the front of the | 57 // The normal Put(IS_PARENT) call will move the item to the front of the |
| 56 // sibling order to maintain the linked list invariants when the parent | 58 // sibling order to maintain the linked list invariants when the parent |
| 57 // changes. That's usually what you want to do, but it's inappropriate | 59 // changes. That's usually what you want to do, but it's inappropriate |
| 58 // when the caller is trying to change the parent ID of a the whole set | 60 // when the caller is trying to change the parent ID of a the whole set |
| 59 // of children (e.g. because the ID changed during a commit). For those | 61 // of children (e.g. because the ID changed during a commit). For those |
| 60 // cases, there's this function. It will corrupt the sibling ordering | 62 // cases, there's this function. It will corrupt the sibling ordering |
| 61 // if you're not careful. | 63 // if you're not careful. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 DISALLOW_COPY_AND_ASSIGN(MutableEntry); | 111 DISALLOW_COPY_AND_ASSIGN(MutableEntry); |
| 110 }; | 112 }; |
| 111 | 113 |
| 112 // This function sets only the flags needed to get this entry to sync. | 114 // This function sets only the flags needed to get this entry to sync. |
| 113 bool MarkForSyncing(syncable::MutableEntry* e); | 115 bool MarkForSyncing(syncable::MutableEntry* e); |
| 114 | 116 |
| 115 } // namespace syncable | 117 } // namespace syncable |
| 116 } // namespace syncer | 118 } // namespace syncer |
| 117 | 119 |
| 118 #endif // SYNC_SYNCABLE_MUTABLE_ENTRY_H_ | 120 #endif // SYNC_SYNCABLE_MUTABLE_ENTRY_H_ |
| OLD | NEW |