Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: chrome/browser/history/url_database.h

Issue 235863023: Eliminate the archived history database and clean up related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "chrome/browser/history/history_types.h" 9 #include "chrome/browser/history/history_types.h"
10 #include "chrome/browser/history/query_parser.h" 10 #include "chrome/browser/history/query_parser.h"
11 #include "chrome/browser/search_engines/template_url_id.h" 11 #include "chrome/browser/search_engines/template_url_id.h"
12 #include "sql/statement.h" 12 #include "sql/statement.h"
13 13
14 class GURL; 14 class GURL;
15 15
16 namespace sql { 16 namespace sql {
17 class Connection; 17 class Connection;
18 } 18 }
19 19
20 namespace history { 20 namespace history {
21 21
22 class VisitDatabase; // For friend statement. 22 class VisitDatabase; // For friend statement.
23 23
24 // Encapsulates an SQL database that holds URL info. This is a subset of the 24 // Encapsulates an SQL database that holds URL info. This is a subset of the
25 // full history data. We split this class' functionality out from the larger 25 // full history data. We split this class' functionality out from the larger
26 // HistoryDatabase class to support maintaining separate databases of URLs with 26 // HistoryDatabase class to support maintaining separate databases of URLs with
27 // different capabilities (for example, in-memory, or archived). 27 // different capabilities (for example, the in-memory database).
28 // 28 //
29 // This is refcounted to support calling InvokeLater() with some of its methods 29 // This is refcounted to support calling InvokeLater() with some of its methods
30 // (necessary to maintain ordering of DB operations). 30 // (necessary to maintain ordering of DB operations).
31 class URLDatabase { 31 class URLDatabase {
32 public: 32 public:
33 // Must call CreateURLTable() and CreateURLIndexes() before using to make 33 // Must call CreateURLTable() and CreateURLIndexes() before using to make
34 // sure the database is initialized. 34 // sure the database is initialized.
35 URLDatabase(); 35 URLDatabase();
36 36
37 // This object must be destroyed on the thread where all accesses are 37 // This object must be destroyed on the thread where all accesses are
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // Adds a row to the temporary URL table. This must be called between 104 // Adds a row to the temporary URL table. This must be called between
105 // CreateTemporaryURLTable() and CommitTemporaryURLTable() (see those for more 105 // CreateTemporaryURLTable() and CommitTemporaryURLTable() (see those for more
106 // info). The ID of the URL will change in the temporary table, so the new ID 106 // info). The ID of the URL will change in the temporary table, so the new ID
107 // is returned. Returns 0 on failure. 107 // is returned. Returns 0 on failure.
108 URLID AddTemporaryURL(const URLRow& row) { 108 URLID AddTemporaryURL(const URLRow& row) {
109 return AddURLInternal(row, true); 109 return AddURLInternal(row, true);
110 } 110 }
111 111
112 // Ends the mass-deleting by replacing the original URL table with the 112 // Ends the mass-deleting by replacing the original URL table with the
113 // temporary one created in CreateTemporaryURLTable. Returns true on success. 113 // temporary one created in CreateTemporaryURLTable. Returns true on success.
114 // 114 bool CommitTemporaryURLTable();
115 // This function does not create the supplimentary indices. It is virtual so
engedy 2014/04/16 18:08:10 Note: Removing this as there is no CreateSupplimen
116 // that the main history database can provide this additional behavior.
117 virtual bool CommitTemporaryURLTable();
118 115
119 // Enumeration --------------------------------------------------------------- 116 // Enumeration ---------------------------------------------------------------
120 117
121 // A basic enumerator to enumerate urls database. 118 // A basic enumerator to enumerate urls database.
122 class URLEnumeratorBase { 119 class URLEnumeratorBase {
123 public: 120 public:
124 URLEnumeratorBase(); 121 URLEnumeratorBase();
125 virtual ~URLEnumeratorBase(); 122 virtual ~URLEnumeratorBase();
126 123
127 private: 124 private:
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 // the macro if you want to put this in the middle of an otherwise constant 299 // the macro if you want to put this in the middle of an otherwise constant
303 // string, it will save time doing string appends. If you have to build a SQL 300 // string, it will save time doing string appends. If you have to build a SQL
304 // string dynamically anyway, use the constant, it will save space. 301 // string dynamically anyway, use the constant, it will save space.
305 #define HISTORY_URL_ROW_FIELDS \ 302 #define HISTORY_URL_ROW_FIELDS \
306 " urls.id, urls.url, urls.title, urls.visit_count, urls.typed_count, " \ 303 " urls.id, urls.url, urls.title, urls.visit_count, urls.typed_count, " \
307 "urls.last_visit_time, urls.hidden " 304 "urls.last_visit_time, urls.hidden "
308 305
309 } // namespace history 306 } // namespace history
310 307
311 #endif // CHROME_BROWSER_HISTORY_URL_DATABASE_H_ 308 #endif // CHROME_BROWSER_HISTORY_URL_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698