Index: sync/internal_api/public/base/invalidation.h |
diff --git a/sync/internal_api/public/base/invalidation.h b/sync/internal_api/public/base/invalidation.h |
index fc8c361c65086da59befa034ddbfe1c72a7f1764..a75768029cb50aa32cdb7c1a7f8cf1f17f8da274 100644 |
--- a/sync/internal_api/public/base/invalidation.h |
+++ b/sync/internal_api/public/base/invalidation.h |
@@ -7,6 +7,7 @@ |
#include <string> |
+#include "base/basictypes.h" |
#include "base/memory/scoped_ptr.h" |
namespace base { |
@@ -16,16 +17,22 @@ 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 |
akalin
2012/10/19 13:27:16
Tango -> invalidation::
dcheng
2012/10/19 19:38:11
Done.
|
+// 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); |
akalin
2012/10/19 13:27:16
comment that copy constructor and assignment opera
dcheng
2012/10/19 19:38:11
Done. Unless I'm missing something, no default cto
|
+ |
+ private: |
+ AckHandle(const std::string& state); |
+ |
+ std::string state_; |
}; |
// Represents a local invalidation, and is roughly analogous to |
@@ -34,15 +41,15 @@ class AckHandle { |
// acknowledge receipt of the invalidation. It does not embed the object ID, |
// since it is typically associated with it through ObjectIdInvalidationMap. |
struct Invalidation { |
- std::string payload; |
- AckHandle ack_handle; |
+ Invalidation(); |
bool Equals(const Invalidation& 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 |