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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 class ResourceEntry; | 23 class ResourceEntry; |
24 class ResourceMetadataHeader; | 24 class ResourceMetadataHeader; |
25 | 25 |
26 // Storage for ResourceMetadata which is responsible to manage entry info | 26 // Storage for ResourceMetadata which is responsible to manage entry info |
27 // and child-parent relationships between entries. | 27 // and child-parent relationships between entries. |
28 class ResourceMetadataStorage { | 28 class ResourceMetadataStorage { |
29 public: | 29 public: |
30 // This should be incremented when incompatibility change is made to DB | 30 // This should be incremented when incompatibility change is made to DB |
31 // format. | 31 // format. |
32 static const int kDBVersion = 5; | 32 static const int kDBVersion = 6; |
33 | 33 |
34 class Iterator { | 34 class Iterator { |
35 public: | 35 public: |
36 explicit Iterator(scoped_ptr<leveldb::Iterator> it); | 36 explicit Iterator(scoped_ptr<leveldb::Iterator> it); |
37 ~Iterator(); | 37 ~Iterator(); |
38 | 38 |
39 // Returns true if this iterator cannot advance any more. | 39 // Returns true if this iterator cannot advance any more. |
40 bool IsAtEnd() const; | 40 bool IsAtEnd() const; |
41 | 41 |
42 // Returns the entry currently pointed by this object. | 42 // Returns the entry currently pointed by this object. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 // Entries stored in this storage. | 109 // Entries stored in this storage. |
110 scoped_ptr<leveldb::DB> resource_map_; | 110 scoped_ptr<leveldb::DB> resource_map_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(ResourceMetadataStorage); | 112 DISALLOW_COPY_AND_ASSIGN(ResourceMetadataStorage); |
113 }; | 113 }; |
114 | 114 |
115 } // namespace drive | 115 } // namespace drive |
116 | 116 |
117 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ | 117 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ |
OLD | NEW |