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 12 matching lines...) Expand all Loading... |
23 class ResourceMetadataHeader; | 23 class ResourceMetadataHeader; |
24 | 24 |
25 typedef base::Callback<void(const ResourceEntry& entry)> IterateCallback; | 25 typedef base::Callback<void(const ResourceEntry& entry)> IterateCallback; |
26 | 26 |
27 // Storage for ResourceMetadata which is responsible to manage entry info | 27 // Storage for ResourceMetadata which is responsible to manage entry info |
28 // and child-parent relationships between entries. | 28 // and child-parent relationships between entries. |
29 class ResourceMetadataStorage { | 29 class ResourceMetadataStorage { |
30 public: | 30 public: |
31 // This should be incremented when incompatibility change is made to DB | 31 // This should be incremented when incompatibility change is made to DB |
32 // format. | 32 // format. |
33 static const int kDBVersion = 5; | 33 static const int kDBVersion = 6; |
34 | 34 |
35 explicit ResourceMetadataStorage(const base::FilePath& directory_path); | 35 explicit ResourceMetadataStorage(const base::FilePath& directory_path); |
36 virtual ~ResourceMetadataStorage(); | 36 virtual ~ResourceMetadataStorage(); |
37 | 37 |
38 // Initializes this object. | 38 // Initializes this object. |
39 bool Initialize(); | 39 bool Initialize(); |
40 | 40 |
41 // Sets the largest changestamp. | 41 // Sets the largest changestamp. |
42 bool SetLargestChangestamp(int64 largest_changestamp); | 42 bool SetLargestChangestamp(int64 largest_changestamp); |
43 | 43 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 // Entries stored in this storage. | 86 // Entries stored in this storage. |
87 scoped_ptr<leveldb::DB> resource_map_; | 87 scoped_ptr<leveldb::DB> resource_map_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(ResourceMetadataStorage); | 89 DISALLOW_COPY_AND_ASSIGN(ResourceMetadataStorage); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace drive | 92 } // namespace drive |
93 | 93 |
94 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ | 94 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_METADATA_STORAGE_H_ |
OLD | NEW |