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

Side by Side Diff: sync/syncable/syncable_proto_util.cc

Issue 10735041: Remove syncproto.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve DCHECKing, fix tests 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sync/syncable/syncable_proto_util.h"
6
7 #include "sync/protocol/sync.pb.h"
8
9 namespace syncer {
10
11 syncable::Id SyncableIdFromProto(const std::string& proto_string) {
12 return syncable::Id::CreateFromServerId(proto_string);
13 }
14
15 std::string SyncableIdToProto(const syncable::Id& syncable_id) {
16 return syncable_id.GetServerId();
17 }
18
19 bool IsFolder(const sync_pb::SyncEntity& entity) {
20 return ((entity.has_folder() && entity.folder()) ||
akalin 2012/07/11 01:42:22 is has_folder() necessary?
rlarocque 2012/07/11 19:22:16 Probably not. I think has_foo() should be conside
akalin 2012/07/11 23:10:40 Good point. Add TODO?
rlarocque 2012/07/11 23:45:36 Done.
21 (entity.has_bookmarkdata() &&
akalin 2012/07/11 01:42:22 is has_bookmarkdata() necessary?
22 entity.bookmarkdata().bookmark_folder()));
23 }
24
25 bool IsRoot(const sync_pb::SyncEntity& entity) {
26 return SyncableIdFromProto(entity.id_string()).IsRoot();
27 }
28
29 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698