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

Side by Side Diff: sync/syncable/mutable_entry.h

Issue 10989063: Changed DB to store node positions as Ordinals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed memory leak error in unittest Created 8 years, 2 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
« no previous file with comments | « sync/syncable/entry_kernel.cc ('k') | sync/syncable/mutable_entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « sync/syncable/entry_kernel.cc ('k') | sync/syncable/mutable_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698