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

Unified Diff: chrome/browser/webdata/token_service_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
Index: chrome/browser/webdata/token_service_table.cc
diff --git a/chrome/browser/webdata/token_service_table.cc b/chrome/browser/webdata/token_service_table.cc
index df8f1f1cd1b0ef5373a90a098d5a26bbbd39fc45..ee8410f82a72e6a9cead5a869fa69cb86befeabc 100644
--- a/chrome/browser/webdata/token_service_table.cc
+++ b/chrome/browser/webdata/token_service_table.cc
@@ -9,9 +9,30 @@
#include "base/logging.h"
#include "chrome/browser/password_manager/encryptor.h"
+#include "chrome/browser/webdata/web_database.h"
#include "sql/statement.h"
-bool TokenServiceTable::Init() {
+namespace {
+
+int table_key = 0;
+
+WebDatabaseTable::TypeKey GetKey() {
+ return reinterpret_cast<void*>(&table_key);
+}
+
+} // namespace
+
+TokenServiceTable* TokenServiceTable::FromWebDatabase(WebDatabase* db) {
+ return static_cast<TokenServiceTable*>(db->GetTable(GetKey()));
+
+}
+
+WebDatabaseTable::TypeKey TokenServiceTable::GetTypeKey() const {
+ return GetKey();
+}
+
+bool TokenServiceTable::Init(sql::Connection* db, sql::MetaTable* meta_table) {
+ WebDatabaseTable::Init(db, meta_table);
if (!db_->DoesTableExist("token_service")) {
if (!db_->Execute("CREATE TABLE token_service ("
"service VARCHAR PRIMARY KEY NOT NULL,"
« no previous file with comments | « chrome/browser/webdata/token_service_table.h ('k') | chrome/browser/webdata/token_service_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698