| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "chrome/browser/history/download_database.h" | 9 #include "chrome/browser/history/download_database.h" |
| 10 #include "chrome/browser/history/history.h" | 10 #include "chrome/browser/history/history.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 SegmentID GetSegmentID(VisitID visit_id); | 122 SegmentID GetSegmentID(VisitID visit_id); |
| 123 | 123 |
| 124 // Drops the starred table and star_id from urls. | 124 // Drops the starred table and star_id from urls. |
| 125 bool MigrateFromVersion15ToVersion16(); | 125 bool MigrateFromVersion15ToVersion16(); |
| 126 | 126 |
| 127 private: | 127 private: |
| 128 // Implemented for URLDatabase. | 128 // Implemented for URLDatabase. |
| 129 virtual sqlite3* GetDB(); | 129 virtual sqlite3* GetDB(); |
| 130 virtual SqliteStatementCache& GetStatementCache(); | 130 virtual SqliteStatementCache& GetStatementCache(); |
| 131 | 131 |
| 132 // Primes the sqlite cache on startup by filling it with the file in sequence | |
| 133 // until there is no more data or the cache is full. Since this is one | |
| 134 // contiguous read operation, it is much faster than letting the pages come | |
| 135 // in on-demand (which causes lots of seeks). | |
| 136 void PrimeCache(); | |
| 137 | |
| 138 // Migration ----------------------------------------------------------------- | 132 // Migration ----------------------------------------------------------------- |
| 139 | 133 |
| 140 // Makes sure the version is up-to-date, updating if necessary. If the | 134 // Makes sure the version is up-to-date, updating if necessary. If the |
| 141 // database is too old to migrate, the user will be notified. In this case, or | 135 // database is too old to migrate, the user will be notified. In this case, or |
| 142 // for other errors, false will be returned. True means it is up-to-date and | 136 // for other errors, false will be returned. True means it is up-to-date and |
| 143 // ready for use. | 137 // ready for use. |
| 144 // | 138 // |
| 145 // This assumes it is called from the init function inside a transaction. It | 139 // This assumes it is called from the init function inside a transaction. It |
| 146 // may commit the transaction and start a new one if migration requires it. | 140 // may commit the transaction and start a new one if migration requires it. |
| 147 InitStatus EnsureCurrentVersion(const FilePath& tmp_bookmarks_path); | 141 InitStatus EnsureCurrentVersion(const FilePath& tmp_bookmarks_path); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 162 SqliteStatementCache* statement_cache_; | 156 SqliteStatementCache* statement_cache_; |
| 163 | 157 |
| 164 MetaTableHelper meta_table_; | 158 MetaTableHelper meta_table_; |
| 165 | 159 |
| 166 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); | 160 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); |
| 167 }; | 161 }; |
| 168 | 162 |
| 169 } // history | 163 } // history |
| 170 | 164 |
| 171 #endif // CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ | 165 #endif // CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ |
| OLD | NEW |