OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 ScopedVector<FileTracker> file_trackers; | 55 ScopedVector<FileTracker> file_trackers; |
56 }; | 56 }; |
57 | 57 |
58 // Maintains indexes of MetadataDatabase on memory. | 58 // Maintains indexes of MetadataDatabase on memory. |
59 class MetadataDatabaseIndex : public MetadataDatabaseIndexInterface { | 59 class MetadataDatabaseIndex : public MetadataDatabaseIndexInterface { |
60 public: | 60 public: |
61 virtual ~MetadataDatabaseIndex(); | 61 virtual ~MetadataDatabaseIndex(); |
62 | 62 |
63 static scoped_ptr<MetadataDatabaseIndex> Create(LevelDBWrapper* db); | 63 static scoped_ptr<MetadataDatabaseIndex> Create(LevelDBWrapper* db); |
64 static scoped_ptr<MetadataDatabaseIndex> CreateForTesting( | 64 static scoped_ptr<MetadataDatabaseIndex> CreateForTesting( |
65 DatabaseContents* contents); | 65 DatabaseContents* contents, LevelDBWrapper* db); |
66 | 66 |
67 // MetadataDatabaseIndexInterface overrides. | 67 // MetadataDatabaseIndexInterface overrides. |
68 virtual bool GetFileMetadata( | 68 virtual bool GetFileMetadata( |
69 const std::string& file_id, FileMetadata* metadata) const OVERRIDE; | 69 const std::string& file_id, FileMetadata* metadata) const OVERRIDE; |
70 virtual bool GetFileTracker( | 70 virtual bool GetFileTracker( |
71 int64 tracker_id, FileTracker* tracker) const OVERRIDE; | 71 int64 tracker_id, FileTracker* tracker) const OVERRIDE; |
72 virtual void StoreFileMetadata(scoped_ptr<FileMetadata> metadata) OVERRIDE; | 72 virtual void StoreFileMetadata(scoped_ptr<FileMetadata> metadata) OVERRIDE; |
73 virtual void StoreFileTracker(scoped_ptr<FileTracker> tracker) OVERRIDE; | 73 virtual void StoreFileTracker(scoped_ptr<FileTracker> tracker) OVERRIDE; |
74 virtual void RemoveFileMetadata(const std::string& file_id) OVERRIDE; | 74 virtual void RemoveFileMetadata(const std::string& file_id) OVERRIDE; |
75 virtual void RemoveFileTracker(int64 tracker_id) OVERRIDE; | 75 virtual void RemoveFileTracker(int64 tracker_id) OVERRIDE; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 DirtyTrackers dirty_trackers_; | 158 DirtyTrackers dirty_trackers_; |
159 DirtyTrackers demoted_dirty_trackers_; | 159 DirtyTrackers demoted_dirty_trackers_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndex); | 161 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndex); |
162 }; | 162 }; |
163 | 163 |
164 } // namespace drive_backend | 164 } // namespace drive_backend |
165 } // namespace sync_file_system | 165 } // namespace sync_file_system |
166 | 166 |
167 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX
_H_ | 167 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX
_H_ |
OLD | NEW |