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

Unified Diff: chrome/browser/webdata/logins_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/logins_table.h ('k') | chrome/browser/webdata/token_service_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/logins_table.cc
diff --git a/chrome/browser/webdata/logins_table.cc b/chrome/browser/webdata/logins_table.cc
index 35a1be2a2b2fed2869539ed72fb03a4dffb89a08..e97bfdccc39560dd079c773f381343af28134b64 100644
--- a/chrome/browser/webdata/logins_table.cc
+++ b/chrome/browser/webdata/logins_table.cc
@@ -7,9 +7,30 @@
#include <limits>
#include "base/logging.h"
+#include "chrome/browser/webdata/web_database.h"
#include "sql/statement.h"
-bool LoginsTable::Init() {
+namespace {
+
+int table_key = 0;
+
+WebDatabaseTable::TypeKey GetKey() {
+ return reinterpret_cast<void*>(&table_key);
+}
+
+} // namespace
+
+LoginsTable* LoginsTable::FromWebDatabase(WebDatabase* db) {
+ return static_cast<LoginsTable*>(db->GetTable(GetKey()));
+}
+
+WebDatabaseTable::TypeKey LoginsTable::GetTypeKey() const {
+ return GetKey();
+}
+
+bool LoginsTable::Init(sql::Connection* db, sql::MetaTable* meta_table) {
+ WebDatabaseTable::Init(db, meta_table);
+
if (db_->DoesTableExist("logins")) {
// We don't check for success. It doesn't matter that much.
// If we fail we'll just try again later anyway.
« no previous file with comments | « chrome/browser/webdata/logins_table.h ('k') | chrome/browser/webdata/token_service_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698