OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_URL_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_URL_DATABASE_H_ |
6 #define CHROME_BROWSER_HISTORY_URL_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_URL_DATABASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "chrome/browser/history/history_types.h" | 10 #include "chrome/browser/history/history_types.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // table creation functions so the in-memory database and the temporary tables | 245 // table creation functions so the in-memory database and the temporary tables |
246 // used when clearing history can populate the table and then create the | 246 // used when clearing history can populate the table and then create the |
247 // index, which is faster than the reverse. | 247 // index, which is faster than the reverse. |
248 // | 248 // |
249 // is_temporary is false when generating the "regular" URLs table. The expirer | 249 // is_temporary is false when generating the "regular" URLs table. The expirer |
250 // sets this to true to generate the temporary table, which will have a | 250 // sets this to true to generate the temporary table, which will have a |
251 // different name but the same schema. | 251 // different name but the same schema. |
252 bool CreateURLTable(bool is_temporary); | 252 bool CreateURLTable(bool is_temporary); |
253 // We have two tiers of indices for the URL table. The main tier is used by | 253 // We have two tiers of indices for the URL table. The main tier is used by |
254 // all URL databases, and is an index over the URL itself. | 254 // all URL databases, and is an index over the URL itself. |
255 void CreateMainURLIndex(); | 255 bool CreateMainURLIndex(); |
256 | 256 |
257 // Ensures the keyword search terms table exists. | 257 // Ensures the keyword search terms table exists. |
258 bool InitKeywordSearchTermsTable(); | 258 bool InitKeywordSearchTermsTable(); |
259 | 259 |
260 // Creates the indices used for keyword search terms. | 260 // Creates the indices used for keyword search terms. |
261 void CreateKeywordSearchTermsIndices(); | 261 bool CreateKeywordSearchTermsIndices(); |
262 | 262 |
263 // Deletes the keyword search terms table. | 263 // Deletes the keyword search terms table. |
264 bool DropKeywordSearchTermsTable(); | 264 bool DropKeywordSearchTermsTable(); |
265 | 265 |
266 // Inserts the given URL row into the URLs table, using the regular table | 266 // Inserts the given URL row into the URLs table, using the regular table |
267 // if is_temporary is false, or the temporary URL table if is temporary is | 267 // if is_temporary is false, or the temporary URL table if is temporary is |
268 // true. The temporary table may only be used in between | 268 // true. The temporary table may only be used in between |
269 // CreateTemporaryURLTable() and CommitTemporaryURLTable(). | 269 // CreateTemporaryURLTable() and CommitTemporaryURLTable(). |
270 URLID AddURLInternal(const URLRow& info, bool is_temporary); | 270 URLID AddURLInternal(const URLRow& info, bool is_temporary); |
271 | 271 |
(...skipping 20 matching lines...) Expand all Loading... |
292 // the macro if you want to put this in the middle of an otherwise constant | 292 // the macro if you want to put this in the middle of an otherwise constant |
293 // string, it will save time doing string appends. If you have to build a SQL | 293 // string, it will save time doing string appends. If you have to build a SQL |
294 // string dynamically anyway, use the constant, it will save space. | 294 // string dynamically anyway, use the constant, it will save space. |
295 #define HISTORY_URL_ROW_FIELDS \ | 295 #define HISTORY_URL_ROW_FIELDS \ |
296 " urls.id, urls.url, urls.title, urls.visit_count, urls.typed_count, " \ | 296 " urls.id, urls.url, urls.title, urls.visit_count, urls.typed_count, " \ |
297 "urls.last_visit_time, urls.hidden " | 297 "urls.last_visit_time, urls.hidden " |
298 | 298 |
299 } // history | 299 } // history |
300 | 300 |
301 #endif // CHROME_BROWSER_HISTORY_URL_DATABASE_H_ | 301 #endif // CHROME_BROWSER_HISTORY_URL_DATABASE_H_ |
OLD | NEW |