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

Unified Diff: components/sync/api/sync_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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/api/sync_data.h ('k') | components/sync/api/sync_data_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/api/sync_data.cc
diff --git a/sync/api/sync_data.cc b/components/sync/api/sync_data.cc
similarity index 87%
rename from sync/api/sync_data.cc
rename to components/sync/api/sync_data.cc
index 98c332459c06ca68fe3cefb5130bab13a7088b53..f207f38775610ae5fe65c3d5661f979f8816c4a4 100644
--- a/sync/api/sync_data.cc
+++ b/components/sync/api/sync_data.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/api/sync_data.h"
+#include "components/sync/api/sync_data.h"
#include <stdint.h>
@@ -12,11 +12,11 @@
#include "base/json/json_writer.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
-#include "sync/internal_api/public/attachments/attachment_service_proxy.h"
-#include "sync/internal_api/public/base/model_type.h"
-#include "sync/internal_api/public/base_node.h"
-#include "sync/protocol/proto_value_conversions.h"
-#include "sync/protocol/sync.pb.h"
+#include "components/sync/base/model_type.h"
+#include "components/sync/core/attachments/attachment_service_proxy.h"
+#include "components/sync/core/base_node.h"
+#include "components/sync/protocol/proto_value_conversions.h"
+#include "components/sync/protocol/sync.pb.h"
namespace {
@@ -93,8 +93,8 @@ SyncData SyncData::CreateLocalData(const std::string& sync_tag,
const std::string& non_unique_title,
const sync_pb::EntitySpecifics& specifics) {
syncer::AttachmentIdList attachment_ids;
- return CreateLocalDataWithAttachments(
- sync_tag, non_unique_title, specifics, attachment_ids);
+ return CreateLocalDataWithAttachments(sync_tag, non_unique_title, specifics,
+ attachment_ids);
}
// Static.
@@ -108,14 +108,10 @@ SyncData SyncData::CreateLocalDataWithAttachments(
entity.set_client_defined_unique_tag(sync_tag);
entity.set_non_unique_name(non_unique_title);
entity.mutable_specifics()->CopyFrom(specifics);
- std::transform(attachment_ids.begin(),
- attachment_ids.end(),
+ std::transform(attachment_ids.begin(), attachment_ids.end(),
RepeatedFieldBackInserter(entity.mutable_attachment_id()),
IdToProto);
- return SyncData(kInvalidId,
- &entity,
- base::Time(),
- AttachmentServiceProxy());
+ return SyncData(kInvalidId, &entity, base::Time(), AttachmentServiceProxy());
}
// Static.
@@ -130,14 +126,15 @@ SyncData SyncData::CreateRemoteData(
sync_pb::SyncEntity entity;
entity.mutable_specifics()->CopyFrom(specifics);
entity.set_client_defined_unique_tag(client_tag_hash);
- std::transform(attachment_ids.begin(),
- attachment_ids.end(),
+ std::transform(attachment_ids.begin(), attachment_ids.end(),
RepeatedFieldBackInserter(entity.mutable_attachment_id()),
IdToProto);
return SyncData(id, &entity, modification_time, attachment_service);
}
-bool SyncData::IsValid() const { return is_valid_; }
+bool SyncData::IsValid() const {
+ return is_valid_;
+}
const sync_pb::EntitySpecifics& SyncData::GetSpecifics() const {
return immutable_entity_.Get().specifics();
@@ -153,7 +150,9 @@ const std::string& SyncData::GetTitle() const {
return immutable_entity_.Get().non_unique_name();
}
-bool SyncData::IsLocal() const { return id_ == kInvalidId; }
+bool SyncData::IsLocal() const {
+ return id_ == kInvalidId;
+}
std::string SyncData::ToString() const {
if (!IsValid())
@@ -185,10 +184,8 @@ void PrintTo(const SyncData& sync_data, std::ostream* os) {
AttachmentIdList SyncData::GetAttachmentIds() const {
AttachmentIdList result;
const sync_pb::SyncEntity& entity = immutable_entity_.Get();
- std::transform(entity.attachment_id().begin(),
- entity.attachment_id().end(),
- std::back_inserter(result),
- ProtoToId);
+ std::transform(entity.attachment_id().begin(), entity.attachment_id().end(),
+ std::back_inserter(result), ProtoToId);
return result;
}
« no previous file with comments | « components/sync/api/sync_data.h ('k') | components/sync/api/sync_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698