| OLD | NEW |
| 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 // Protocol buffer definitions for serializing GData files and directories. | 5 // Protocol buffer definitions for serializing Drive files and directories. |
| 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 gdata; | 11 package gdata; |
| 12 | 12 |
| 13 // Represents base::PlatformFileInfo. | 13 // Represents base::PlatformFileInfo. |
| 14 message PlatformFileInfoProto { | 14 message PlatformFileInfoProto { |
| 15 optional int64 size = 1; | 15 optional int64 size = 1; |
| 16 optional bool is_directory = 2; | 16 optional bool is_directory = 2; |
| 17 optional bool is_symbolic_link = 3; | 17 optional bool is_symbolic_link = 3; |
| 18 optional int64 last_modified = 4; | 18 optional int64 last_modified = 4; |
| 19 optional int64 last_accessed = 5; | 19 optional int64 last_accessed = 5; |
| 20 optional int64 creation_time = 6; | 20 optional int64 creation_time = 6; |
| 21 } | 21 } |
| 22 | 22 |
| 23 // File specific info, which is a part of GDataEntryProto. | 23 // File specific info, which is a part of DriveEntryProto. |
| 24 message GDataFileSpecificInfo { | 24 message DriveFileSpecificInfo { |
| 25 // This URL points to a thumbnail image. The thumbnail URL is not permanent | 25 // This URL points to a thumbnail image. The thumbnail URL is not permanent |
| 26 // as it's not protected by authentication. See crbug.com/127697 for how | 26 // as it's not protected by authentication. See crbug.com/127697 for how |
| 27 // stale thumbnail URLs are handled. | 27 // stale thumbnail URLs are handled. |
| 28 optional string thumbnail_url = 1; | 28 optional string thumbnail_url = 1; |
| 29 | 29 |
| 30 // This URL is used for opening hosted documents with Google Docs's web | 30 // This URL is used for opening hosted documents with Google Docs's web |
| 31 // interface. | 31 // interface. |
| 32 optional string alternate_url = 2; | 32 optional string alternate_url = 2; |
| 33 | 33 |
| 34 // Content mime type like "text/plain". | 34 // Content mime type like "text/plain". |
| 35 optional string content_mime_type = 3; | 35 optional string content_mime_type = 3; |
| 36 | 36 |
| 37 // The MD5 of contents of a regular file. | 37 // The MD5 of contents of a regular file. |
| 38 optional string file_md5 = 4; | 38 optional string file_md5 = 4; |
| 39 | 39 |
| 40 // File extension, including the dot, used for hosted documents | 40 // File extension, including the dot, used for hosted documents |
| 41 // (ex. ".gsheet" for hosted spreadsheet documents). | 41 // (ex. ".gsheet" for hosted spreadsheet documents). |
| 42 optional string document_extension = 5; | 42 optional string document_extension = 5; |
| 43 | 43 |
| 44 // True if the file is a hosted document. | 44 // True if the file is a hosted document. |
| 45 optional bool is_hosted_document = 6; | 45 optional bool is_hosted_document = 6; |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Represents GDataEntry, GDataFile, and GDataDirectory without children. | 48 // Represents DriveEntry, DriveFile, and DriveDirectory without children. |
| 49 message GDataEntryProto { | 49 message DriveEntryProto { |
| 50 optional PlatformFileInfoProto file_info = 1; | 50 optional PlatformFileInfoProto file_info = 1; |
| 51 optional string base_name = 2; | 51 optional string base_name = 2; |
| 52 optional string title = 3; | 52 optional string title = 3; |
| 53 optional string resource_id = 4; | 53 optional string resource_id = 4; |
| 54 optional string edit_url = 5; | 54 optional string edit_url = 5; |
| 55 optional string content_url = 6; | 55 optional string content_url = 6; |
| 56 optional string parent_resource_id = 7; | 56 optional string parent_resource_id = 7; |
| 57 // For a file, this is "resumable-edit-media" URL, used to update an | 57 // For a file, this is "resumable-edit-media" URL, used to update an |
| 58 // existing file. For a directory, this is "resumable-create-media" URL, | 58 // existing file. For a directory, this is "resumable-create-media" URL, |
| 59 // used to upload a new file to that directory. See | 59 // used to upload a new file to that directory. See |
| 60 // https://developers.google.com/google-apps/documents-list/ | 60 // https://developers.google.com/google-apps/documents-list/ |
| 61 optional string upload_url = 8; | 61 optional string upload_url = 8; |
| 62 | 62 |
| 63 // File specific information, such as MD5. | 63 // File specific information, such as MD5. |
| 64 optional GDataFileSpecificInfo file_specific_info = 9; | 64 optional DriveFileSpecificInfo file_specific_info = 9; |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Represents GDataDirectory. This message type is defined to keep children | 67 // Represents DriveDirectory. This message type is defined to keep children |
| 68 // separate from GDataEntryProto. This design allows us to get the metadata | 68 // separate from DriveEntryProto. This design allows us to get the metadata |
| 69 // of a directory efficiently as GDataEntryProto, without carrying the | 69 // of a directory efficiently as DriveEntryProto, without carrying the |
| 70 // metadata of children. | 70 // metadata of children. |
| 71 // | 71 // |
| 72 // TODO(satorux): With the new metadata storage system, we plan to store | 72 // TODO(satorux): With the new metadata storage system, we plan to store |
| 73 // children as pairs of base name and resource ID. We should remove this | 73 // children as pairs of base name and resource ID. We should remove this |
| 74 // message type once we get there. | 74 // message type once we get there. |
| 75 message GDataDirectoryProto { | 75 message DriveDirectoryProto { |
| 76 optional GDataEntryProto gdata_entry = 1; | 76 optional DriveEntryProto gdata_entry = 1; |
| 77 repeated GDataDirectoryProto child_directories = 7; | 77 repeated DriveDirectoryProto child_directories = 7; |
| 78 repeated GDataEntryProto child_files = 9; | 78 repeated DriveEntryProto child_files = 9; |
| 79 } | 79 } |
| 80 | 80 |
| 81 // Container for the root directory and the largest changestamp. | 81 // Container for the root directory and the largest changestamp. |
| 82 // TODO(satorux): Remove this: crbug.com/137862 | 82 // TODO(satorux): Remove this: crbug.com/137862 |
| 83 message GDataRootDirectoryProto { | 83 message DriveRootDirectoryProto { |
| 84 optional GDataDirectoryProto gdata_directory = 1; | 84 optional DriveDirectoryProto gdata_directory = 1; |
| 85 optional int64 largest_changestamp = 4; | 85 optional int64 largest_changestamp = 4; |
| 86 // Monotonically increasing version number, which is changed when | 86 // Monotonically increasing version number, which is changed when |
| 87 // incompatible change is made in the proto file. | 87 // incompatible change is made in the proto file. |
| 88 // kProtoVersion in gdata_files.h defines the current version. | 88 // kProtoVersion in gdata_files.h defines the current version. |
| 89 optional int32 version = 3; | 89 optional int32 version = 3; |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Message to store information of an existing cache file. | 92 // Message to store information of an existing cache file. |
| 93 // Cache files are stored in 'tmp' or 'persistent' directory under the | 93 // Cache files are stored in 'tmp' or 'persistent' directory under the |
| 94 // root cache directory. See GDataCache::GetCacheRootPath(). | 94 // root cache directory. See DriveCache::GetCacheRootPath(). |
| 95 message GDataCacheEntry { | 95 message DriveCacheEntry { |
| 96 // MD5 of the cache file. "local" if the file is locally modified. | 96 // MD5 of the cache file. "local" if the file is locally modified. |
| 97 optional string md5 = 1; | 97 optional string md5 = 1; |
| 98 | 98 |
| 99 // True if the file is present locally. | 99 // True if the file is present locally. |
| 100 optional bool is_present = 2; | 100 optional bool is_present = 2; |
| 101 | 101 |
| 102 // True if the file is pinned (i.e. available offline). | 102 // True if the file is pinned (i.e. available offline). |
| 103 optional bool is_pinned = 3; | 103 optional bool is_pinned = 3; |
| 104 | 104 |
| 105 // True if the file is dirty (i.e. modified locally). | 105 // True if the file is dirty (i.e. modified locally). |
| 106 optional bool is_dirty = 4; | 106 optional bool is_dirty = 4; |
| 107 | 107 |
| 108 // True if the file is a mounted archive file. | 108 // True if the file is a mounted archive file. |
| 109 optional bool is_mounted = 5; | 109 optional bool is_mounted = 5; |
| 110 | 110 |
| 111 // True if the file is in the persistent directory. | 111 // True if the file is in the persistent directory. |
| 112 optional bool is_persistent = 6; | 112 optional bool is_persistent = 6; |
| 113 | 113 |
| 114 // When adding a new state, be sure to update TestGDataCacheState and test | 114 // When adding a new state, be sure to update TestDriveCacheState and test |
| 115 // functions defined in gdata_test_util.cc. | 115 // functions defined in gdata_test_util.cc. |
| 116 } | 116 } |
| OLD | NEW |