OLD | NEW |
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 14 matching lines...) Expand all Loading... |
25 import autofill_specifics_pb2 | 25 import autofill_specifics_pb2 |
26 import bookmark_specifics_pb2 | 26 import bookmark_specifics_pb2 |
27 import dictionary_specifics_pb2 | 27 import dictionary_specifics_pb2 |
28 import get_updates_caller_info_pb2 | 28 import get_updates_caller_info_pb2 |
29 import extension_setting_specifics_pb2 | 29 import extension_setting_specifics_pb2 |
30 import extension_specifics_pb2 | 30 import extension_specifics_pb2 |
31 import favicon_image_specifics_pb2 | 31 import favicon_image_specifics_pb2 |
32 import favicon_tracking_specifics_pb2 | 32 import favicon_tracking_specifics_pb2 |
33 import history_delete_directive_specifics_pb2 | 33 import history_delete_directive_specifics_pb2 |
34 import managed_user_setting_specifics_pb2 | 34 import managed_user_setting_specifics_pb2 |
| 35 import managed_user_specifics_pb2 |
35 import nigori_specifics_pb2 | 36 import nigori_specifics_pb2 |
36 import password_specifics_pb2 | 37 import password_specifics_pb2 |
37 import preference_specifics_pb2 | 38 import preference_specifics_pb2 |
38 import priority_preference_specifics_pb2 | 39 import priority_preference_specifics_pb2 |
39 import search_engine_specifics_pb2 | 40 import search_engine_specifics_pb2 |
40 import session_specifics_pb2 | 41 import session_specifics_pb2 |
41 import sync_pb2 | 42 import sync_pb2 |
42 import sync_enums_pb2 | 43 import sync_enums_pb2 |
43 import synced_notification_specifics_pb2 | 44 import synced_notification_specifics_pb2 |
44 import theme_specifics_pb2 | 45 import theme_specifics_pb2 |
(...skipping 10 matching lines...) Expand all Loading... |
55 APP_SETTINGS, | 56 APP_SETTINGS, |
56 AUTOFILL, | 57 AUTOFILL, |
57 AUTOFILL_PROFILE, | 58 AUTOFILL_PROFILE, |
58 BOOKMARK, | 59 BOOKMARK, |
59 DEVICE_INFO, | 60 DEVICE_INFO, |
60 DICTIONARY, | 61 DICTIONARY, |
61 EXPERIMENTS, | 62 EXPERIMENTS, |
62 EXTENSIONS, | 63 EXTENSIONS, |
63 HISTORY_DELETE_DIRECTIVE, | 64 HISTORY_DELETE_DIRECTIVE, |
64 MANAGED_USER_SETTING, | 65 MANAGED_USER_SETTING, |
| 66 MANAGED_USER, |
65 NIGORI, | 67 NIGORI, |
66 PASSWORD, | 68 PASSWORD, |
67 PREFERENCE, | 69 PREFERENCE, |
68 PRIORITY_PREFERENCE, | 70 PRIORITY_PREFERENCE, |
69 SEARCH_ENGINE, | 71 SEARCH_ENGINE, |
70 SESSION, | 72 SESSION, |
71 SYNCED_NOTIFICATION, | 73 SYNCED_NOTIFICATION, |
72 THEME, | 74 THEME, |
73 TYPED_URL, | 75 TYPED_URL, |
74 EXTENSION_SETTINGS, | 76 EXTENSION_SETTINGS, |
75 FAVICON_IMAGES, | 77 FAVICON_IMAGES, |
76 FAVICON_TRACKING) = range(25) | 78 FAVICON_TRACKING) = range(26) |
77 | 79 |
78 # An enumeration on the frequency at which the server should send errors | 80 # An enumeration on the frequency at which the server should send errors |
79 # to the client. This would be specified by the url that triggers the error. | 81 # to the client. This would be specified by the url that triggers the error. |
80 # Note: This enum should be kept in the same order as the enum in sync_test.h. | 82 # Note: This enum should be kept in the same order as the enum in sync_test.h. |
81 SYNC_ERROR_FREQUENCY = ( | 83 SYNC_ERROR_FREQUENCY = ( |
82 ERROR_FREQUENCY_NONE, | 84 ERROR_FREQUENCY_NONE, |
83 ERROR_FREQUENCY_ALWAYS, | 85 ERROR_FREQUENCY_ALWAYS, |
84 ERROR_FREQUENCY_TWO_THIRDS) = range(3) | 86 ERROR_FREQUENCY_TWO_THIRDS) = range(3) |
85 | 87 |
86 # Well-known server tag of the top level 'Google Chrome' folder. | 88 # Well-known server tag of the top level 'Google Chrome' folder. |
(...skipping 11 matching lines...) Expand all Loading... |
98 BOOKMARK: SYNC_TYPE_FIELDS['bookmark'], | 100 BOOKMARK: SYNC_TYPE_FIELDS['bookmark'], |
99 DEVICE_INFO: SYNC_TYPE_FIELDS['device_info'], | 101 DEVICE_INFO: SYNC_TYPE_FIELDS['device_info'], |
100 DICTIONARY: SYNC_TYPE_FIELDS['dictionary'], | 102 DICTIONARY: SYNC_TYPE_FIELDS['dictionary'], |
101 EXPERIMENTS: SYNC_TYPE_FIELDS['experiments'], | 103 EXPERIMENTS: SYNC_TYPE_FIELDS['experiments'], |
102 EXTENSION_SETTINGS: SYNC_TYPE_FIELDS['extension_setting'], | 104 EXTENSION_SETTINGS: SYNC_TYPE_FIELDS['extension_setting'], |
103 EXTENSIONS: SYNC_TYPE_FIELDS['extension'], | 105 EXTENSIONS: SYNC_TYPE_FIELDS['extension'], |
104 FAVICON_IMAGES: SYNC_TYPE_FIELDS['favicon_image'], | 106 FAVICON_IMAGES: SYNC_TYPE_FIELDS['favicon_image'], |
105 FAVICON_TRACKING: SYNC_TYPE_FIELDS['favicon_tracking'], | 107 FAVICON_TRACKING: SYNC_TYPE_FIELDS['favicon_tracking'], |
106 HISTORY_DELETE_DIRECTIVE: SYNC_TYPE_FIELDS['history_delete_directive'], | 108 HISTORY_DELETE_DIRECTIVE: SYNC_TYPE_FIELDS['history_delete_directive'], |
107 MANAGED_USER_SETTING: SYNC_TYPE_FIELDS['managed_user_setting'], | 109 MANAGED_USER_SETTING: SYNC_TYPE_FIELDS['managed_user_setting'], |
| 110 MANAGED_USER: SYNC_TYPE_FIELDS['managed_user'], |
108 NIGORI: SYNC_TYPE_FIELDS['nigori'], | 111 NIGORI: SYNC_TYPE_FIELDS['nigori'], |
109 PASSWORD: SYNC_TYPE_FIELDS['password'], | 112 PASSWORD: SYNC_TYPE_FIELDS['password'], |
110 PREFERENCE: SYNC_TYPE_FIELDS['preference'], | 113 PREFERENCE: SYNC_TYPE_FIELDS['preference'], |
111 PRIORITY_PREFERENCE: SYNC_TYPE_FIELDS['priority_preference'], | 114 PRIORITY_PREFERENCE: SYNC_TYPE_FIELDS['priority_preference'], |
112 SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'], | 115 SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'], |
113 SESSION: SYNC_TYPE_FIELDS['session'], | 116 SESSION: SYNC_TYPE_FIELDS['session'], |
114 SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"], | 117 SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"], |
115 THEME: SYNC_TYPE_FIELDS['theme'], | 118 THEME: SYNC_TYPE_FIELDS['theme'], |
116 TYPED_URL: SYNC_TYPE_FIELDS['typed_url'], | 119 TYPED_URL: SYNC_TYPE_FIELDS['typed_url'], |
117 } | 120 } |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 name='Favicon Images', | 493 name='Favicon Images', |
491 parent_tag=ROOT_ID, | 494 parent_tag=ROOT_ID, |
492 sync_type=FAVICON_IMAGES), | 495 sync_type=FAVICON_IMAGES), |
493 PermanentItem('google_chrome_favicon_tracking', | 496 PermanentItem('google_chrome_favicon_tracking', |
494 name='Favicon Tracking', | 497 name='Favicon Tracking', |
495 parent_tag=ROOT_ID, | 498 parent_tag=ROOT_ID, |
496 sync_type=FAVICON_TRACKING), | 499 sync_type=FAVICON_TRACKING), |
497 PermanentItem('google_chrome_managed_user_settings', | 500 PermanentItem('google_chrome_managed_user_settings', |
498 name='Managed User Settings', | 501 name='Managed User Settings', |
499 parent_tag=ROOT_ID, sync_type=MANAGED_USER_SETTING), | 502 parent_tag=ROOT_ID, sync_type=MANAGED_USER_SETTING), |
| 503 PermanentItem('google_chrome_managed_users', |
| 504 name='Managed Users', |
| 505 parent_tag=ROOT_ID, sync_type=MANAGED_USER), |
500 PermanentItem('google_chrome_nigori', name='Nigori', | 506 PermanentItem('google_chrome_nigori', name='Nigori', |
501 parent_tag=ROOT_ID, sync_type=NIGORI), | 507 parent_tag=ROOT_ID, sync_type=NIGORI), |
502 PermanentItem('google_chrome_passwords', name='Passwords', | 508 PermanentItem('google_chrome_passwords', name='Passwords', |
503 parent_tag=ROOT_ID, sync_type=PASSWORD), | 509 parent_tag=ROOT_ID, sync_type=PASSWORD), |
504 PermanentItem('google_chrome_preferences', name='Preferences', | 510 PermanentItem('google_chrome_preferences', name='Preferences', |
505 parent_tag=ROOT_ID, sync_type=PREFERENCE), | 511 parent_tag=ROOT_ID, sync_type=PREFERENCE), |
506 PermanentItem('google_chrome_priority_preferences', | 512 PermanentItem('google_chrome_priority_preferences', |
507 name='Priority Preferences', | 513 name='Priority Preferences', |
508 parent_tag=ROOT_ID, sync_type=PRIORITY_PREFERENCE), | 514 parent_tag=ROOT_ID, sync_type=PRIORITY_PREFERENCE), |
509 PermanentItem('google_chrome_synced_notifications', | 515 PermanentItem('google_chrome_synced_notifications', |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 sending_nigori_node = False | 1416 sending_nigori_node = False |
1411 for entry in entries: | 1417 for entry in entries: |
1412 if entry.name == 'Nigori': | 1418 if entry.name == 'Nigori': |
1413 sending_nigori_node = True | 1419 sending_nigori_node = True |
1414 reply = update_response.entries.add() | 1420 reply = update_response.entries.add() |
1415 reply.CopyFrom(entry) | 1421 reply.CopyFrom(entry) |
1416 update_sieve.SaveProgress(new_timestamp, update_response) | 1422 update_sieve.SaveProgress(new_timestamp, update_response) |
1417 | 1423 |
1418 if update_request.need_encryption_key or sending_nigori_node: | 1424 if update_request.need_encryption_key or sending_nigori_node: |
1419 update_response.encryption_keys.extend(self.account.GetKeystoreKeys()) | 1425 update_response.encryption_keys.extend(self.account.GetKeystoreKeys()) |
OLD | NEW |