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 #include "sync/internal_api/public/base/invalidation.h" | 5 #include "sync/internal_api/public/base/invalidation.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "sync/notifier/ack_handler.h" | 13 #include "sync/internal_api/public/base/ack_handler.h" |
14 #include "sync/notifier/invalidation_util.h" | 14 #include "sync/internal_api/public/base/invalidation_util.h" |
15 | 15 |
16 namespace syncer { | 16 namespace syncer { |
17 | 17 |
18 namespace { | 18 namespace { |
19 const char kObjectIdKey[] = "objectId"; | 19 const char kObjectIdKey[] = "objectId"; |
20 const char kIsUnknownVersionKey[] = "isUnknownVersion"; | 20 const char kIsUnknownVersionKey[] = "isUnknownVersion"; |
21 const char kVersionKey[] = "version"; | 21 const char kVersionKey[] = "version"; |
22 const char kPayloadKey[] = "payload"; | 22 const char kPayloadKey[] = "payload"; |
23 const int64 kInvalidVersion = -1; | 23 const int64 kInvalidVersion = -1; |
24 } | 24 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 id, | 90 id, |
91 false, | 91 false, |
92 version, | 92 version, |
93 payload, | 93 payload, |
94 AckHandle::CreateUnique())); | 94 AckHandle::CreateUnique())); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 Invalidation::~Invalidation() {} | 98 Invalidation::~Invalidation() {} |
99 | 99 |
| 100 Invalidation& Invalidation::operator=(const Invalidation& other) { |
| 101 id_ = other.id_; |
| 102 is_unknown_version_ = other.is_unknown_version_; |
| 103 version_ = other.version_; |
| 104 payload_ = other.payload_; |
| 105 ack_handle_ = other.ack_handle_; |
| 106 ack_handler_ = other.ack_handler_; |
| 107 return *this; |
| 108 } |
| 109 |
100 invalidation::ObjectId Invalidation::object_id() const { | 110 invalidation::ObjectId Invalidation::object_id() const { |
101 return id_; | 111 return id_; |
102 } | 112 } |
103 | 113 |
104 bool Invalidation::is_unknown_version() const { | 114 bool Invalidation::is_unknown_version() const { |
105 return is_unknown_version_; | 115 return is_unknown_version_; |
106 } | 116 } |
107 | 117 |
108 int64 Invalidation::version() const { | 118 int64 Invalidation::version() const { |
109 DCHECK(!is_unknown_version_); | 119 DCHECK(!is_unknown_version_); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 int64 version, | 189 int64 version, |
180 const std::string& payload, | 190 const std::string& payload, |
181 AckHandle ack_handle) | 191 AckHandle ack_handle) |
182 : id_(id), | 192 : id_(id), |
183 is_unknown_version_(is_unknown_version), | 193 is_unknown_version_(is_unknown_version), |
184 version_(version), | 194 version_(version), |
185 payload_(payload), | 195 payload_(payload), |
186 ack_handle_(ack_handle) {} | 196 ack_handle_(ack_handle) {} |
187 | 197 |
188 } // namespace syncer | 198 } // namespace syncer |
OLD | NEW |