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

Unified Diff: sync/engine/entity_tracker.h

Issue 442053002: sync: Add non-blocking type encryption (retry) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync_driver/non_blocking_data_type_controller_unittest.cc ('k') | sync/engine/entity_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/entity_tracker.h
diff --git a/sync/engine/entity_tracker.h b/sync/engine/entity_tracker.h
index db2d09bf3cf349841ecdb4102e5a30ebb234b043..e969ff97146fec5f791d2158e85e1de515186e35 100644
--- a/sync/engine/entity_tracker.h
+++ b/sync/engine/entity_tracker.h
@@ -8,8 +8,10 @@
#include <string>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "sync/base/sync_export.h"
+#include "sync/internal_api/public/non_blocking_sync_common.h"
#include "sync/protocol/sync.pb.h"
namespace syncer {
@@ -81,6 +83,20 @@ class SYNC_EXPORT EntityTracker {
// Handles receipt of an update from the server.
void ReceiveUpdate(int64 version);
+ // Handles the receipt of an pending update from the server.
+ //
+ // Returns true if the tracker decides this item is worth keeping. Returns
+ // false if the item is discarded, which could happen if the version number
+ // is out of date.
+ bool ReceivePendingUpdate(const UpdateResponseData& data);
+
+ // Functions to fetch the latest pending update.
+ bool HasPendingUpdate() const;
+ UpdateResponseData GetPendingUpdate() const;
+
+ // Clears the pending update. Allows us to resume regular commit behavior.
+ void ClearPendingUpdate();
+
private:
// Initializes received update state. Does not initialize state related to
// pending commits and sets |is_commit_pending_| to false.
@@ -146,6 +162,11 @@ class SYNC_EXPORT EntityTracker {
bool deleted_;
sync_pb::EntitySpecifics specifics_;
+ // An update for this item which can't be applied right now. The presence of
+ // an pending update prevents commits. As of this writing, the only source
+ // of pending updates is updates we can't decrypt right now.
+ scoped_ptr<UpdateResponseData> pending_update_;
+
DISALLOW_COPY_AND_ASSIGN(EntityTracker);
};
« no previous file with comments | « components/sync_driver/non_blocking_data_type_controller_unittest.cc ('k') | sync/engine/entity_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698