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

Unified Diff: sync/engine/syncproto.h

Issue 10735041: Remove syncproto.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address most comments Created 8 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 | « sync/engine/syncer_util.cc ('k') | sync/engine/syncproto_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncproto.h
diff --git a/sync/engine/syncproto.h b/sync/engine/syncproto.h
deleted file mode 100644
index 282255cb6cc81543b6c51fc7fd94fa716a719604..0000000000000000000000000000000000000000
--- a/sync/engine/syncproto.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Wrappers to help us work with ids and protobuffers.
-
-#ifndef SYNC_ENGINE_SYNCPROTO_H_
-#define SYNC_ENGINE_SYNCPROTO_H_
-
-#include "sync/internal_api/public/base/model_type.h"
-#include "sync/protocol/sync.pb.h"
-#include "sync/syncable/syncable_id.h"
-
-namespace syncer {
-
-template<class Base>
-class IdWrapper : public Base {
- public:
- IdWrapper() {}
- explicit IdWrapper(const Base& other) : Base(other) {
- }
- syncable::Id id() const {
- return syncable::Id::CreateFromServerId(Base::id_string());
- }
- void set_id(const syncable::Id& id) {
- Base::set_id_string(id.GetServerId());
- }
-};
-
-// These wrapper classes contain no data, so their super classes can be cast to
-// them directly.
-class SyncEntity : public IdWrapper<sync_pb::SyncEntity> {
- public:
- SyncEntity() {}
- explicit SyncEntity(const sync_pb::SyncEntity& other)
- : IdWrapper<sync_pb::SyncEntity>(other) {
- }
-
- void set_parent_id(const syncable::Id& id) {
- set_parent_id_string(id.GetServerId());
- }
- syncable::Id parent_id() const {
- return syncable::Id::CreateFromServerId(parent_id_string());
- }
- void set_old_parent_id(const syncable::Id& id) {
- IdWrapper<sync_pb::SyncEntity>::set_old_parent_id(
- id.GetServerId());
- }
- syncable::Id old_parent_id() const {
- return syncable::Id::CreateFromServerId(
- sync_pb::SyncEntity::old_parent_id());
- }
- // Binary predicate helper to determine whether an Entity represents a folder
- // or non-folder object. Use this instead of checking these properties
- // directly, because the addition of bookmarks to the protobuf schema
- // makes the check slightly more tricky.
- bool IsFolder() const {
- return ((has_folder() && folder()) ||
- (has_bookmarkdata() && bookmarkdata().bookmark_folder()));
- }
-
- syncer::ModelType GetModelType() const {
- return syncer::GetModelType(*this);
- }
-};
-
-class CommitResponse_EntryResponse
- : public IdWrapper<sync_pb::CommitResponse_EntryResponse> {
-};
-
-class ClientToServerMessage : public sync_pb::ClientToServerMessage {
- public:
- ClientToServerMessage() {
- set_protocol_version(protocol_version());
- }
-};
-
-typedef sync_pb::CommitMessage CommitMessage;
-typedef sync_pb::ClientToServerResponse ClientToServerResponse;
-typedef sync_pb::CommitResponse CommitResponse;
-typedef sync_pb::GetUpdatesResponse GetUpdatesResponse;
-typedef sync_pb::GetUpdatesMessage GetUpdatesMessage;
-
-} // namespace syncer
-
-#endif // SYNC_ENGINE_SYNCPROTO_H_
« no previous file with comments | « sync/engine/syncer_util.cc ('k') | sync/engine/syncproto_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698