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 // The sequence number of FileTrackers. Must be positive. |
| 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; |
| 30 |
| 31 optional string title = 2; |
| 32 optional FileKind kind = 3; |
| 33 optional string md5 = 4; |
| 34 optional string etag = 5; |
| 35 |
| 36 // Creation time and modification time of the resource. |
| 37 // Serialized by Time::ToInternalValue. |
| 38 optional int64 creation_time = 6; |
| 39 optional int64 modification_time = 7; |
| 40 |
| 41 optional bool deleted = 8; |
| 42 optional int64 change_id = 9; |
| 43 } |
| 44 |
| 45 // Represents a server-side file. |
| 46 message FileMetadata { |
| 47 // File ID of the remote file/folder which the FileMetadata represents. |
| 48 required string file_id = 1; |
| 49 |
| 50 optional FileDetails details = 2; |
| 51 } |
| 52 |
| 53 // Represents synced local file. |
| 54 message FileTracker { |
| 55 // A unique sequence number to identify the tracker. Must be positive. |
| 56 required int64 tracker_id = 1; |
| 57 |
| 58 // Points the parent tracker in the tracker tree. 0 if there's no parent. |
| 59 required int64 parent_tracker_id = 2; |
| 60 |
| 61 required string file_id = 3; |
| 62 |
| 63 optional string app_id = 4; |
| 64 optional bool is_app_root = 5; |
| 65 |
| 66 optional FileDetails synced_details = 6; |
| 67 |
| 68 // True if the file is changed since the last update for this file. |
| 69 optional bool dirty = 7; |
| 70 |
| 71 // True if the FileTracker is active. |
| 72 // Remote file modification should only be applied to active trackers. |
| 73 // Active FileTracker must have a unique title under its parent. |
| 74 optional bool active = 8; |
| 75 |
| 76 // Valid only for folders. |
| 77 // True if the folder contents have not yet been fetched. |
| 78 optional bool needs_folder_listing = 9; |
| 79 } |
OLD | NEW |