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 // Protocol buffer definitions for Drive backend of Syncable FileSystem. | 5 // Protocol buffer definitions for Drive backend of Syncable FileSystem. |
6 | 6 |
7 syntax = "proto2"; | 7 syntax = "proto2"; |
8 | 8 |
9 option optimize_for = LITE_RUNTIME; | 9 option optimize_for = LITE_RUNTIME; |
10 | 10 |
11 package sync_file_system.drive_backend; | 11 package sync_file_system.drive_backend; |
12 | 12 |
13 enum FileKind { | 13 enum FileKind { |
14 KIND_UNSUPPORTED = 0; | 14 KIND_UNSUPPORTED = 0; |
15 KIND_FILE = 1; | 15 KIND_FILE = 1; |
16 KIND_FOLDER = 2; | 16 KIND_FOLDER = 2; |
17 } | 17 } |
18 | 18 |
19 message ServiceMetadata { | 19 message ServiceMetadata { |
20 optional int64 largest_change_id = 1; | 20 optional int64 largest_change_id = 1; |
21 optional string sync_root_folder_id = 2; | 21 optional int64 sync_root_tracker_id = 2; |
22 | |
23 // Is the sequence number of FileTrackers. Must be positive. | |
nhiroki
2013/08/06 07:50:59
nit: s/"Is the"/"The"/
tzik
2013/08/06 08:33:45
Done.
| |
24 optional int64 next_tracker_id = 3; | |
22 } | 25 } |
26 | |
27 // Holds details of file/folder metadata. | |
28 message FileDetails { | |
29 repeated string parent_folder_ids = 1; | |
nhiroki
2013/08/06 07:50:59
super-nit: How about adding extra blank line betwe
tzik
2013/08/06 08:33:45
Done.
| |
30 optional string title = 2; | |
31 optional FileKind kind = 3; | |
32 optional string md5 = 4; | |
33 optional string etag = 5; | |
34 | |
35 // Creation time and modification time of the resource. | |
36 // Serialized by Time::ToInternalValue. | |
37 optional int64 creation_time = 6; | |
38 optional int64 modification_time = 7; | |
39 | |
40 optional bool deleted = 8; | |
41 optional int64 change_id = 9; | |
42 } | |
43 | |
44 // Represents a server-side file. | |
45 message FileMetadata { | |
46 // File ID of the remote file/folder which the FileMetadata represents. | |
47 required string file_id = 1; | |
48 optional FileDetails details = 2; | |
kinuko
2013/08/06 07:51:00
nit: can you put an empty line between 47-48
tzik
2013/08/06 08:33:45
Done.
| |
49 } | |
50 | |
51 // Represents synced local file. | |
52 message FileTracker { | |
53 // A unique sequence number to identify the tracker. Must be positive. | |
54 required int64 tracker_id = 1; | |
55 | |
56 // Points the parent tracker in the tracker tree. 0 if there's no parent. | |
57 required int64 parent_tracker_id = 2; | |
58 | |
59 required string file_id = 3; | |
60 | |
61 optional string app_id = 4; | |
62 optional bool is_app_root = 5; | |
63 | |
64 optional FileDetails synced_details = 6; | |
65 | |
66 // True if the file is changed since the last update for this file. | |
67 optional bool dirty = 7; | |
68 | |
69 // True if the FileTracker is active. | |
70 // Remote file content modification should only be applied for active | |
71 // FileTracker. | |
kinuko
2013/08/06 07:51:00
nit: for -> to
nit: active FileTracker -> active t
tzik
2013/08/06 08:33:45
Done.
| |
72 // Active FileTracker must have a unique title under its parent. | |
73 optional bool active = 8; | |
74 | |
75 // Valid only for folders. | |
76 // True indicates the folder contents has not yet been fetched. | |
nhiroki
2013/08/06 07:50:59
nit: s/indicates/if/ (to make consistent with othe
kinuko
2013/08/06 07:51:00
nit: has -> have
tzik
2013/08/06 08:33:45
Done.
tzik
2013/08/06 08:33:45
Done.
| |
77 optional bool needs_folder_listing = 9; | |
78 } | |
OLD | NEW |