summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history/history_database.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 05:01:42 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 05:01:42 +0000
commit765b445022c7f2a24bc862b45d48ece4ca9a77e1 (patch)
tree9f351b1203bbfd02fae7018a1f11e2f15b6eeacb /chrome/browser/history/history_database.h
parenteb6f2c542d7405788d668a762282b66655836e1d (diff)
downloadchromium_src-765b445022c7f2a24bc862b45d48ece4ca9a77e1.zip
chromium_src-765b445022c7f2a24bc862b45d48ece4ca9a77e1.tar.gz
chromium_src-765b445022c7f2a24bc862b45d48ece4ca9a77e1.tar.bz2
Convert history to use new sql wrappers. Enhance wrappers in several ways to
support the needs of history. BUG=none TEST=covered by unit tests Review URL: http://codereview.chromium.org/246053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27832 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/history_database.h')
-rw-r--r--chrome/browser/history/history_database.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/chrome/browser/history/history_database.h b/chrome/browser/history/history_database.h
index 9351c26..560b699 100644
--- a/chrome/browser/history/history_database.h
+++ b/chrome/browser/history/history_database.h
@@ -1,10 +1,12 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_
#define CHROME_BROWSER_HISTORY_HISTORY_DATABASE_H_
+#include "app/sql/connection.h"
+#include "app/sql/meta_table.h"
#include "build/build_config.h"
#include "chrome/browser/history/download_database.h"
#include "chrome/browser/history/history_types.h"
@@ -12,9 +14,6 @@
#include "chrome/browser/history/url_database.h"
#include "chrome/browser/history/visit_database.h"
#include "chrome/browser/history/visitsegment_database.h"
-#include "chrome/browser/meta_table_helper.h"
-
-struct sqlite3;
class FilePath;
@@ -85,7 +84,7 @@ class HistoryDatabase : public DownloadDatabase,
void BeginTransaction();
void CommitTransaction();
int transaction_nesting() const { // for debugging and assertion purposes
- return transaction_nesting_;
+ return db_.transaction_nesting();
}
// Drops all tables except the URL, and download tables, and recreates them
@@ -142,8 +141,7 @@ class HistoryDatabase : public DownloadDatabase,
private:
// Implemented for URLDatabase.
- virtual sqlite3* GetDB();
- virtual SqliteStatementCache& GetStatementCache();
+ virtual sql::Connection& GetDB();
// Migration -----------------------------------------------------------------
@@ -164,20 +162,9 @@ class HistoryDatabase : public DownloadDatabase,
// ---------------------------------------------------------------------------
- // How many nested transactions are pending? When this gets to 0, we commit.
- int transaction_nesting_;
-
- // The database. The closer automatically closes the deletes the db and the
- // statement cache. These must be done in a specific order, so we don't want
- // to rely on C++'s implicit destructors for the individual objects.
- //
- // The close scoper will free the database and delete the statement cache in
- // the correct order automatically when we are destroyed.
- DBCloseScoper db_closer_;
- sqlite3* db_;
- SqliteStatementCache* statement_cache_;
+ sql::Connection db_;
+ sql::MetaTable meta_table_;
- MetaTableHelper meta_table_;
base::Time cached_early_expiration_threshold_;
// See the getter above.