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 #ifndef COMPONENTS_DRIVE_CHROMEOS_RESOURCE_METADATA_H_ | 5 #ifndef COMPONENTS_DRIVE_CHROMEOS_RESOURCE_METADATA_H_ |
6 #define COMPONENTS_DRIVE_CHROMEOS_RESOURCE_METADATA_H_ | 6 #define COMPONENTS_DRIVE_CHROMEOS_RESOURCE_METADATA_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 | 58 |
59 // Returns the largest changestamp. | 59 // Returns the largest changestamp. |
60 FileError GetLargestChangestamp(int64_t* out_value); | 60 FileError GetLargestChangestamp(int64_t* out_value); |
61 | 61 |
62 // Sets the largest changestamp. | 62 // Sets the largest changestamp. |
63 FileError SetLargestChangestamp(int64_t value); | 63 FileError SetLargestChangestamp(int64_t value); |
64 | 64 |
65 // Adds |entry| to the metadata tree based on its parent_local_id. | 65 // Adds |entry| to the metadata tree based on its parent_local_id. |
66 FileError AddEntry(const ResourceEntry& entry, std::string* out_id); | 66 FileError AddEntry(const ResourceEntry& entry, std::string* out_id); |
67 | 67 |
68 // Adds an entry which stores a Team Drive root directory. | |
69 FileError AddTeamDrive(const std::string& id, const std::string& name); | |
hashimoto
2017/04/07 07:56:41
No longer needed.
yamaguchi
2017/04/07 15:31:46
Done.
| |
70 | |
68 // Removes entry with |id| from its parent. | 71 // Removes entry with |id| from its parent. |
69 FileError RemoveEntry(const std::string& id); | 72 FileError RemoveEntry(const std::string& id); |
70 | 73 |
71 // Finds an entry (a file or a directory) by |id|. | 74 // Finds an entry (a file or a directory) by |id|. |
72 FileError GetResourceEntryById(const std::string& id, | 75 FileError GetResourceEntryById(const std::string& id, |
73 ResourceEntry* out_entry); | 76 ResourceEntry* out_entry); |
74 | 77 |
75 // Synchronous version of GetResourceEntryByPathOnUIThread(). | 78 // Synchronous version of GetResourceEntryByPathOnUIThread(). |
76 FileError GetResourceEntryByPath(const base::FilePath& file_path, | 79 FileError GetResourceEntryByPath(const base::FilePath& file_path, |
77 ResourceEntry* out_entry); | 80 ResourceEntry* out_entry); |
78 | 81 |
79 // Finds and reads a directory by |file_path|. | 82 // Finds and reads a directory by |file_path|. |
80 FileError ReadDirectoryByPath(const base::FilePath& file_path, | 83 FileError ReadDirectoryByPath(const base::FilePath& file_path, |
81 ResourceEntryVector* out_entries); | 84 ResourceEntryVector* out_entries); |
82 | 85 |
83 // Finds and reads a directory by |id|. | 86 // Finds and reads a directory by |id|. |
84 FileError ReadDirectoryById(const std::string& id, | 87 FileError ReadDirectoryById(const std::string& id, |
85 ResourceEntryVector* out_entries); | 88 ResourceEntryVector* out_entries); |
86 | 89 |
87 // Replaces an existing entry with the same local ID as |entry|. | 90 // Replaces an existing entry with the same local ID as |entry|. |
88 FileError RefreshEntry(const ResourceEntry& entry); | 91 FileError RefreshEntry(const ResourceEntry& entry); |
89 | 92 |
93 // Replaces an existing Team Drive entry with the same local ID as |id|. | |
94 FileError RefreshTeamDrive(const std::string& id, const std::string& name); | |
hashimoto
2017/04/07 07:56:41
ditto.
yamaguchi
2017/04/07 15:31:46
Done.
| |
95 | |
90 // Recursively gets directories under the entry pointed to by |id|. | 96 // Recursively gets directories under the entry pointed to by |id|. |
91 FileError GetSubDirectoriesRecursively( | 97 FileError GetSubDirectoriesRecursively( |
92 const std::string& id, | 98 const std::string& id, |
93 std::set<base::FilePath>* sub_directories); | 99 std::set<base::FilePath>* sub_directories); |
94 | 100 |
95 // Returns the id of the resource named |base_name| directly under | 101 // Returns the id of the resource named |base_name| directly under |
96 // the directory with |parent_local_id|. | 102 // the directory with |parent_local_id|. |
97 // If not found, empty string will be returned. | 103 // If not found, empty string will be returned. |
98 FileError GetChildId(const std::string& parent_local_id, | 104 FileError GetChildId(const std::string& parent_local_id, |
99 const std::string& base_name, | 105 const std::string& base_name, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 | 148 |
143 base::ThreadChecker thread_checker_; | 149 base::ThreadChecker thread_checker_; |
144 | 150 |
145 DISALLOW_COPY_AND_ASSIGN(ResourceMetadata); | 151 DISALLOW_COPY_AND_ASSIGN(ResourceMetadata); |
146 }; | 152 }; |
147 | 153 |
148 } // namespace internal | 154 } // namespace internal |
149 } // namespace drive | 155 } // namespace drive |
150 | 156 |
151 #endif // COMPONENTS_DRIVE_CHROMEOS_RESOURCE_METADATA_H_ | 157 #endif // COMPONENTS_DRIVE_CHROMEOS_RESOURCE_METADATA_H_ |
OLD | NEW |