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

Side by Side Diff: chrome/browser/sync/protocol/sync.proto

Issue 9460047: sync: remove use of protobuf extensions in protocol to reduce static init overhead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nick's comment Created 8 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 (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 // Sync protocol for communication between sync client and server. 5 // Sync protocol for communication between sync client and server.
6 6
7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change 7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
8 // any fields in this file. 8 // any fields in this file.
9 9
10 syntax = "proto2"; 10 syntax = "proto2";
11 11
12 option optimize_for = LITE_RUNTIME; 12 option optimize_for = LITE_RUNTIME;
13 option retain_unknown_fields = true; 13 option retain_unknown_fields = true;
14 14
15 package sync_pb; 15 package sync_pb;
16 16
17 import "app_notification_specifics.proto";
18 import "app_setting_specifics.proto";
19 import "app_specifics.proto";
20 import "autofill_specifics.proto";
21 import "bookmark_specifics.proto";
22 import "extension_setting_specifics.proto";
23 import "extension_specifics.proto";
24 import "nigori_specifics.proto";
25 import "password_specifics.proto";
26 import "preference_specifics.proto";
27 import "search_engine_specifics.proto";
28 import "session_specifics.proto";
29 import "theme_specifics.proto";
30 import "typed_url_specifics.proto";
17 import "encryption.proto"; 31 import "encryption.proto";
18 import "sync_enums.proto"; 32 import "sync_enums.proto";
19 import "client_commands.proto"; 33 import "client_commands.proto";
20 import "client_debug_info.proto"; 34 import "client_debug_info.proto";
21 35
22 // Used for inspecting how long we spent performing operations in different 36 // Used for inspecting how long we spent performing operations in different
23 // backends. All times must be in millis. 37 // backends. All times must be in millis.
24 message ProfilingData { 38 message ProfilingData {
25 optional int64 meta_data_write_time = 1; 39 optional int64 meta_data_write_time = 1;
26 optional int64 file_data_write_time = 2; 40 optional int64 file_data_write_time = 2;
27 optional int64 user_lookup_time = 3; 41 optional int64 user_lookup_time = 3;
28 optional int64 meta_data_read_time = 4; 42 optional int64 meta_data_read_time = 4;
29 optional int64 file_data_read_time = 5; 43 optional int64 file_data_read_time = 5;
30 optional int64 total_request_time = 6; 44 optional int64 total_request_time = 6;
31 } 45 }
32 46
33 message EntitySpecifics { 47 message EntitySpecifics {
34 // If a datatype is encrypted, this field will contain the encrypted 48 // If a datatype is encrypted, this field will contain the encrypted
35 // original EntitySpecifics. The extension for the datatype will continue 49 // original EntitySpecifics. The extension for the datatype will continue
36 // to exist, but contain only the default values. 50 // to exist, but contain only the default values.
37 // Note that currently passwords employ their own legacy encryption scheme and 51 // Note that currently passwords employ their own legacy encryption scheme and
38 // do not use this field. 52 // do not use this field.
39 optional EncryptedData encrypted = 1; 53 optional EncryptedData encrypted = 1;
40 54
41 // To add new datatype-specific fields to the protocol, extend 55 // To add new datatype-specific fields to the protocol, extend
42 // EntitySpecifics. First, pick a non-colliding tag number by 56 // EntitySpecifics. First, pick a non-colliding tag number by
43 // picking a revision number of one of your past commits 57 // picking a revision number of one of your past commits
44 // to src.chromium.org. Then, in a different protocol buffer 58 // to src.chromium.org. Then, in a different protocol buffer
45 // definition that includes this, do the following: 59 // definition,define your message type, and add an optional field
akalin 2012/03/02 23:56:49 space after first comma
60 // to the list below using the unique tag value you selected.
46 // 61 //
47 // extend EntitySpecifics { 62 // optional MyDatatypeSpecifics my_datatype = 32222;
akalin 2012/03/02 23:56:49 two spaces before 'optional'
48 // MyDatatypeSpecifics my_datatype = 32222;
49 // }
50 // 63 //
51 // where: 64 // where:
52 // - 32222 is the non-colliding tag number you picked earlier. 65 // - 32222 is the non-colliding tag number you picked earlier.
53 // - MyDatatypeSpecifics is the type (probably a message type defined 66 // - MyDatatypeSpecifics is the type (probably a message type defined
54 // in your new .proto file) that you want to associate with each 67 // in your new .proto file) that you want to associate with each
55 // object of the new datatype. 68 // object of the new datatype.
56 // - my_datatype is the field identifier you'll use to access the 69 // - my_datatype is the field identifier you'll use to access the
57 // datatype specifics from the code. 70 // datatype specifics from the code.
58 // 71 //
59 // Server implementations are obligated to preserve the contents of 72 // Server implementations are obligated to preserve the contents of
60 // EntitySpecifics when it contains unrecognized extensions. In this 73 // EntitySpecifics when it contains unrecognized fields. In this
61 // way, it is possible to add new datatype fields without having 74 // way, it is possible to add new datatype fields without having
62 // to update the server. 75 // to update the server.
63 extensions 30000 to max; 76 //
77 // Note: The tag selection process is based on legacy versions of the
78 // protocol which used protobuf extensions. We have kept the process
79 // consistent as the old values cannot change. The 5+ digit nature of the
80 // tags also makes them recognizable (individually and collectively) from
81 // noise in logs and debugging contexts, and creating a divergent subset of
82 // tags would only make things a bit more confusing.
83
84 optional AutofillSpecifics autofill = 31729;
85 optional BookmarkSpecifics bookmark = 32904;
86 optional PreferenceSpecifics preference = 37702;
87 optional TypedUrlSpecifics typed_url = 40781;
88 optional ThemeSpecifics theme = 41210;
89 optional AppNotification app_notification = 45184;
90 optional PasswordSpecifics password = 45873;
91 optional NigoriSpecifics nigori = 47745;
92 optional ExtensionSpecifics extension = 48119;
93 optional AppSpecifics app = 48364;
94 optional SessionSpecifics session = 50119;
95 optional AutofillProfileSpecifics autofill_profile = 63951;
96 optional SearchEngineSpecifics search_engine = 88610;
97 optional ExtensionSettingSpecifics extension_setting = 96159;
98 optional AppSettingSpecifics app_setting = 103656;
64 } 99 }
65 100
66 message SyncEntity { 101 message SyncEntity {
67 // This item's identifier. In a commit of a new item, this will be a 102 // This item's identifier. In a commit of a new item, this will be a
68 // client-generated ID. If the commit succeeds, the server will generate 103 // client-generated ID. If the commit succeeds, the server will generate
69 // a globally unique ID and return it to the committing client in the 104 // a globally unique ID and return it to the committing client in the
70 // CommitResponse.EntryResponse. In the context of a GetUpdatesResponse, 105 // CommitResponse.EntryResponse. In the context of a GetUpdatesResponse,
71 // |id_string| is always the server generated ID. The original 106 // |id_string| is always the server generated ID. The original
72 // client-generated ID is preserved in the |originator_client_id| field. 107 // client-generated ID is preserved in the |originator_client_id| field.
73 // Present in both GetUpdatesResponse and CommitMessage. 108 // Present in both GetUpdatesResponse and CommitMessage.
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 346
312 required GetUpdatesSource source = 1; 347 required GetUpdatesSource source = 1;
313 348
314 // True only if notifications were enabled for this GetUpdateMessage. 349 // True only if notifications were enabled for this GetUpdateMessage.
315 optional bool notifications_enabled = 2; 350 optional bool notifications_enabled = 2;
316 }; 351 };
317 352
318 message DataTypeProgressMarker { 353 message DataTypeProgressMarker {
319 // An integer identifying the data type whose progress is tracked by this 354 // An integer identifying the data type whose progress is tracked by this
320 // marker. The legitimate values of this field correspond to the protobuf 355 // marker. The legitimate values of this field correspond to the protobuf
321 // field numbers of all EntitySpecifics extensions supported by the server. 356 // field numbers of all EntitySpecifics fields supported by the server.
322 // These values are externally declared in per-datatype .proto files. 357 // These values are externally declared in per-datatype .proto files.
323 optional int32 data_type_id = 1; 358 optional int32 data_type_id = 1;
324 359
325 // An opaque-to-the-client sequence of bytes that the server may interpret 360 // An opaque-to-the-client sequence of bytes that the server may interpret
326 // as an indicator of the client's knowledge state. If this is empty or 361 // as an indicator of the client's knowledge state. If this is empty or
327 // omitted by the client, it indicates that the client is initiating a 362 // omitted by the client, it indicates that the client is initiating a
328 // a first-time sync of this datatype. Otherwise, clients must supply a 363 // a first-time sync of this datatype. Otherwise, clients must supply a
329 // value previously returned by the server in an earlier GetUpdatesResponse. 364 // value previously returned by the server in an earlier GetUpdatesResponse.
330 // These values are not comparable or generable on the client. 365 // These values are not comparable or generable on the client.
331 // 366 //
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 // from_timestamp has been deprecated; clients should use 402 // from_timestamp has been deprecated; clients should use
368 // |from_progress_marker| instead, which allows more flexibility. 403 // |from_progress_marker| instead, which allows more flexibility.
369 optional int64 from_timestamp = 1; 404 optional int64 from_timestamp = 1;
370 405
371 // Indicates the reason for the GetUpdatesMessage. 406 // Indicates the reason for the GetUpdatesMessage.
372 optional GetUpdatesCallerInfo caller_info = 2; 407 optional GetUpdatesCallerInfo caller_info = 2;
373 408
374 // Indicates whether related folders should be fetched. 409 // Indicates whether related folders should be fetched.
375 optional bool fetch_folders = 3 [default = true]; 410 optional bool fetch_folders = 3 [default = true];
376 411
377 // The presence of an individual EntitySpecifics extension indicates that the 412 // The presence of an individual EntitySpecifics field indicates that the
378 // client requests sync object types associated with that extension. This 413 // client requests sync object types associated with that field. This
379 // determination depends only on the presence of the extension field, not its 414 // determination depends only on the presence of the field, not its
380 // contents -- thus clients should send empty extension messages. For 415 // contents -- thus clients should send empty messages as the field value.
381 // backwards compatibility only bookmark objects will be sent to the client 416 // For backwards compatibility only bookmark objects will be sent to the
382 // should requested_types not be present. 417 // client should requested_types not be present.
383 // 418 //
384 // requested_types may contain multiple EntitySpecifics extensions -- in this 419 // requested_types may contain multiple EntitySpecifics fields -- in this
385 // event, the server will return items of all the indicated types. 420 // event, the server will return items of all the indicated types.
386 // 421 //
387 // requested_types has been deprecated; clients should use 422 // requested_types has been deprecated; clients should use
388 // |from_progress_marker| instead, which allows more flexibility. 423 // |from_progress_marker| instead, which allows more flexibility.
389 optional EntitySpecifics requested_types = 4; 424 optional EntitySpecifics requested_types = 4;
390 425
391 // Client-requested limit on the maximum number of updates to return at once. 426 // Client-requested limit on the maximum number of updates to return at once.
392 // The server may opt to return fewer updates than this amount, but it should 427 // The server may opt to return fewer updates than this amount, but it should
393 // not return more. 428 // not return more.
394 optional int32 batch_size = 5; 429 optional int32 batch_size = 5;
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 optional string store_birthday = 6; 673 optional string store_birthday = 6;
639 674
640 optional ClientCommand client_command = 7; 675 optional ClientCommand client_command = 7;
641 optional ProfilingData profiling_data = 8; 676 optional ProfilingData profiling_data = 8;
642 677
643 // The data types whose storage has been migrated. Present when the value of 678 // The data types whose storage has been migrated. Present when the value of
644 // error_code is MIGRATION_DONE. 679 // error_code is MIGRATION_DONE.
645 repeated int32 migrated_data_type_id = 12; 680 repeated int32 migrated_data_type_id = 12;
646 }; 681 };
647 682
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698