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

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: 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.
Nicolas Zea 2012/09/07 18:38:43 Mention the ChipBag message defined in sync.proto
qsr 2012/09/10 08:12:37 Done.
175 std::string bag_of_chips;
173 }; 176 };
174 177
175 // What the Directory needs on initialization to create itself and its Kernel. 178 // What the Directory needs on initialization to create itself and its Kernel.
176 // Filled by DirectoryBackingStore::Load. 179 // Filled by DirectoryBackingStore::Load.
177 struct KernelLoadInfo { 180 struct KernelLoadInfo {
178 PersistedKernelInfo kernel_info; 181 PersistedKernelInfo kernel_info;
179 std::string cache_guid; // Created on first initialization, never changes. 182 std::string cache_guid; // Created on first initialization, never changes.
180 int64 max_metahandle; // Computed (using sql MAX aggregate) on init. 183 int64 max_metahandle; // Computed (using sql MAX aggregate) on init.
181 KernelLoadInfo() : max_metahandle(0) { 184 KernelLoadInfo() : max_metahandle(0) {
182 } 185 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 void set_initial_sync_ended_for_type(ModelType type, bool value); 256 void set_initial_sync_ended_for_type(ModelType type, bool value);
254 257
255 const std::string& name() const { return kernel_->name; } 258 const std::string& name() const { return kernel_->name; }
256 259
257 // (Account) Store birthday is opaque to the client, so we keep it in the 260 // (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 261 // format it is in the proto buffer in case we switch to a binary birthday
259 // later. 262 // later.
260 std::string store_birthday() const; 263 std::string store_birthday() const;
261 void set_store_birthday(const std::string& store_birthday); 264 void set_store_birthday(const std::string& store_birthday);
262 265
266 // (Account) Bag of chip is an opaque state used by the server to track the
267 // client.
268 std::string bag_of_chips() const;
269 void set_bag_of_chips(const std::string& bag_of_chips);
270
263 std::string GetNotificationState() const; 271 std::string GetNotificationState() const;
264 void SetNotificationState(const std::string& notification_state); 272 void SetNotificationState(const std::string& notification_state);
265 273
266 // Unique to each account / client pair. 274 // Unique to each account / client pair.
267 std::string cache_guid() const; 275 std::string cache_guid() const;
268 276
269 // Returns a pointer to our Nigori node handler. 277 // Returns a pointer to our Nigori node handler.
270 NigoriHandler* GetNigoriHandler(); 278 NigoriHandler* GetNigoriHandler();
271 279
272 // Returns a pointer to our cryptographer. Does not transfer ownership. 280 // 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_; 615 NigoriHandler* const nigori_handler_;
608 Cryptographer* const cryptographer_; 616 Cryptographer* const cryptographer_;
609 617
610 InvariantCheckLevel invariant_check_level_; 618 InvariantCheckLevel invariant_check_level_;
611 }; 619 };
612 620
613 } // namespace syncable 621 } // namespace syncable
614 } // namespace syncer 622 } // namespace syncer
615 623
616 #endif // SYNC_SYNCABLE_DIRECTORY_H_ 624 #endif // SYNC_SYNCABLE_DIRECTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698