| 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 #ifndef SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 5 #ifndef SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
| 6 #define SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 6 #define SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 static const std::string& NameFromSyncEntity( | 71 static const std::string& NameFromSyncEntity( |
| 72 const sync_pb::SyncEntity& entry); | 72 const sync_pb::SyncEntity& entry); |
| 73 | 73 |
| 74 // Extract the name field from a commit entry response. | 74 // Extract the name field from a commit entry response. |
| 75 static const std::string& NameFromCommitEntryResponse( | 75 static const std::string& NameFromCommitEntryResponse( |
| 76 const CommitResponse_EntryResponse& entry); | 76 const CommitResponse_EntryResponse& entry); |
| 77 | 77 |
| 78 // EntitySpecifics is used as a filter for the GetUpdates message to tell | 78 // EntitySpecifics is used as a filter for the GetUpdates message to tell |
| 79 // the server which datatypes to send back. This adds a datatype so that | 79 // the server which datatypes to send back. This adds a datatype so that |
| 80 // it's included in the filter. | 80 // it's included in the filter. |
| 81 static void AddToEntitySpecificDatatypesFilter(syncable::ModelType datatype, | 81 static void AddToEntitySpecificDatatypesFilter(syncer::ModelType datatype, |
| 82 sync_pb::EntitySpecifics* filter); | 82 sync_pb::EntitySpecifics* filter); |
| 83 | 83 |
| 84 // Get a debug string representation of the client to server response. | 84 // Get a debug string representation of the client to server response. |
| 85 static std::string ClientToServerResponseDebugString( | 85 static std::string ClientToServerResponseDebugString( |
| 86 const sync_pb::ClientToServerResponse& response); | 86 const sync_pb::ClientToServerResponse& response); |
| 87 | 87 |
| 88 // Get update contents as a string. Intended for logging, and intended | 88 // Get update contents as a string. Intended for logging, and intended |
| 89 // to have a smaller footprint than the protobuf's built-in pretty printer. | 89 // to have a smaller footprint than the protobuf's built-in pretty printer. |
| 90 static std::string SyncEntityDebugString(const sync_pb::SyncEntity& entry); | 90 static std::string SyncEntityDebugString(const sync_pb::SyncEntity& entry); |
| 91 | 91 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); | 131 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); |
| 132 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingNoDatatypes); | 132 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingNoDatatypes); |
| 133 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingWithDatatypes); | 133 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingWithDatatypes); |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); | 135 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace syncer | 138 } // namespace syncer |
| 139 | 139 |
| 140 #endif // SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 140 #endif // SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
| OLD | NEW |