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

Unified Diff: components/safe_browsing_db/v4_database.h

Issue 2649643002: [S] Use a weak_factory for V4Database callbacks + test (Closed)
Patch Set: InvalidateWeakPtrs in V4Database::Destroy Created 3 years, 11 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/safe_browsing_db/v4_database.h
diff --git a/components/safe_browsing_db/v4_database.h b/components/safe_browsing_db/v4_database.h
index 19fee93a53b304007a69fef142473b93c5826ba2..1935c36184669f5ec1a7785fda194d4a44b5ff51 100644
--- a/components/safe_browsing_db/v4_database.h
+++ b/components/safe_browsing_db/v4_database.h
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
#include "components/safe_browsing_db/v4_protocol_manager_util.h"
@@ -205,6 +206,8 @@ class V4Database {
// accessed on the IO thread.
int pending_store_updates_;
+ base::WeakPtrFactory<V4Database> weak_factory_;
Nathan Parker 2017/01/21 01:01:08 A proposal: How about week_factory_on_io_? That m
vakh (use Gerrit instead) 2017/01/21 01:16:31 Done.
+
DISALLOW_COPY_AND_ASSIGN(V4Database);
};
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_database.cc » ('j') | components/safe_browsing_db/v4_database.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698