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

Unified Diff: sync/internal_api/public/base/invalidation_state.h

Issue 10911084: Implement Invalidator::Acknowledge (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 side-by-side diff with in-line comments
Download patch
Index: sync/internal_api/public/base/invalidation_state.h
diff --git a/sync/internal_api/public/base/invalidation_state.h b/sync/internal_api/public/base/invalidation_state.h
index 8c811afda6684e8ccea314011ce5cb5fb7f46898..b2a57027c355d4ce779e0495b497e8b3989ad955 100644
--- a/sync/internal_api/public/base/invalidation_state.h
+++ b/sync/internal_api/public/base/invalidation_state.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
namespace base {
@@ -16,28 +17,34 @@ class Value;
namespace syncer {
-// Opaque class that represents an ack handle.
-// TODO(dcheng): This is just a refactoring change, so the class is empty for
-// the moment. It will be filled once we start implementing 'reminders'.
+// Opaque class that represents an ack handle. We don't reuse the Tango ack
+// handles to avoid unnecessary dependencies.
class AckHandle {
public:
+ static AckHandle CreateUnique();
+ static AckHandle InvalidAckHandle();
+
bool Equals(const AckHandle& other) const;
scoped_ptr<base::Value> ToValue() const;
-
bool ResetFromValue(const base::Value& value);
+
+ private:
+ AckHandle(const std::string& state);
+
+ std::string state_;
};
struct InvalidationState {
- std::string payload;
- AckHandle ack_handle;
+ InvalidationState();
bool Equals(const InvalidationState& other) const;
- // Caller owns the returned DictionaryValue.
scoped_ptr<base::DictionaryValue> ToValue() const;
-
bool ResetFromValue(const base::DictionaryValue& value);
+
+ std::string payload;
+ AckHandle ack_handle;
};
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698