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

Side by Side Diff: components/sync/protocol/proto_value_conversions.cc

Issue 2241583003: Creating protobuf for reading list sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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
OLDNEW
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 // 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 #include "components/sync/protocol/proto_value_conversions.h" 7 #include "components/sync/protocol/proto_value_conversions.h"
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 24 matching lines...) Expand all
35 #include "components/sync/protocol/extension_specifics.pb.h" 35 #include "components/sync/protocol/extension_specifics.pb.h"
36 #include "components/sync/protocol/favicon_image_specifics.pb.h" 36 #include "components/sync/protocol/favicon_image_specifics.pb.h"
37 #include "components/sync/protocol/favicon_tracking_specifics.pb.h" 37 #include "components/sync/protocol/favicon_tracking_specifics.pb.h"
38 #include "components/sync/protocol/history_delete_directive_specifics.pb.h" 38 #include "components/sync/protocol/history_delete_directive_specifics.pb.h"
39 #include "components/sync/protocol/nigori_specifics.pb.h" 39 #include "components/sync/protocol/nigori_specifics.pb.h"
40 #include "components/sync/protocol/password_specifics.pb.h" 40 #include "components/sync/protocol/password_specifics.pb.h"
41 #include "components/sync/protocol/preference_specifics.pb.h" 41 #include "components/sync/protocol/preference_specifics.pb.h"
42 #include "components/sync/protocol/printer_specifics.pb.h" 42 #include "components/sync/protocol/printer_specifics.pb.h"
43 #include "components/sync/protocol/priority_preference_specifics.pb.h" 43 #include "components/sync/protocol/priority_preference_specifics.pb.h"
44 #include "components/sync/protocol/proto_enum_conversions.h" 44 #include "components/sync/protocol/proto_enum_conversions.h"
45 #include "components/sync/protocol/reading_list_specifics.pb.h"
45 #include "components/sync/protocol/search_engine_specifics.pb.h" 46 #include "components/sync/protocol/search_engine_specifics.pb.h"
46 #include "components/sync/protocol/session_specifics.pb.h" 47 #include "components/sync/protocol/session_specifics.pb.h"
47 #include "components/sync/protocol/sync.pb.h" 48 #include "components/sync/protocol/sync.pb.h"
48 #include "components/sync/protocol/theme_specifics.pb.h" 49 #include "components/sync/protocol/theme_specifics.pb.h"
49 #include "components/sync/protocol/typed_url_specifics.pb.h" 50 #include "components/sync/protocol/typed_url_specifics.pb.h"
50 #include "components/sync/protocol/unique_position.pb.h" 51 #include "components/sync/protocol/unique_position.pb.h"
51 52
52 namespace syncer { 53 namespace syncer {
53 54
54 namespace { 55 namespace {
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 const sync_pb::PrinterPPDData& proto) { 295 const sync_pb::PrinterPPDData& proto) {
295 std::unique_ptr<base::DictionaryValue> value = 296 std::unique_ptr<base::DictionaryValue> value =
296 base::MakeUnique<base::DictionaryValue>(); 297 base::MakeUnique<base::DictionaryValue>();
297 SET_INT32(id); 298 SET_INT32(id);
298 SET_STR(file_name); 299 SET_STR(file_name);
299 SET_INT64(version_number); 300 SET_INT64(version_number);
300 SET_BOOL(from_quirks_server); 301 SET_BOOL(from_quirks_server);
301 return value; 302 return value;
302 } 303 }
303 304
305 std::unique_ptr<base::DictionaryValue> ReadingListSpecificsToValue(
306 const sync_pb::ReadingListSpecifics& proto) {
307 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
308 SET_STR(entry_id);
309 SET_STR(title);
310 SET_STR(url);
311 SET_INT64(creation_time_us);
312 SET_INT64(update_time_us);
313 SET_ENUM(status, GetReadingListEntryStatusString);
314
315 return value;
316 }
317
304 std::unique_ptr<base::DictionaryValue> AppNotificationToValue( 318 std::unique_ptr<base::DictionaryValue> AppNotificationToValue(
305 const sync_pb::AppNotification& proto) { 319 const sync_pb::AppNotification& proto) {
306 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 320 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
307 SET_STR(guid); 321 SET_STR(guid);
308 SET_STR(app_id); 322 SET_STR(app_id);
309 SET_INT64(creation_timestamp_ms); 323 SET_INT64(creation_timestamp_ms);
310 SET_STR(title); 324 SET_STR(title);
311 SET_STR(body_text); 325 SET_STR(body_text);
312 SET_STR(link_url); 326 SET_STR(link_url);
313 SET_STR(link_text); 327 SET_STR(link_text);
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 SET_BOOL(encrypt_extension_settings); 604 SET_BOOL(encrypt_extension_settings);
591 SET_BOOL(encrypt_extensions); 605 SET_BOOL(encrypt_extensions);
592 SET_BOOL(encrypt_sessions); 606 SET_BOOL(encrypt_sessions);
593 SET_BOOL(encrypt_app_settings); 607 SET_BOOL(encrypt_app_settings);
594 SET_BOOL(encrypt_apps); 608 SET_BOOL(encrypt_apps);
595 SET_BOOL(encrypt_search_engines); 609 SET_BOOL(encrypt_search_engines);
596 SET_BOOL(encrypt_dictionary); 610 SET_BOOL(encrypt_dictionary);
597 SET_BOOL(encrypt_articles); 611 SET_BOOL(encrypt_articles);
598 SET_BOOL(encrypt_app_list); 612 SET_BOOL(encrypt_app_list);
599 SET_BOOL(encrypt_arc_package); 613 SET_BOOL(encrypt_arc_package);
614 SET_BOOL(encrypt_reading_list);
600 SET_BOOL(encrypt_everything); 615 SET_BOOL(encrypt_everything);
601 SET_BOOL(server_only_was_missing_keystore_migration_time); 616 SET_BOOL(server_only_was_missing_keystore_migration_time);
602 SET_BOOL(sync_tab_favicons); 617 SET_BOOL(sync_tab_favicons);
603 SET_ENUM(passphrase_type, PassphraseTypeString); 618 SET_ENUM(passphrase_type, PassphraseTypeString);
604 SET(keystore_decryptor_token, EncryptedDataToValue); 619 SET(keystore_decryptor_token, EncryptedDataToValue);
605 SET_INT64(keystore_migration_time); 620 SET_INT64(keystore_migration_time);
606 SET_INT64(custom_passphrase_time); 621 SET_INT64(custom_passphrase_time);
607 return value; 622 return value;
608 } 623 }
609 624
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 SET_FIELD(managed_user_setting, ManagedUserSettingSpecificsToValue); 815 SET_FIELD(managed_user_setting, ManagedUserSettingSpecificsToValue);
801 SET_FIELD(managed_user_shared_setting, 816 SET_FIELD(managed_user_shared_setting,
802 ManagedUserSharedSettingSpecificsToValue); 817 ManagedUserSharedSettingSpecificsToValue);
803 SET_FIELD(managed_user, ManagedUserSpecificsToValue); 818 SET_FIELD(managed_user, ManagedUserSpecificsToValue);
804 SET_FIELD(managed_user_whitelist, ManagedUserWhitelistSpecificsToValue); 819 SET_FIELD(managed_user_whitelist, ManagedUserWhitelistSpecificsToValue);
805 SET_FIELD(nigori, NigoriSpecificsToValue); 820 SET_FIELD(nigori, NigoriSpecificsToValue);
806 SET_FIELD(password, PasswordSpecificsToValue); 821 SET_FIELD(password, PasswordSpecificsToValue);
807 SET_FIELD(preference, PreferenceSpecificsToValue); 822 SET_FIELD(preference, PreferenceSpecificsToValue);
808 SET_FIELD(printer, PrinterSpecificsToValue); 823 SET_FIELD(printer, PrinterSpecificsToValue);
809 SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue); 824 SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue);
825 SET_FIELD(reading_list, ReadingListSpecificsToValue);
810 SET_FIELD(search_engine, SearchEngineSpecificsToValue); 826 SET_FIELD(search_engine, SearchEngineSpecificsToValue);
811 SET_FIELD(session, SessionSpecificsToValue); 827 SET_FIELD(session, SessionSpecificsToValue);
812 SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue); 828 SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue);
813 SET_FIELD(synced_notification_app_info, 829 SET_FIELD(synced_notification_app_info,
814 SyncedNotificationAppInfoSpecificsToValue); 830 SyncedNotificationAppInfoSpecificsToValue);
815 SET_FIELD(theme, ThemeSpecificsToValue); 831 SET_FIELD(theme, ThemeSpecificsToValue);
816 SET_FIELD(typed_url, TypedUrlSpecificsToValue); 832 SET_FIELD(typed_url, TypedUrlSpecificsToValue);
817 SET_FIELD(wifi_credential, WifiCredentialSpecificsToValue); 833 SET_FIELD(wifi_credential, WifiCredentialSpecificsToValue);
818 return value; 834 return value;
819 } 835 }
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 #undef SET_BYTES 1159 #undef SET_BYTES
1144 #undef SET_INT32 1160 #undef SET_INT32
1145 #undef SET_INT64 1161 #undef SET_INT64
1146 #undef SET_INT64_REP 1162 #undef SET_INT64_REP
1147 #undef SET_STR 1163 #undef SET_STR
1148 #undef SET_STR_REP 1164 #undef SET_STR_REP
1149 1165
1150 #undef SET_FIELD 1166 #undef SET_FIELD
1151 1167
1152 } // namespace syncer 1168 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/protocol/proto_value_conversions.h ('k') | components/sync/protocol/proto_value_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698