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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <unordered_map> | 14 #include <unordered_map> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/containers/hash_tables.h" | 17 #include "base/containers/hash_tables.h" |
18 #include "base/hash.h" | 18 #include "base/hash.h" |
19 #include "base/macros.h" | 19 #include "base/macros.h" |
20 #include "base/memory/scoped_vector.h" | |
21 #include "chrome/browser/sync_file_system/drive_backend/metadata_database_index_
interface.h" | 20 #include "chrome/browser/sync_file_system/drive_backend/metadata_database_index_
interface.h" |
22 #include "chrome/browser/sync_file_system/drive_backend/tracker_id_set.h" | 21 #include "chrome/browser/sync_file_system/drive_backend/tracker_id_set.h" |
23 | 22 |
24 namespace sync_file_system { | 23 namespace sync_file_system { |
25 namespace drive_backend { | 24 namespace drive_backend { |
26 | 25 |
27 class FileMetadata; | 26 class FileMetadata; |
28 class FileTracker; | 27 class FileTracker; |
29 class LevelDBWrapper; | 28 class LevelDBWrapper; |
30 class ServiceMetadata; | 29 class ServiceMetadata; |
(...skipping 11 matching lines...) Expand all Loading... |
42 }; | 41 }; |
43 | 42 |
44 } // namespace BASE_HASH_NAMESPACE | 43 } // namespace BASE_HASH_NAMESPACE |
45 | 44 |
46 namespace sync_file_system { | 45 namespace sync_file_system { |
47 namespace drive_backend { | 46 namespace drive_backend { |
48 | 47 |
49 struct DatabaseContents { | 48 struct DatabaseContents { |
50 DatabaseContents(); | 49 DatabaseContents(); |
51 ~DatabaseContents(); | 50 ~DatabaseContents(); |
52 ScopedVector<FileMetadata> file_metadata; | 51 std::vector<std::unique_ptr<FileMetadata>> file_metadata; |
53 ScopedVector<FileTracker> file_trackers; | 52 std::vector<std::unique_ptr<FileTracker>> file_trackers; |
54 }; | 53 }; |
55 | 54 |
56 // Maintains indexes of MetadataDatabase on memory. | 55 // Maintains indexes of MetadataDatabase on memory. |
57 class MetadataDatabaseIndex : public MetadataDatabaseIndexInterface { | 56 class MetadataDatabaseIndex : public MetadataDatabaseIndexInterface { |
58 public: | 57 public: |
59 ~MetadataDatabaseIndex() override; | 58 ~MetadataDatabaseIndex() override; |
60 | 59 |
61 static std::unique_ptr<MetadataDatabaseIndex> Create(LevelDBWrapper* db); | 60 static std::unique_ptr<MetadataDatabaseIndex> Create(LevelDBWrapper* db); |
62 static std::unique_ptr<MetadataDatabaseIndex> CreateForTesting( | 61 static std::unique_ptr<MetadataDatabaseIndex> CreateForTesting( |
63 DatabaseContents* contents, | 62 DatabaseContents* contents, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 DirtyTrackers dirty_trackers_; | 161 DirtyTrackers dirty_trackers_; |
163 DirtyTrackers demoted_dirty_trackers_; | 162 DirtyTrackers demoted_dirty_trackers_; |
164 | 163 |
165 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndex); | 164 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndex); |
166 }; | 165 }; |
167 | 166 |
168 } // namespace drive_backend | 167 } // namespace drive_backend |
169 } // namespace sync_file_system | 168 } // namespace sync_file_system |
170 | 169 |
171 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX
_H_ | 170 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX
_H_ |
OLD | NEW |