Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: sync/api/entity_data.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sync/api/entity_data.h ('k') | sync/api/entity_data_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sync/api/entity_data.h"
6
7 #include <algorithm>
8
9 #include "base/logging.h"
10
11 namespace syncer_v2 {
12
13 EntityData::EntityData() {}
14 EntityData::~EntityData() {}
15
16 void EntityData::Swap(EntityData* other) {
17 id.swap(other->id);
18 client_tag_hash.swap(other->client_tag_hash);
19 non_unique_name.swap(other->non_unique_name);
20
21 specifics.Swap(&other->specifics);
22
23 std::swap(creation_time, other->creation_time);
24 std::swap(modification_time, other->modification_time);
25
26 parent_id.swap(other->parent_id);
27 unique_position.Swap(&other->unique_position);
28 }
29
30 EntityDataPtr EntityData::PassToPtr() {
31 EntityDataPtr target;
32 target.swap_value(this);
33 return target;
34 }
35
36 void EntityDataTraits::SwapValue(EntityData* dest, EntityData* src) {
37 dest->Swap(src);
38 }
39
40 bool EntityDataTraits::HasValue(const EntityData& value) {
41 return !value.client_tag_hash.empty();
42 }
43
44 const EntityData& EntityDataTraits::DefaultValue() {
45 CR_DEFINE_STATIC_LOCAL(EntityData, default_instance, ());
46 return default_instance;
47 }
48
49 } // namespace syncer_v2
OLDNEW
« no previous file with comments | « sync/api/entity_data.h ('k') | sync/api/entity_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698