| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "sync/syncable/entry.h" | 9 #include "sync/syncable/entry.h" |
| 10 #include "sync/syncable/metahandle_set.h" | 10 #include "sync/syncable/metahandle_set.h" |
| 11 | 11 |
| 12 namespace csync { | 12 namespace syncer { |
| 13 class WriteNode; | 13 class WriteNode; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace syncable { | 16 namespace syncable { |
| 17 | 17 |
| 18 class WriteTransaction; | 18 class WriteTransaction; |
| 19 | 19 |
| 20 enum Create { | 20 enum Create { |
| 21 CREATE | 21 CREATE |
| 22 }; | 22 }; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 bool Put(BitTemp field, bool value); | 82 bool Put(BitTemp field, bool value); |
| 83 | 83 |
| 84 protected: | 84 protected: |
| 85 syncable::MetahandleSet* GetDirtyIndexHelper(); | 85 syncable::MetahandleSet* GetDirtyIndexHelper(); |
| 86 | 86 |
| 87 bool PutIsDel(bool value); | 87 bool PutIsDel(bool value); |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 friend class Directory; | 90 friend class Directory; |
| 91 friend class WriteTransaction; | 91 friend class WriteTransaction; |
| 92 friend class csync::WriteNode; | 92 friend class syncer::WriteNode; |
| 93 | 93 |
| 94 // Don't allow creation on heap, except by sync API wrappers. | 94 // Don't allow creation on heap, except by sync API wrappers. |
| 95 void* operator new(size_t size) { return (::operator new)(size); } | 95 void* operator new(size_t size) { return (::operator new)(size); } |
| 96 | 96 |
| 97 bool PutUniqueClientTag(const std::string& value); | 97 bool PutUniqueClientTag(const std::string& value); |
| 98 | 98 |
| 99 // Adjusts the successor and predecessor entries so that they no longer | 99 // Adjusts the successor and predecessor entries so that they no longer |
| 100 // refer to this entry. | 100 // refer to this entry. |
| 101 bool UnlinkFromOrder(); | 101 bool UnlinkFromOrder(); |
| 102 | 102 |
| 103 // Kind of redundant. We should reduce the number of pointers | 103 // Kind of redundant. We should reduce the number of pointers |
| 104 // floating around if at all possible. Could we store this in Directory? | 104 // floating around if at all possible. Could we store this in Directory? |
| 105 // Scope: Set on construction, never changed after that. | 105 // Scope: Set on construction, never changed after that. |
| 106 WriteTransaction* const write_transaction_; | 106 WriteTransaction* const write_transaction_; |
| 107 | 107 |
| 108 protected: | 108 protected: |
| 109 MutableEntry(); | 109 MutableEntry(); |
| 110 | 110 |
| 111 DISALLOW_COPY_AND_ASSIGN(MutableEntry); | 111 DISALLOW_COPY_AND_ASSIGN(MutableEntry); |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 // 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. |
| 115 bool MarkForSyncing(syncable::MutableEntry* e); | 115 bool MarkForSyncing(syncable::MutableEntry* e); |
| 116 | 116 |
| 117 } // namespace syncable | 117 } // namespace syncable |
| 118 | 118 |
| 119 #endif // SYNC_SYNCABLE_MUTABLE_ENTRY_H_ | 119 #endif // SYNC_SYNCABLE_MUTABLE_ENTRY_H_ |
| OLD | NEW |