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

Side by Side Diff: sync/tools/testserver/chromiumsync.py

Issue 12033093: sync: Implementation of Priority Preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """An implementation of the server side of the Chromium sync protocol. 5 """An implementation of the server side of the Chromium sync protocol.
6 6
7 The details of the protocol are described mostly by comments in the protocol 7 The details of the protocol are described mostly by comments in the protocol
8 buffer definition at chrome/browser/sync/protocol/sync.proto. 8 buffer definition at chrome/browser/sync/protocol/sync.proto.
9 """ 9 """
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 AUTOFILL_PROFILE, 55 AUTOFILL_PROFILE,
56 BOOKMARK, 56 BOOKMARK,
57 DEVICE_INFO, 57 DEVICE_INFO,
58 DICTIONARY, 58 DICTIONARY,
59 EXPERIMENTS, 59 EXPERIMENTS,
60 EXTENSIONS, 60 EXTENSIONS,
61 HISTORY_DELETE_DIRECTIVE, 61 HISTORY_DELETE_DIRECTIVE,
62 NIGORI, 62 NIGORI,
63 PASSWORD, 63 PASSWORD,
64 PREFERENCE, 64 PREFERENCE,
65 PRIORITY_PREFERENCE,
65 SEARCH_ENGINE, 66 SEARCH_ENGINE,
66 SESSION, 67 SESSION,
67 SYNCED_NOTIFICATION, 68 SYNCED_NOTIFICATION,
68 THEME, 69 THEME,
69 TYPED_URL, 70 TYPED_URL,
70 EXTENSION_SETTINGS, 71 EXTENSION_SETTINGS,
71 FAVICON_IMAGES, 72 FAVICON_IMAGES,
72 FAVICON_TRACKING) = range(23) 73 FAVICON_TRACKING) = range(24)
73 74
74 # An enumeration on the frequency at which the server should send errors 75 # An enumeration on the frequency at which the server should send errors
75 # to the client. This would be specified by the url that triggers the error. 76 # to the client. This would be specified by the url that triggers the error.
76 # Note: This enum should be kept in the same order as the enum in sync_test.h. 77 # Note: This enum should be kept in the same order as the enum in sync_test.h.
77 SYNC_ERROR_FREQUENCY = ( 78 SYNC_ERROR_FREQUENCY = (
78 ERROR_FREQUENCY_NONE, 79 ERROR_FREQUENCY_NONE,
79 ERROR_FREQUENCY_ALWAYS, 80 ERROR_FREQUENCY_ALWAYS,
80 ERROR_FREQUENCY_TWO_THIRDS) = range(3) 81 ERROR_FREQUENCY_TWO_THIRDS) = range(3)
81 82
82 # Well-known server tag of the top level 'Google Chrome' folder. 83 # Well-known server tag of the top level 'Google Chrome' folder.
(...skipping 13 matching lines...) Expand all
96 DICTIONARY: SYNC_TYPE_FIELDS['dictionary'], 97 DICTIONARY: SYNC_TYPE_FIELDS['dictionary'],
97 EXPERIMENTS: SYNC_TYPE_FIELDS['experiments'], 98 EXPERIMENTS: SYNC_TYPE_FIELDS['experiments'],
98 EXTENSION_SETTINGS: SYNC_TYPE_FIELDS['extension_setting'], 99 EXTENSION_SETTINGS: SYNC_TYPE_FIELDS['extension_setting'],
99 EXTENSIONS: SYNC_TYPE_FIELDS['extension'], 100 EXTENSIONS: SYNC_TYPE_FIELDS['extension'],
100 FAVICON_IMAGES: SYNC_TYPE_FIELDS['favicon_image'], 101 FAVICON_IMAGES: SYNC_TYPE_FIELDS['favicon_image'],
101 FAVICON_TRACKING: SYNC_TYPE_FIELDS['favicon_tracking'], 102 FAVICON_TRACKING: SYNC_TYPE_FIELDS['favicon_tracking'],
102 HISTORY_DELETE_DIRECTIVE: SYNC_TYPE_FIELDS['history_delete_directive'], 103 HISTORY_DELETE_DIRECTIVE: SYNC_TYPE_FIELDS['history_delete_directive'],
103 NIGORI: SYNC_TYPE_FIELDS['nigori'], 104 NIGORI: SYNC_TYPE_FIELDS['nigori'],
104 PASSWORD: SYNC_TYPE_FIELDS['password'], 105 PASSWORD: SYNC_TYPE_FIELDS['password'],
105 PREFERENCE: SYNC_TYPE_FIELDS['preference'], 106 PREFERENCE: SYNC_TYPE_FIELDS['preference'],
107 PRIORITY_PREFERENCE: SYNC_TYPE_FIELDS['priority_preference'],
106 SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'], 108 SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'],
107 SESSION: SYNC_TYPE_FIELDS['session'], 109 SESSION: SYNC_TYPE_FIELDS['session'],
108 SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"], 110 SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"],
109 THEME: SYNC_TYPE_FIELDS['theme'], 111 THEME: SYNC_TYPE_FIELDS['theme'],
110 TYPED_URL: SYNC_TYPE_FIELDS['typed_url'], 112 TYPED_URL: SYNC_TYPE_FIELDS['typed_url'],
111 } 113 }
112 114
113 # The parent ID used to indicate a top-level node. 115 # The parent ID used to indicate a top-level node.
114 ROOT_ID = '0' 116 ROOT_ID = '0'
115 117
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 PermanentItem('google_chrome_favicon_tracking', 489 PermanentItem('google_chrome_favicon_tracking',
488 name='Favicon Tracking', 490 name='Favicon Tracking',
489 parent_tag=ROOT_ID, 491 parent_tag=ROOT_ID,
490 sync_type=FAVICON_TRACKING), 492 sync_type=FAVICON_TRACKING),
491 PermanentItem('google_chrome_nigori', name='Nigori', 493 PermanentItem('google_chrome_nigori', name='Nigori',
492 parent_tag=ROOT_ID, sync_type=NIGORI), 494 parent_tag=ROOT_ID, sync_type=NIGORI),
493 PermanentItem('google_chrome_passwords', name='Passwords', 495 PermanentItem('google_chrome_passwords', name='Passwords',
494 parent_tag=ROOT_ID, sync_type=PASSWORD), 496 parent_tag=ROOT_ID, sync_type=PASSWORD),
495 PermanentItem('google_chrome_preferences', name='Preferences', 497 PermanentItem('google_chrome_preferences', name='Preferences',
496 parent_tag=ROOT_ID, sync_type=PREFERENCE), 498 parent_tag=ROOT_ID, sync_type=PREFERENCE),
499 PermanentItem('google_chrome_priority_preferences',
500 name='Priority Preferences',
501 parent_tag=ROOT_ID, sync_type=PRIORITY_PREFERENCE),
497 PermanentItem('google_chrome_synced_notifications', 502 PermanentItem('google_chrome_synced_notifications',
498 name='Synced Notifications', 503 name='Synced Notifications',
499 parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION), 504 parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION),
500 PermanentItem('google_chrome_search_engines', name='Search Engines', 505 PermanentItem('google_chrome_search_engines', name='Search Engines',
501 parent_tag=ROOT_ID, sync_type=SEARCH_ENGINE), 506 parent_tag=ROOT_ID, sync_type=SEARCH_ENGINE),
502 PermanentItem('google_chrome_sessions', name='Sessions', 507 PermanentItem('google_chrome_sessions', name='Sessions',
503 parent_tag=ROOT_ID, sync_type=SESSION), 508 parent_tag=ROOT_ID, sync_type=SESSION),
504 PermanentItem('google_chrome_themes', name='Themes', 509 PermanentItem('google_chrome_themes', name='Themes',
505 parent_tag=ROOT_ID, sync_type=THEME), 510 parent_tag=ROOT_ID, sync_type=THEME),
506 PermanentItem('google_chrome_typed_urls', name='Typed URLs', 511 PermanentItem('google_chrome_typed_urls', name='Typed URLs',
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 sending_nigori_node = False 1399 sending_nigori_node = False
1395 for entry in entries: 1400 for entry in entries:
1396 if entry.name == 'Nigori': 1401 if entry.name == 'Nigori':
1397 sending_nigori_node = True 1402 sending_nigori_node = True
1398 reply = update_response.entries.add() 1403 reply = update_response.entries.add()
1399 reply.CopyFrom(entry) 1404 reply.CopyFrom(entry)
1400 update_sieve.SaveProgress(new_timestamp, update_response) 1405 update_sieve.SaveProgress(new_timestamp, update_response)
1401 1406
1402 if update_request.need_encryption_key or sending_nigori_node: 1407 if update_request.need_encryption_key or sending_nigori_node:
1403 update_response.encryption_keys.extend(self.account.GetKeystoreKeys()) 1408 update_response.encryption_keys.extend(self.account.GetKeystoreKeys())
OLDNEW
« components/user_prefs/pref_registry_syncable.h ('K') | « sync/syncable/model_type.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698