OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 private: | 37 private: |
38 // Explicitly copyable and assignable for STL containers. | 38 // Explicitly copyable and assignable for STL containers. |
39 AckHandle(const std::string& state, base::Time timestamp); | 39 AckHandle(const std::string& state, base::Time timestamp); |
40 | 40 |
41 std::string state_; | 41 std::string state_; |
42 base::Time timestamp_; | 42 base::Time timestamp_; |
43 }; | 43 }; |
44 | 44 |
45 // Represents a local invalidation, and is roughly analogous to | 45 // Represents a local invalidation, and is roughly analogous to |
46 // invalidation::Invalidation. It contains a payload (which may be empty) and an | 46 // invalidation::Invalidation. It contains a version (which may be |
| 47 // kUnknownVersion), a payload (which may be empty) and an |
47 // associated ack handle that an InvalidationHandler implementation can use to | 48 // associated ack handle that an InvalidationHandler implementation can use to |
48 // acknowledge receipt of the invalidation. It does not embed the object ID, | 49 // acknowledge receipt of the invalidation. It does not embed the object ID, |
49 // since it is typically associated with it through ObjectIdInvalidationMap. | 50 // since it is typically associated with it through ObjectIdInvalidationMap. |
50 struct SYNC_EXPORT Invalidation { | 51 struct SYNC_EXPORT Invalidation { |
| 52 static const int64 kUnknownVersion; |
| 53 |
51 Invalidation(); | 54 Invalidation(); |
52 ~Invalidation(); | 55 ~Invalidation(); |
53 | 56 |
54 bool Equals(const Invalidation& other) const; | 57 bool Equals(const Invalidation& other) const; |
55 | 58 |
56 scoped_ptr<base::DictionaryValue> ToValue() const; | 59 scoped_ptr<base::DictionaryValue> ToValue() const; |
57 bool ResetFromValue(const base::DictionaryValue& value); | 60 bool ResetFromValue(const base::DictionaryValue& value); |
58 | 61 |
| 62 int64 version; |
59 std::string payload; | 63 std::string payload; |
60 AckHandle ack_handle; | 64 AckHandle ack_handle; |
61 }; | 65 }; |
62 | 66 |
63 } // namespace syncer | 67 } // namespace syncer |
64 | 68 |
65 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ | 69 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ |
OLD | NEW |