| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // unused space in the file. It can be VERY SLOW. | 131 // unused space in the file. It can be VERY SLOW. |
| 132 void Vacuum(); | 132 void Vacuum(); |
| 133 | 133 |
| 134 // Try to trim the cache memory used by the database. If |aggressively| is | 134 // Try to trim the cache memory used by the database. If |aggressively| is |
| 135 // true try to trim all unused cache, otherwise trim by half. | 135 // true try to trim all unused cache, otherwise trim by half. |
| 136 void TrimMemory(bool aggressively); | 136 void TrimMemory(bool aggressively); |
| 137 | 137 |
| 138 // Razes the database. Returns true if successful. | 138 // Razes the database. Returns true if successful. |
| 139 bool Raze(); | 139 bool Raze(); |
| 140 | 140 |
| 141 // Returns true if the history backend should erase the full text search | |
| 142 // and archived history files as part of version 16 -> 17 migration. The | |
| 143 // time format changed in this revision, and these files would be much slower | |
| 144 // to migrate. Since the data is less important, they should be deleted. | |
| 145 // | |
| 146 // This flag will be valid after Init() is called. It will always be false | |
| 147 // when running on Windows. | |
| 148 bool needs_version_17_migration() const { | |
| 149 return needs_version_17_migration_; | |
| 150 } | |
| 151 | |
| 152 // Visit table functions ---------------------------------------------------- | 141 // Visit table functions ---------------------------------------------------- |
| 153 | 142 |
| 154 // Update the segment id of a visit. Return true on success. | 143 // Update the segment id of a visit. Return true on success. |
| 155 bool SetSegmentID(VisitID visit_id, SegmentID segment_id); | 144 bool SetSegmentID(VisitID visit_id, SegmentID segment_id); |
| 156 | 145 |
| 157 // Query the segment ID for the provided visit. Return 0 on failure or if the | 146 // Query the segment ID for the provided visit. Return 0 on failure or if the |
| 158 // visit id wasn't found. | 147 // visit id wasn't found. |
| 159 SegmentID GetSegmentID(VisitID visit_id); | 148 SegmentID GetSegmentID(VisitID visit_id); |
| 160 | 149 |
| 161 // Retrieves/Updates early expiration threshold, which specifies the earliest | 150 // Retrieves/Updates early expiration threshold, which specifies the earliest |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 #endif | 182 #endif |
| 194 | 183 |
| 195 // --------------------------------------------------------------------------- | 184 // --------------------------------------------------------------------------- |
| 196 | 185 |
| 197 sql::Connection::ErrorCallback error_callback_; | 186 sql::Connection::ErrorCallback error_callback_; |
| 198 sql::Connection db_; | 187 sql::Connection db_; |
| 199 sql::MetaTable meta_table_; | 188 sql::MetaTable meta_table_; |
| 200 | 189 |
| 201 base::Time cached_early_expiration_threshold_; | 190 base::Time cached_early_expiration_threshold_; |
| 202 | 191 |
| 203 // See the getters above. | |
| 204 bool needs_version_17_migration_; | |
| 205 | |
| 206 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); | 192 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); |
| 207 }; | 193 }; |
| 208 | 194 |
| 209 } // namespace history | 195 } // namespace history |
| 210 | 196 |
| 211 #endif // CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ | 197 #endif // CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_ |
| OLD | NEW |