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

Unified Diff: components/webdata/common/web_database.cc

Issue 14081043: Hook up Autofill Backend interface to SyncableServices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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: components/webdata/common/web_database.cc
diff --git a/components/webdata/common/web_database.cc b/components/webdata/common/web_database.cc
index 82b2a749c444e085f23f7496bf92f610eaba57a6..6bda3bd8f41443eb00f8f6210b0e4a40e907cc62 100644
--- a/components/webdata/common/web_database.cc
+++ b/components/webdata/common/web_database.cc
@@ -44,9 +44,13 @@ sql::InitStatus FailedMigrationTo(int version_num) {
} // namespace
-WebDatabase::WebDatabase() {}
+WebDatabase::WebDatabase()
+ : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+
+}
WebDatabase::~WebDatabase() {
+ weak_ptr_factory_.InvalidateWeakPtrs();
}
void WebDatabase::AddTable(WebDatabaseTable* table) {
@@ -69,6 +73,10 @@ sql::Connection* WebDatabase::GetSQLConnection() {
return &db_;
}
+base::WeakPtr<WebDatabase> WebDatabase::AsWeakPtr() {
+ return weak_ptr_factory_.GetWeakPtr();
+}
+
sql::InitStatus WebDatabase::Init(const base::FilePath& db_name) {
// When running in unit tests, there is already a NotificationService object.
// Since only one can exist at a time per thread, check first.

Powered by Google App Engine
This is Rietveld 408576698