| 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 11 matching lines...) Expand all Loading... |
| 22 class FileMetadata; | 22 class FileMetadata; |
| 23 class FileTracker; | 23 class FileTracker; |
| 24 class LevelDBWrapper; | 24 class LevelDBWrapper; |
| 25 class ServiceMetadata; | 25 class ServiceMetadata; |
| 26 | 26 |
| 27 } // namespace drive_backend | 27 } // namespace drive_backend |
| 28 } // namespace sync_file_system | 28 } // namespace sync_file_system |
| 29 | 29 |
| 30 namespace BASE_HASH_NAMESPACE { | 30 namespace BASE_HASH_NAMESPACE { |
| 31 | 31 |
| 32 #if defined(COMPILER_GCC) | |
| 33 template<> struct hash<sync_file_system::drive_backend::ParentIDAndTitle> { | 32 template<> struct hash<sync_file_system::drive_backend::ParentIDAndTitle> { |
| 34 std::size_t operator()( | 33 std::size_t operator()( |
| 35 const sync_file_system::drive_backend::ParentIDAndTitle& v) const { | 34 const sync_file_system::drive_backend::ParentIDAndTitle& v) const { |
| 36 return base::HashInts64(v.parent_id, hash<std::string>()(v.title)); | 35 return base::HashInts64(v.parent_id, hash<std::string>()(v.title)); |
| 37 } | 36 } |
| 38 }; | 37 }; |
| 39 #elif defined(COMPILER_MSVC) | |
| 40 inline size_t hash_value( | |
| 41 const sync_file_system::drive_backend::ParentIDAndTitle& v) { | |
| 42 return base::HashInts64(v.parent_id, hash_value(v.title)); | |
| 43 } | |
| 44 #endif // COMPILER | |
| 45 | 38 |
| 46 } // namespace BASE_HASH_NAMESPACE | 39 } // namespace BASE_HASH_NAMESPACE |
| 47 | 40 |
| 48 namespace sync_file_system { | 41 namespace sync_file_system { |
| 49 namespace drive_backend { | 42 namespace drive_backend { |
| 50 | 43 |
| 51 struct DatabaseContents { | 44 struct DatabaseContents { |
| 52 DatabaseContents(); | 45 DatabaseContents(); |
| 53 ~DatabaseContents(); | 46 ~DatabaseContents(); |
| 54 ScopedVector<FileMetadata> file_metadata; | 47 ScopedVector<FileMetadata> file_metadata; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 DirtyTrackers dirty_trackers_; | 153 DirtyTrackers dirty_trackers_; |
| 161 DirtyTrackers demoted_dirty_trackers_; | 154 DirtyTrackers demoted_dirty_trackers_; |
| 162 | 155 |
| 163 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndex); | 156 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndex); |
| 164 }; | 157 }; |
| 165 | 158 |
| 166 } // namespace drive_backend | 159 } // namespace drive_backend |
| 167 } // namespace sync_file_system | 160 } // namespace sync_file_system |
| 168 | 161 |
| 169 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX
_H_ | 162 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX
_H_ |
| OLD | NEW |