Index: chrome/browser/webdata/autofill_table.cc |
diff --git a/chrome/browser/webdata/autofill_table.cc b/chrome/browser/webdata/autofill_table.cc |
index 734c28ae8448bbed7732ce743e360e097e64c7c7..b3ccb52e5a31a82a38f685e04e964eb00aa585d4 100644 |
--- a/chrome/browser/webdata/autofill_table.cc |
+++ b/chrome/browser/webdata/autofill_table.cc |
@@ -20,6 +20,7 @@ |
#include "chrome/browser/password_manager/encryptor.h" |
#include "chrome/browser/webdata/autofill_change.h" |
#include "chrome/browser/webdata/autofill_entry.h" |
+#include "chrome/browser/webdata/web_database.h" |
#include "components/autofill/browser/autofill_country.h" |
#include "components/autofill/browser/autofill_profile.h" |
#include "components/autofill/browser/autofill_type.h" |
@@ -319,23 +320,37 @@ bool RemoveAutofillProfilePieces(const std::string& guid, sql::Connection* db) { |
return s3.Run(); |
} |
+int table_key = 0; |
+ |
+WebDatabaseTable::TypeKey GetKey() { |
+ return reinterpret_cast<void*>(&table_key); |
+} |
+ |
} // namespace |
// The maximum length allowed for form data. |
const size_t AutofillTable::kMaxDataLength = 1024; |
-AutofillTable::AutofillTable(sql::Connection* db, sql::MetaTable* meta_table) |
- : WebDatabaseTable(db, meta_table) { |
+AutofillTable::AutofillTable() { |
} |
AutofillTable::~AutofillTable() { |
} |
-bool AutofillTable::Init() { |
- return (InitMainTable() && InitCreditCardsTable() && InitDatesTable() && |
- InitProfilesTable() && InitProfileNamesTable() && |
- InitProfileEmailsTable() && InitProfilePhonesTable() && |
- InitProfileTrashTable()); |
+AutofillTable* AutofillTable::FromWebDatabase(WebDatabase* db) { |
+ return static_cast<AutofillTable*>(db->GetTable(GetKey())); |
+} |
+ |
+WebDatabaseTable::TypeKey AutofillTable::GetTypeKey() const { |
+ return GetKey(); |
+} |
+ |
+bool AutofillTable::Init(sql::Connection* db, sql::MetaTable* meta_table) { |
+ WebDatabaseTable::Init(db, meta_table); |
+ return (InitMainTable() && InitCreditCardsTable() && InitDatesTable() && |
+ InitProfilesTable() && InitProfileNamesTable() && |
+ InitProfileEmailsTable() && InitProfilePhonesTable() && |
+ InitProfileTrashTable()); |
} |
bool AutofillTable::IsSyncable() { |