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 14 matching lines...) Expand all Loading... | |
25 static AckHandle CreateUnique(); | 25 static AckHandle CreateUnique(); |
26 static AckHandle InvalidAckHandle(); | 26 static AckHandle InvalidAckHandle(); |
27 | 27 |
28 bool Equals(const AckHandle& other) const; | 28 bool Equals(const AckHandle& other) const; |
29 | 29 |
30 scoped_ptr<base::DictionaryValue> ToValue() const; | 30 scoped_ptr<base::DictionaryValue> ToValue() const; |
31 bool ResetFromValue(const base::DictionaryValue& value); | 31 bool ResetFromValue(const base::DictionaryValue& value); |
32 | 32 |
33 bool IsValid() const; | 33 bool IsValid() const; |
34 | 34 |
35 virtual ~AckHandle(); | |
akalin
2012/12/27 19:48:52
hunh, why is this necessary? Nothing inherits fro
Raghu Simha
2013/01/02 06:49:24
You're right that the destructors don't have to be
| |
36 | |
35 private: | 37 private: |
36 // Explicitly copyable and assignable for STL containers. | 38 // Explicitly copyable and assignable for STL containers. |
37 AckHandle(const std::string& state, base::Time timestamp); | 39 AckHandle(const std::string& state, base::Time timestamp); |
38 | 40 |
39 std::string state_; | 41 std::string state_; |
40 base::Time timestamp_; | 42 base::Time timestamp_; |
41 }; | 43 }; |
42 | 44 |
43 // Represents a local invalidation, and is roughly analogous to | 45 // Represents a local invalidation, and is roughly analogous to |
44 // invalidation::Invalidation. It contains a payload (which may be empty) and an | 46 // invalidation::Invalidation. It contains a payload (which may be empty) and an |
45 // associated ack handle that an InvalidationHandler implementation can use to | 47 // associated ack handle that an InvalidationHandler implementation can use to |
46 // acknowledge receipt of the invalidation. It does not embed the object ID, | 48 // acknowledge receipt of the invalidation. It does not embed the object ID, |
47 // since it is typically associated with it through ObjectIdInvalidationMap. | 49 // since it is typically associated with it through ObjectIdInvalidationMap. |
48 struct Invalidation { | 50 struct SYNC_EXPORT Invalidation { |
49 Invalidation(); | 51 Invalidation(); |
52 virtual ~Invalidation(); | |
akalin
2012/12/27 19:48:52
here, too
Raghu Simha
2013/01/02 06:49:24
Made this non-virtual too.
| |
50 | 53 |
51 bool Equals(const Invalidation& other) const; | 54 bool Equals(const Invalidation& other) const; |
52 | 55 |
53 scoped_ptr<base::DictionaryValue> ToValue() const; | 56 scoped_ptr<base::DictionaryValue> ToValue() const; |
54 bool ResetFromValue(const base::DictionaryValue& value); | 57 bool ResetFromValue(const base::DictionaryValue& value); |
55 | 58 |
56 std::string payload; | 59 std::string payload; |
57 AckHandle ack_handle; | 60 AckHandle ack_handle; |
58 }; | 61 }; |
59 | 62 |
60 } // namespace syncer | 63 } // namespace syncer |
61 | 64 |
62 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ | 65 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ |
OLD | NEW |