| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 // Wrappers to help us work with ids and protobuffers. | 5 // Wrappers to help us work with ids and protobuffers. |
| 6 | 6 |
| 7 #ifndef SYNC_ENGINE_SYNCPROTO_H_ | 7 #ifndef SYNC_ENGINE_SYNCPROTO_H_ |
| 8 #define SYNC_ENGINE_SYNCPROTO_H_ | 8 #define SYNC_ENGINE_SYNCPROTO_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 // Binary predicate helper to determine whether an Entity represents a folder | 54 // Binary predicate helper to determine whether an Entity represents a folder |
| 55 // or non-folder object. Use this instead of checking these properties | 55 // or non-folder object. Use this instead of checking these properties |
| 56 // directly, because the addition of bookmarks to the protobuf schema | 56 // directly, because the addition of bookmarks to the protobuf schema |
| 57 // makes the check slightly more tricky. | 57 // makes the check slightly more tricky. |
| 58 bool IsFolder() const { | 58 bool IsFolder() const { |
| 59 return ((has_folder() && folder()) || | 59 return ((has_folder() && folder()) || |
| 60 (has_bookmarkdata() && bookmarkdata().bookmark_folder())); | 60 (has_bookmarkdata() && bookmarkdata().bookmark_folder())); |
| 61 } | 61 } |
| 62 | 62 |
| 63 syncable::ModelType GetModelType() const { | 63 syncer::ModelType GetModelType() const { |
| 64 return syncable::GetModelType(*this); | 64 return syncer::GetModelType(*this); |
| 65 } | 65 } |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 class CommitResponse_EntryResponse | 68 class CommitResponse_EntryResponse |
| 69 : public IdWrapper<sync_pb::CommitResponse_EntryResponse> { | 69 : public IdWrapper<sync_pb::CommitResponse_EntryResponse> { |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 class ClientToServerMessage : public sync_pb::ClientToServerMessage { | 72 class ClientToServerMessage : public sync_pb::ClientToServerMessage { |
| 73 public: | 73 public: |
| 74 ClientToServerMessage() { | 74 ClientToServerMessage() { |
| 75 set_protocol_version(protocol_version()); | 75 set_protocol_version(protocol_version()); |
| 76 } | 76 } |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 typedef sync_pb::CommitMessage CommitMessage; | 79 typedef sync_pb::CommitMessage CommitMessage; |
| 80 typedef sync_pb::ClientToServerResponse ClientToServerResponse; | 80 typedef sync_pb::ClientToServerResponse ClientToServerResponse; |
| 81 typedef sync_pb::CommitResponse CommitResponse; | 81 typedef sync_pb::CommitResponse CommitResponse; |
| 82 typedef sync_pb::GetUpdatesResponse GetUpdatesResponse; | 82 typedef sync_pb::GetUpdatesResponse GetUpdatesResponse; |
| 83 typedef sync_pb::GetUpdatesMessage GetUpdatesMessage; | 83 typedef sync_pb::GetUpdatesMessage GetUpdatesMessage; |
| 84 | 84 |
| 85 } // namespace syncer | 85 } // namespace syncer |
| 86 | 86 |
| 87 #endif // SYNC_ENGINE_SYNCPROTO_H_ | 87 #endif // SYNC_ENGINE_SYNCPROTO_H_ |
| OLD | NEW |