| 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 17 matching lines...) Expand all Loading... |
| 28 // Factory functions. | 28 // Factory functions. |
| 29 static Invalidation Init( | 29 static Invalidation Init( |
| 30 const invalidation::ObjectId& id, | 30 const invalidation::ObjectId& id, |
| 31 int64 version, | 31 int64 version, |
| 32 const std::string& payload); | 32 const std::string& payload); |
| 33 static Invalidation InitUnknownVersion(const invalidation::ObjectId& id); | 33 static Invalidation InitUnknownVersion(const invalidation::ObjectId& id); |
| 34 static Invalidation InitFromDroppedInvalidation(const Invalidation& dropped); | 34 static Invalidation InitFromDroppedInvalidation(const Invalidation& dropped); |
| 35 static scoped_ptr<Invalidation> InitFromValue( | 35 static scoped_ptr<Invalidation> InitFromValue( |
| 36 const base::DictionaryValue& value); | 36 const base::DictionaryValue& value); |
| 37 | 37 |
| 38 ~Invalidation(); |
| 39 |
| 40 // We define the copy and assignment operators explicitly for now, even |
| 41 // though the implicit definitions would be good enough for our purposes. |
| 42 // This is to work around some linker issues in the Windows build. See |
| 43 // http://crbug.com/394549. |
| 38 Invalidation(const Invalidation& other); | 44 Invalidation(const Invalidation& other); |
| 39 ~Invalidation(); | 45 Invalidation& operator=(const Invalidation& other); |
| 40 | 46 |
| 41 // Compares two invalidations. The comparison ignores ack-tracking state. | 47 // Compares two invalidations. The comparison ignores ack-tracking state. |
| 42 bool Equals(const Invalidation& other) const; | 48 bool Equals(const Invalidation& other) const; |
| 43 | 49 |
| 44 invalidation::ObjectId object_id() const; | 50 invalidation::ObjectId object_id() const; |
| 45 bool is_unknown_version() const; | 51 bool is_unknown_version() const; |
| 46 | 52 |
| 47 // Safe to call only if is_unknown_version() returns false. | 53 // Safe to call only if is_unknown_version() returns false. |
| 48 int64 version() const; | 54 int64 version() const; |
| 49 | 55 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 std::string payload_; | 120 std::string payload_; |
| 115 | 121 |
| 116 // A locally generated unique ID used to manage local acknowledgements. | 122 // A locally generated unique ID used to manage local acknowledgements. |
| 117 AckHandle ack_handle_; | 123 AckHandle ack_handle_; |
| 118 syncer::WeakHandle<AckHandler> ack_handler_; | 124 syncer::WeakHandle<AckHandler> ack_handler_; |
| 119 }; | 125 }; |
| 120 | 126 |
| 121 } // namespace syncer | 127 } // namespace syncer |
| 122 | 128 |
| 123 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ | 129 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ |
| OLD | NEW |