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

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

Issue 1136953013: Sync: Change Local IDs to GUID based to avoid ID collision (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed setting KERNEL_SHARE_INFO_DIRTY when incrementing transaction version Created 5 years, 7 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 | « no previous file | sync/syncable/directory.cc » ('j') | sync/syncable/directory.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_DIRECTORY_H_ 5 #ifndef SYNC_SYNCABLE_DIRECTORY_H_
6 #define SYNC_SYNCABLE_DIRECTORY_H_ 6 #define SYNC_SYNCABLE_DIRECTORY_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // Sync-side transaction version per data type. Monotonically incremented 103 // Sync-side transaction version per data type. Monotonically incremented
104 // when updating native model. A copy is also saved in native model. 104 // when updating native model. A copy is also saved in native model.
105 // Later out-of-sync models can be detected and fixed by comparing 105 // Later out-of-sync models can be detected and fixed by comparing
106 // transaction versions of sync model and native model. 106 // transaction versions of sync model and native model.
107 // TODO(hatiaol): implement detection and fixing of out-of-sync models. 107 // TODO(hatiaol): implement detection and fixing of out-of-sync models.
108 // Bug 154858. 108 // Bug 154858.
109 int64 transaction_version[MODEL_TYPE_COUNT]; 109 int64 transaction_version[MODEL_TYPE_COUNT];
110 // The store birthday we were given by the server. Contents are opaque to 110 // The store birthday we were given by the server. Contents are opaque to
111 // the client. 111 // the client.
112 std::string store_birthday; 112 std::string store_birthday;
113 // The next local ID that has not been used with this cache-GUID.
114 int64 next_id;
115 // The serialized bag of chips we were given by the server. Contents are 113 // The serialized bag of chips we were given by the server. Contents are
116 // opaque to the client. This is the serialization of a message of type 114 // opaque to the client. This is the serialization of a message of type
117 // ChipBag defined in sync.proto. It can contains NULL characters. 115 // ChipBag defined in sync.proto. It can contains NULL characters.
118 std::string bag_of_chips; 116 std::string bag_of_chips;
119 // The per-datatype context. 117 // The per-datatype context.
120 sync_pb::DataTypeContext datatype_context[MODEL_TYPE_COUNT]; 118 sync_pb::DataTypeContext datatype_context[MODEL_TYPE_COUNT];
121 }; 119 };
122 120
123 // What the Directory needs on initialization to create itself and its Kernel. 121 // What the Directory needs on initialization to create itself and its Kernel.
124 // Filled by DirectoryBackingStore::Load. 122 // Filled by DirectoryBackingStore::Load.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // Does not take ownership of |delegate|, which must not be NULL. 260 // Does not take ownership of |delegate|, which must not be NULL.
263 // Starts sending events to |delegate| if the returned result is 261 // Starts sending events to |delegate| if the returned result is
264 // OPENED. Note that events to |delegate| may be sent from *any* 262 // OPENED. Note that events to |delegate| may be sent from *any*
265 // thread. |transaction_observer| must be initialized. 263 // thread. |transaction_observer| must be initialized.
266 DirOpenResult Open(const std::string& name, 264 DirOpenResult Open(const std::string& name,
267 DirectoryChangeDelegate* delegate, 265 DirectoryChangeDelegate* delegate,
268 const WeakHandle<TransactionObserver>& 266 const WeakHandle<TransactionObserver>&
269 transaction_observer); 267 transaction_observer);
270 268
271 int64 NextMetahandle(); 269 int64 NextMetahandle();
272 // Returns a negative integer unique to this client. 270 // Returns a negative integer unique to this client.
maniscalco 2015/05/14 15:54:20 This comment is now out of date.
stanisc 2015/05/14 21:21:55 Done.
273 syncable::Id NextId(); 271 syncable::Id NextId();
274 272
275 bool good() const { return NULL != kernel_; } 273 bool good() const { return NULL != kernel_; }
276 274
277 // The download progress is an opaque token provided by the sync server 275 // The download progress is an opaque token provided by the sync server
278 // to indicate the continuation state of the next GetUpdates operation. 276 // to indicate the continuation state of the next GetUpdates operation.
279 void GetDownloadProgress( 277 void GetDownloadProgress(
280 ModelType type, 278 ModelType type,
281 sync_pb::DataTypeProgressMarker* value_out) const; 279 sync_pb::DataTypeProgressMarker* value_out) const;
282 void GetDownloadProgressAsString( 280 void GetDownloadProgressAsString(
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 658
661 base::WeakPtrFactory<Directory> weak_ptr_factory_; 659 base::WeakPtrFactory<Directory> weak_ptr_factory_;
662 660
663 DISALLOW_COPY_AND_ASSIGN(Directory); 661 DISALLOW_COPY_AND_ASSIGN(Directory);
664 }; 662 };
665 663
666 } // namespace syncable 664 } // namespace syncable
667 } // namespace syncer 665 } // namespace syncer
668 666
669 #endif // SYNC_SYNCABLE_DIRECTORY_H_ 667 #endif // SYNC_SYNCABLE_DIRECTORY_H_
OLDNEW
« no previous file with comments | « no previous file | sync/syncable/directory.cc » ('j') | sync/syncable/directory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698