OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "components/sync/core/base_node.h" | 5 #include "components/sync/core/base_node.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <stack> | 9 #include <stack> |
10 | 10 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 const sync_pb::NigoriSpecifics& BaseNode::GetNigoriSpecifics() const { | 239 const sync_pb::NigoriSpecifics& BaseNode::GetNigoriSpecifics() const { |
240 DCHECK_EQ(GetModelType(), NIGORI); | 240 DCHECK_EQ(GetModelType(), NIGORI); |
241 return GetEntitySpecifics().nigori(); | 241 return GetEntitySpecifics().nigori(); |
242 } | 242 } |
243 | 243 |
244 const sync_pb::PasswordSpecificsData& BaseNode::GetPasswordSpecifics() const { | 244 const sync_pb::PasswordSpecificsData& BaseNode::GetPasswordSpecifics() const { |
245 DCHECK_EQ(GetModelType(), PASSWORDS); | 245 DCHECK_EQ(GetModelType(), PASSWORDS); |
246 return *password_data_; | 246 return *password_data_; |
247 } | 247 } |
248 | 248 |
| 249 const sync_pb::PasswordSpecificsMetadata& |
| 250 BaseNode::GetPasswordSpecificsMetadata() const { |
| 251 DCHECK_EQ(GetModelType(), PASSWORDS); |
| 252 return GetEntitySpecifics().password().unencrypted_metadata(); |
| 253 } |
| 254 |
249 const sync_pb::TypedUrlSpecifics& BaseNode::GetTypedUrlSpecifics() const { | 255 const sync_pb::TypedUrlSpecifics& BaseNode::GetTypedUrlSpecifics() const { |
250 DCHECK_EQ(GetModelType(), TYPED_URLS); | 256 DCHECK_EQ(GetModelType(), TYPED_URLS); |
251 return GetEntitySpecifics().typed_url(); | 257 return GetEntitySpecifics().typed_url(); |
252 } | 258 } |
253 | 259 |
254 const sync_pb::ExperimentsSpecifics& BaseNode::GetExperimentsSpecifics() const { | 260 const sync_pb::ExperimentsSpecifics& BaseNode::GetExperimentsSpecifics() const { |
255 DCHECK_EQ(GetModelType(), EXPERIMENTS); | 261 DCHECK_EQ(GetModelType(), EXPERIMENTS); |
256 return GetEntitySpecifics().experiments(); | 262 return GetEntitySpecifics().experiments(); |
257 } | 263 } |
258 | 264 |
(...skipping 19 matching lines...) Expand all Loading... |
278 const sync_pb::EntitySpecifics& specifics) { | 284 const sync_pb::EntitySpecifics& specifics) { |
279 ModelType type = GetModelTypeFromSpecifics(specifics); | 285 ModelType type = GetModelTypeFromSpecifics(specifics); |
280 DCHECK_NE(UNSPECIFIED, type); | 286 DCHECK_NE(UNSPECIFIED, type); |
281 if (GetModelType() != UNSPECIFIED) { | 287 if (GetModelType() != UNSPECIFIED) { |
282 DCHECK_EQ(GetModelType(), type); | 288 DCHECK_EQ(GetModelType(), type); |
283 } | 289 } |
284 unencrypted_data_.CopyFrom(specifics); | 290 unencrypted_data_.CopyFrom(specifics); |
285 } | 291 } |
286 | 292 |
287 } // namespace syncer | 293 } // namespace syncer |
OLD | NEW |