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

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: Self review. 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/logins_table.cc
diff --git a/chrome/browser/webdata/logins_table.cc b/chrome/browser/webdata/logins_table.cc
index 35a1be2a2b2fed2869539ed72fb03a4dffb89a08..78e0f2b7e3a069a2a4ce7279ca34e24d89771580 100644
--- a/chrome/browser/webdata/logins_table.cc
+++ b/chrome/browser/webdata/logins_table.cc
@@ -7,9 +7,28 @@
#include <limits>
#include "base/logging.h"
+#include "chrome/browser/webdata/web_database.h"
#include "sql/statement.h"
-bool LoginsTable::Init() {
+namespace {
+
+WebDatabaseTable::TypeKey GetKey() {
+ return reinterpret_cast<void*>(&LoginsTable::FromWebDatabase);
+}
+
+} // 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.

Powered by Google App Engine
This is Rietveld 408576698