| 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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 // Returns the ID of the parent's child. | 160 // Returns the ID of the parent's child. |
| 161 FileError GetChild(const std::string& parent_id, | 161 FileError GetChild(const std::string& parent_id, |
| 162 const std::string& child_name, | 162 const std::string& child_name, |
| 163 std::string* child_id); | 163 std::string* child_id); |
| 164 | 164 |
| 165 // Returns the IDs of the parent's children. | 165 // Returns the IDs of the parent's children. |
| 166 FileError GetChildren(const std::string& parent_id, | 166 FileError GetChildren(const std::string& parent_id, |
| 167 std::vector<std::string>* children); | 167 std::vector<std::string>* children); |
| 168 | 168 |
| 169 // Puts the cache entry to this storage. | |
| 170 FileError PutCacheEntry(const std::string& id, const FileCacheEntry& entry); | |
| 171 | |
| 172 // Gets a cache entry stored in this storage. | 169 // Gets a cache entry stored in this storage. |
| 173 FileError GetCacheEntry(const std::string& id, FileCacheEntry* out_entry); | 170 FileError GetCacheEntry(const std::string& id, FileCacheEntry* out_entry); |
| 174 | 171 |
| 175 // Removes a cache entry from this storage. | |
| 176 FileError RemoveCacheEntry(const std::string& id); | |
| 177 | |
| 178 // Returns an object to iterate over cache entries stored in this storage. | |
| 179 scoped_ptr<CacheEntryIterator> GetCacheEntryIterator(); | |
| 180 | |
| 181 // Returns the local ID associated with the given resource ID. | 172 // Returns the local ID associated with the given resource ID. |
| 182 FileError GetIdByResourceId(const std::string& resource_id, | 173 FileError GetIdByResourceId(const std::string& resource_id, |
| 183 std::string* out_id); | 174 std::string* out_id); |
| 184 | 175 |
| 185 private: | 176 private: |
| 186 friend class ResourceMetadataStorageTest; | 177 friend class ResourceMetadataStorageTest; |
| 187 | 178 |
| 188 // To destruct this object, use Destroy(). | 179 // To destruct this object, use Destroy(). |
| 189 ~ResourceMetadataStorage(); | 180 ~ResourceMetadataStorage(); |
| 190 | 181 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 214 | 205 |
| 215 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 206 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 216 | 207 |
| 217 DISALLOW_COPY_AND_ASSIGN(ResourceMetadataStorage); | 208 DISALLOW_COPY_AND_ASSIGN(ResourceMetadataStorage); |
| 218 }; | 209 }; |
| 219 | 210 |
| 220 } // namespace internal | 211 } // namespace internal |
| 221 } // namespace drive | 212 } // namespace drive |
| 222 | 213 |
| 223 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ | 214 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ |
| OLD | NEW |