| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Keep this file in sync with the .proto files in this directory. | 5 // Keep this file in sync with the .proto files in this directory. |
| 6 | 6 |
| 7 #ifndef COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 7 #ifndef COMPONENTS_SYNC_PROTOCOL_PROTO_OLD_VALUE_CONVERSIONS_H_ |
| 8 #define COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 8 #define COMPONENTS_SYNC_PROTOCOL_PROTO_OLD_VALUE_CONVERSIONS_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class DictionaryValue; | 13 class DictionaryValue; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace sync_pb { | 16 namespace sync_pb { |
| 17 class AppListSpecifics; | 17 class AppListSpecifics; |
| 18 class AppNotification; | 18 class AppNotification; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Utility functions to convert sync protocol buffers to dictionaries. | 87 // Utility functions to convert sync protocol buffers to dictionaries. |
| 88 // Each protocol field is mapped to a key of the same name. Repeated | 88 // Each protocol field is mapped to a key of the same name. Repeated |
| 89 // fields are mapped to array values and sub-messages are mapped to | 89 // fields are mapped to array values and sub-messages are mapped to |
| 90 // sub-dictionary values. | 90 // sub-dictionary values. |
| 91 // | 91 // |
| 92 // TODO(akalin): Add has_* information. | 92 // TODO(akalin): Add has_* information. |
| 93 // | 93 // |
| 94 // TODO(akalin): Improve enum support. | 94 // TODO(akalin): Improve enum support. |
| 95 | 95 |
| 96 namespace syncer { | 96 namespace syncer { |
| 97 namespace old { |
| 97 | 98 |
| 98 // Ownership of all returned DictionaryValues are transferred to the | 99 // Ownership of all returned DictionaryValues are transferred to the |
| 99 // caller. | 100 // caller. |
| 100 | 101 |
| 101 // TODO(akalin): Perhaps extend this to decrypt? | 102 // TODO(akalin): Perhaps extend this to decrypt? |
| 102 std::unique_ptr<base::DictionaryValue> EncryptedDataToValue( | 103 std::unique_ptr<base::DictionaryValue> EncryptedDataToValue( |
| 103 const sync_pb::EncryptedData& encrypted_data); | 104 const sync_pb::EncryptedData& encrypted_data); |
| 104 | 105 |
| 105 // Sub-protocol of AppListSpecifics. | 106 // Sub-protocol of AppListSpecifics. |
| 106 std::unique_ptr<base::DictionaryValue> AppListSpecificsToValue( | 107 std::unique_ptr<base::DictionaryValue> AppListSpecificsToValue( |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 313 |
| 313 std::unique_ptr<base::DictionaryValue> ClientConfigParamsToValue( | 314 std::unique_ptr<base::DictionaryValue> ClientConfigParamsToValue( |
| 314 const sync_pb::ClientConfigParams& proto); | 315 const sync_pb::ClientConfigParams& proto); |
| 315 | 316 |
| 316 std::unique_ptr<base::DictionaryValue> AttachmentIdProtoToValue( | 317 std::unique_ptr<base::DictionaryValue> AttachmentIdProtoToValue( |
| 317 const sync_pb::AttachmentIdProto& proto); | 318 const sync_pb::AttachmentIdProto& proto); |
| 318 | 319 |
| 319 std::unique_ptr<base::DictionaryValue> EntityMetadataToValue( | 320 std::unique_ptr<base::DictionaryValue> EntityMetadataToValue( |
| 320 const sync_pb::EntityMetadata& metadata); | 321 const sync_pb::EntityMetadata& metadata); |
| 321 | 322 |
| 323 } // namespace old |
| 322 } // namespace syncer | 324 } // namespace syncer |
| 323 | 325 |
| 324 #endif // COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 326 #endif // COMPONENTS_SYNC_PROTOCOL_PROTO_OLD_VALUE_CONVERSIONS_H_ |
| OLD | NEW |