OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/api/entity_data.h" | 5 #include "sync/api/entity_data.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace syncer_v2 { | 9 namespace syncer_v2 { |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 std::swap(creation_time, other->creation_time); | 21 std::swap(creation_time, other->creation_time); |
22 std::swap(modification_time, other->modification_time); | 22 std::swap(modification_time, other->modification_time); |
23 | 23 |
24 parent_id.swap(other->parent_id); | 24 parent_id.swap(other->parent_id); |
25 unique_position.Swap(&other->unique_position); | 25 unique_position.Swap(&other->unique_position); |
26 } | 26 } |
27 | 27 |
28 EntityDataPtr EntityData::Pass() { | 28 EntityDataPtr EntityData::Pass() { |
29 EntityDataPtr target; | 29 EntityDataPtr target; |
30 target.swap_value(this); | 30 target.swap_value(this); |
31 return target.Pass(); | 31 return target; |
32 } | 32 } |
33 | 33 |
34 void EntityDataTraits::SwapValue(EntityData* dest, EntityData* src) { | 34 void EntityDataTraits::SwapValue(EntityData* dest, EntityData* src) { |
35 dest->Swap(src); | 35 dest->Swap(src); |
36 } | 36 } |
37 | 37 |
38 bool EntityDataTraits::HasValue(const EntityData& value) { | 38 bool EntityDataTraits::HasValue(const EntityData& value) { |
39 return !value.client_tag_hash.empty(); | 39 return !value.client_tag_hash.empty(); |
40 } | 40 } |
41 | 41 |
42 const EntityData& EntityDataTraits::DefaultValue() { | 42 const EntityData& EntityDataTraits::DefaultValue() { |
43 CR_DEFINE_STATIC_LOCAL(EntityData, default_instance, ()); | 43 CR_DEFINE_STATIC_LOCAL(EntityData, default_instance, ()); |
44 return default_instance; | 44 return default_instance; |
45 } | 45 } |
46 | 46 |
47 } // namespace syncer_v2 | 47 } // namespace syncer_v2 |
OLD | NEW |