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

Unified Diff: chrome/browser/webdata/web_intents_table.cc

Issue 12543034: Move creation of the various WebDatabaseTable types out of WebDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows release builds (COMDAT folding combined static functions being used for keys. Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/webdata/web_intents_table.h ('k') | chrome_frame/test/delete_chrome_history_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/web_intents_table.cc
diff --git a/chrome/browser/webdata/web_intents_table.cc b/chrome/browser/webdata/web_intents_table.cc
index 3650c950df7f59185959d94bd13d08438416afec..0214ac0c6322965581f65ca7682da53d4331ab2a 100644
--- a/chrome/browser/webdata/web_intents_table.cc
+++ b/chrome/browser/webdata/web_intents_table.cc
@@ -9,20 +9,39 @@
#include "base/logging.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/webdata/web_database.h"
#include "googleurl/src/gurl.h"
#include "net/base/mime_util.h"
#include "sql/statement.h"
#include "third_party/sqlite/sqlite3.h"
-WebIntentsTable::WebIntentsTable(sql::Connection* db,
- sql::MetaTable* meta_table)
- : WebDatabaseTable(db, meta_table) {
+namespace {
+
+int table_key = 0;
+
+WebDatabaseTable::TypeKey GetKey() {
+ return reinterpret_cast<void*>(&table_key);
+}
+
+} // namespace
+
+WebIntentsTable::WebIntentsTable() {
}
WebIntentsTable::~WebIntentsTable() {
}
-bool WebIntentsTable::Init() {
+WebIntentsTable* WebIntentsTable::FromWebDatabase(WebDatabase* db) {
+ return static_cast<WebIntentsTable*>(db->GetTable(GetKey()));
+}
+
+WebDatabaseTable::TypeKey WebIntentsTable::GetTypeKey() const {
+ return GetKey();
+}
+
+bool WebIntentsTable::Init(sql::Connection* db, sql::MetaTable* meta_table) {
+ WebDatabaseTable::Init(db, meta_table);
+
if (!db_->DoesTableExist("web_intents")) {
if (!db_->Execute("CREATE TABLE web_intents ("
" service_url LONGVARCHAR,"
@@ -97,7 +116,7 @@ bool WebIntentsTable::MigrateToVersion46AddSchemeColumn() {
return false;
}
- if (!Init()) return false;
+ if (!Init(db_, meta_table_)) return false;
int error = db_->ExecuteAndReturnErrorCode(
"INSERT INTO web_intents"
« no previous file with comments | « chrome/browser/webdata/web_intents_table.h ('k') | chrome_frame/test/delete_chrome_history_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698