| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 explicit Iterator(scoped_ptr<leveldb::Iterator> it); | 44 explicit Iterator(scoped_ptr<leveldb::Iterator> it); |
| 45 ~Iterator(); | 45 ~Iterator(); |
| 46 | 46 |
| 47 // Returns true if this iterator cannot advance any more and does not point | 47 // Returns true if this iterator cannot advance any more and does not point |
| 48 // to a valid entry. Get() and Advance() should not be called in such cases. | 48 // to a valid entry. Get() and Advance() should not be called in such cases. |
| 49 bool IsAtEnd() const; | 49 bool IsAtEnd() const; |
| 50 | 50 |
| 51 // Returns the entry currently pointed by this object. | 51 // Returns the entry currently pointed by this object. |
| 52 const ResourceEntry& Get() const; | 52 const ResourceEntry& Get() const; |
| 53 | 53 |
| 54 // Gets the cache entry which corresponds to |entry_| if available. |
| 55 bool GetCacheEntry(FileCacheEntry* cache_entry); |
| 56 |
| 54 // Advances to the next entry. | 57 // Advances to the next entry. |
| 55 void Advance(); | 58 void Advance(); |
| 56 | 59 |
| 57 // Returns true if this object has encountered any error. | 60 // Returns true if this object has encountered any error. |
| 58 bool HasError() const; | 61 bool HasError() const; |
| 59 | 62 |
| 60 private: | 63 private: |
| 61 ResourceEntry entry_; | 64 ResourceEntry entry_; |
| 62 scoped_ptr<leveldb::Iterator> it_; | 65 scoped_ptr<leveldb::Iterator> it_; |
| 63 | 66 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 187 |
| 185 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 188 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 186 | 189 |
| 187 DISALLOW_COPY_AND_ASSIGN(ResourceMetadataStorage); | 190 DISALLOW_COPY_AND_ASSIGN(ResourceMetadataStorage); |
| 188 }; | 191 }; |
| 189 | 192 |
| 190 } // namespace internal | 193 } // namespace internal |
| 191 } // namespace drive | 194 } // namespace drive |
| 192 | 195 |
| 193 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ | 196 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ |
| OLD | NEW |