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

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

Issue 10916174: Implement a bag of chips for sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving persistence Created 8 years, 3 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 | Annotate | Revision Log
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_DIRECTORY_H_ 5 #ifndef SYNC_SYNCABLE_DIRECTORY_H_
6 #define SYNC_SYNCABLE_DIRECTORY_H_ 6 #define SYNC_SYNCABLE_DIRECTORY_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 sync_pb::DataTypeProgressMarker download_progress[MODEL_TYPE_COUNT]; 163 sync_pb::DataTypeProgressMarker download_progress[MODEL_TYPE_COUNT];
164 // true iff we ever reached the end of the changelog. 164 // true iff we ever reached the end of the changelog.
165 ModelTypeSet initial_sync_ended; 165 ModelTypeSet initial_sync_ended;
166 // The store birthday we were given by the server. Contents are opaque to 166 // The store birthday we were given by the server. Contents are opaque to
167 // the client. 167 // the client.
168 std::string store_birthday; 168 std::string store_birthday;
169 // The next local ID that has not been used with this cache-GUID. 169 // The next local ID that has not been used with this cache-GUID.
170 int64 next_id; 170 int64 next_id;
171 // The persisted notification state. 171 // The persisted notification state.
172 std::string notification_state; 172 std::string notification_state;
173 // The serialized bag of chips we were given by the server. Contents are
174 // opaque to the client. This is the serialization of a message of type
175 // ChipBag defined in sync.proto.
tim (not reviewing) 2012/09/11 17:57:20 This is free of NULL characters?
qsr (NOT THE RIGHT qsr) 2012/09/11 18:48:49 Added comment.
176 std::string bag_of_chips;
173 }; 177 };
174 178
175 // What the Directory needs on initialization to create itself and its Kernel. 179 // What the Directory needs on initialization to create itself and its Kernel.
176 // Filled by DirectoryBackingStore::Load. 180 // Filled by DirectoryBackingStore::Load.
177 struct KernelLoadInfo { 181 struct KernelLoadInfo {
178 PersistedKernelInfo kernel_info; 182 PersistedKernelInfo kernel_info;
179 std::string cache_guid; // Created on first initialization, never changes. 183 std::string cache_guid; // Created on first initialization, never changes.
180 int64 max_metahandle; // Computed (using sql MAX aggregate) on init. 184 int64 max_metahandle; // Computed (using sql MAX aggregate) on init.
181 KernelLoadInfo() : max_metahandle(0) { 185 KernelLoadInfo() : max_metahandle(0) {
182 } 186 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 void set_initial_sync_ended_for_type(ModelType type, bool value); 257 void set_initial_sync_ended_for_type(ModelType type, bool value);
254 258
255 const std::string& name() const { return kernel_->name; } 259 const std::string& name() const { return kernel_->name; }
256 260
257 // (Account) Store birthday is opaque to the client, so we keep it in the 261 // (Account) Store birthday is opaque to the client, so we keep it in the
258 // format it is in the proto buffer in case we switch to a binary birthday 262 // format it is in the proto buffer in case we switch to a binary birthday
259 // later. 263 // later.
260 std::string store_birthday() const; 264 std::string store_birthday() const;
261 void set_store_birthday(const std::string& store_birthday); 265 void set_store_birthday(const std::string& store_birthday);
262 266
267 // (Account) Bag of chip is an opaque state used by the server to track the
268 // client.
269 std::string bag_of_chips() const;
270 void set_bag_of_chips(const std::string& bag_of_chips);
271
263 std::string GetNotificationState() const; 272 std::string GetNotificationState() const;
264 void SetNotificationState(const std::string& notification_state); 273 void SetNotificationState(const std::string& notification_state);
265 274
266 // Unique to each account / client pair. 275 // Unique to each account / client pair.
267 std::string cache_guid() const; 276 std::string cache_guid() const;
268 277
269 // Returns a pointer to our Nigori node handler. 278 // Returns a pointer to our Nigori node handler.
270 NigoriHandler* GetNigoriHandler(); 279 NigoriHandler* GetNigoriHandler();
271 280
272 // Returns a pointer to our cryptographer. Does not transfer ownership. 281 // Returns a pointer to our cryptographer. Does not transfer ownership.
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 NigoriHandler* const nigori_handler_; 616 NigoriHandler* const nigori_handler_;
608 Cryptographer* const cryptographer_; 617 Cryptographer* const cryptographer_;
609 618
610 InvariantCheckLevel invariant_check_level_; 619 InvariantCheckLevel invariant_check_level_;
611 }; 620 };
612 621
613 } // namespace syncable 622 } // namespace syncable
614 } // namespace syncer 623 } // namespace syncer
615 624
616 #endif // SYNC_SYNCABLE_DIRECTORY_H_ 625 #endif // SYNC_SYNCABLE_DIRECTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698