| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_HISTORY_HISTORY_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ |
| 6 #define CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Query the segment ID for the provided visit. Return 0 on failure or if the | 142 // Query the segment ID for the provided visit. Return 0 on failure or if the |
| 143 // visit id wasn't found. | 143 // visit id wasn't found. |
| 144 SegmentID GetSegmentID(VisitID visit_id); | 144 SegmentID GetSegmentID(VisitID visit_id); |
| 145 | 145 |
| 146 // Retrieves/Updates early expiration threshold, which specifies the earliest | 146 // Retrieves/Updates early expiration threshold, which specifies the earliest |
| 147 // known point in history that may possibly to contain visits suitable for | 147 // known point in history that may possibly to contain visits suitable for |
| 148 // early expiration (AUTO_SUBFRAMES). | 148 // early expiration (AUTO_SUBFRAMES). |
| 149 virtual base::Time GetEarlyExpirationThreshold(); | 149 virtual base::Time GetEarlyExpirationThreshold(); |
| 150 virtual void UpdateEarlyExpirationThreshold(base::Time threshold); | 150 virtual void UpdateEarlyExpirationThreshold(base::Time threshold); |
| 151 | 151 |
| 152 // Returns the database connection so that unit tests can directly access it. |
| 153 sql::Connection* get_db_for_testing() { return &db_; } |
| 154 |
| 152 private: | 155 private: |
| 153 #if defined(OS_ANDROID) | 156 #if defined(OS_ANDROID) |
| 154 // AndroidProviderBackend uses the |db_|. | 157 // AndroidProviderBackend uses the |db_|. |
| 155 friend class AndroidProviderBackend; | 158 friend class AndroidProviderBackend; |
| 156 FRIEND_TEST_ALL_PREFIXES(AndroidURLsMigrationTest, MigrateToVersion22); | 159 FRIEND_TEST_ALL_PREFIXES(AndroidURLsMigrationTest, MigrateToVersion22); |
| 157 #endif | 160 #endif |
| 158 friend class InMemoryURLIndexTest; | 161 friend class InMemoryURLIndexBaseTest; |
| 159 FRIEND_TEST_ALL_PREFIXES(IconMappingMigrationTest, TestIconMappingMigration); | 162 FRIEND_TEST_ALL_PREFIXES(IconMappingMigrationTest, TestIconMappingMigration); |
| 160 | 163 |
| 161 // Overridden from URLDatabase: | 164 // Overridden from URLDatabase: |
| 162 virtual sql::Connection& GetDB() OVERRIDE; | 165 virtual sql::Connection& GetDB() OVERRIDE; |
| 163 | 166 |
| 164 // Overridden from DownloadDatabase: | 167 // Overridden from DownloadDatabase: |
| 165 virtual sql::MetaTable& GetMetaTable() OVERRIDE; | 168 virtual sql::MetaTable& GetMetaTable() OVERRIDE; |
| 166 | 169 |
| 167 // Migration ----------------------------------------------------------------- | 170 // Migration ----------------------------------------------------------------- |
| 168 | 171 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 190 | 193 |
| 191 // See the getters above. | 194 // See the getters above. |
| 192 bool needs_version_17_migration_; | 195 bool needs_version_17_migration_; |
| 193 | 196 |
| 194 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); | 197 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); |
| 195 }; | 198 }; |
| 196 | 199 |
| 197 } // namespace history | 200 } // namespace history |
| 198 | 201 |
| 199 #endif // CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ | 202 #endif // CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ |
| OLD | NEW |