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

Unified Diff: chrome/browser/webdata/keyword_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/keyword_table.h ('k') | chrome/browser/webdata/keyword_table_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/keyword_table.cc
diff --git a/chrome/browser/webdata/keyword_table.cc b/chrome/browser/webdata/keyword_table.cc
index 15fba4131d3b5aafdd8306624f91c1a6f63980f7..d412d840a18f1d80a800079664852dda9fad99b7 100644
--- a/chrome/browser/webdata/keyword_table.cc
+++ b/chrome/browser/webdata/keyword_table.cc
@@ -116,15 +116,29 @@ void BindURLToStatement(const TemplateURLData& data,
s->BindString(starting_column + 17, data.search_terms_replacement_key);
}
-} // anonymous namespace
+int table_key = 0;
-KeywordTable::KeywordTable(sql::Connection* db, sql::MetaTable* meta_table)
- : WebDatabaseTable(db, meta_table) {
+WebDatabaseTable::TypeKey GetKey() {
+ return reinterpret_cast<void*>(&table_key);
+}
+
+} // namespace
+
+KeywordTable::KeywordTable() {
}
KeywordTable::~KeywordTable() {}
-bool KeywordTable::Init() {
+KeywordTable* KeywordTable::FromWebDatabase(WebDatabase* db) {
+ return static_cast<KeywordTable*>(db->GetTable(GetKey()));
+}
+
+WebDatabaseTable::TypeKey KeywordTable::GetTypeKey() const {
+ return GetKey();
+}
+
+bool KeywordTable::Init(sql::Connection* db, sql::MetaTable* meta_table) {
+ WebDatabaseTable::Init(db, meta_table);
return db_->DoesTableExist("keywords") ||
db_->Execute("CREATE TABLE keywords ("
"id INTEGER PRIMARY KEY,"
« no previous file with comments | « chrome/browser/webdata/keyword_table.h ('k') | chrome/browser/webdata/keyword_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698