Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/metadata_database_index.h

Issue 2605433002: Remove base::ScopedPtrHashMap from chrome/browser/sync_file_system/drive_backend/ (Closed)
Patch Set: no crash Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/metadata_database_index.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 15 #include <vector>
15 16
16 #include "base/containers/hash_tables.h" 17 #include "base/containers/hash_tables.h"
17 #include "base/containers/scoped_ptr_hash_map.h" 18 #include "base/containers/scoped_ptr_hash_map.h"
18 #include "base/hash.h" 19 #include "base/hash.h"
19 #include "base/macros.h" 20 #include "base/macros.h"
20 #include "base/memory/scoped_vector.h" 21 #include "base/memory/scoped_vector.h"
21 #include "chrome/browser/sync_file_system/drive_backend/metadata_database_index_ interface.h" 22 #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" 23 #include "chrome/browser/sync_file_system/drive_backend/tracker_id_set.h"
23 24
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void SetNextTrackerID(int64_t next_tracker_id) const override; 98 void SetNextTrackerID(int64_t next_tracker_id) const override;
98 bool IsSyncRootRevalidated() const override; 99 bool IsSyncRootRevalidated() const override;
99 int64_t GetSyncRootTrackerID() const override; 100 int64_t GetSyncRootTrackerID() const override;
100 int64_t GetLargestChangeID() const override; 101 int64_t GetLargestChangeID() const override;
101 int64_t GetNextTrackerID() const override; 102 int64_t GetNextTrackerID() const override;
102 std::vector<std::string> GetRegisteredAppIDs() const override; 103 std::vector<std::string> GetRegisteredAppIDs() const override;
103 std::vector<int64_t> GetAllTrackerIDs() const override; 104 std::vector<int64_t> GetAllTrackerIDs() const override;
104 std::vector<std::string> GetAllMetadataIDs() const override; 105 std::vector<std::string> GetAllMetadataIDs() const override;
105 106
106 private: 107 private:
107 typedef base::ScopedPtrHashMap<std::string, std::unique_ptr<FileMetadata>> 108 typedef std::unordered_map<std::string, std::unique_ptr<FileMetadata>>
108 MetadataByID; 109 MetadataByID;
109 typedef base::ScopedPtrHashMap<int64_t, std::unique_ptr<FileTracker>> 110 typedef std::unordered_map<int64_t, std::unique_ptr<FileTracker>> TrackerByID;
110 TrackerByID;
111 typedef base::hash_map<std::string, TrackerIDSet> TrackerIDsByFileID; 111 typedef base::hash_map<std::string, TrackerIDSet> TrackerIDsByFileID;
112 typedef base::hash_map<std::string, TrackerIDSet> TrackerIDsByTitle; 112 typedef base::hash_map<std::string, TrackerIDSet> TrackerIDsByTitle;
113 typedef std::map<int64_t, TrackerIDsByTitle> TrackerIDsByParentAndTitle; 113 typedef std::map<int64_t, TrackerIDsByTitle> TrackerIDsByParentAndTitle;
114 typedef base::hash_map<std::string, int64_t> TrackerIDByAppID; 114 typedef base::hash_map<std::string, int64_t> TrackerIDByAppID;
115 typedef base::hash_set<std::string> FileIDSet; 115 typedef base::hash_set<std::string> FileIDSet;
116 typedef base::hash_set<ParentIDAndTitle> PathSet; 116 typedef base::hash_set<ParentIDAndTitle> PathSet;
117 typedef std::set<int64_t> DirtyTrackers; 117 typedef std::set<int64_t> DirtyTrackers;
118 118
119 friend class MetadataDatabaseTest; 119 friend class MetadataDatabaseTest;
120 120
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 DirtyTrackers dirty_trackers_; 163 DirtyTrackers dirty_trackers_;
164 DirtyTrackers demoted_dirty_trackers_; 164 DirtyTrackers demoted_dirty_trackers_;
165 165
166 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndex); 166 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndex);
167 }; 167 };
168 168
169 } // namespace drive_backend 169 } // namespace drive_backend
170 } // namespace sync_file_system 170 } // namespace sync_file_system
171 171
172 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX _H_ 172 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX _H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/metadata_database_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698