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

Unified Diff: components/safe_browsing_db/v4_local_database_manager.h

Issue 2427863002: Small: Use a weak pointer for callbacks to V4LocalDatabaseManager (Closed)
Patch Set: WaitForTasksOnTaskRunner at the end of the test to ensure that the scheduled tasks get run. Created 4 years, 2 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 | « no previous file | components/safe_browsing_db/v4_local_database_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_local_database_manager.h
diff --git a/components/safe_browsing_db/v4_local_database_manager.h b/components/safe_browsing_db/v4_local_database_manager.h
index 53ce02582e84fa26470b41fd31f70ab7eac2f9f2..a5bdef46ae48c68c2802c375f7d8703c4910e09b 100644
--- a/components/safe_browsing_db/v4_local_database_manager.h
+++ b/components/safe_browsing_db/v4_local_database_manager.h
@@ -10,6 +10,7 @@
#include <memory>
+#include "base/memory/weak_ptr.h"
#include "components/safe_browsing_db/database_manager.h"
#include "components/safe_browsing_db/hit_report.h"
#include "components/safe_browsing_db/v4_database.h"
@@ -235,6 +236,8 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
// The protocol manager that downloads the hash prefix updates.
std::unique_ptr<V4UpdateProtocolManager> v4_update_protocol_manager_;
+ base::WeakPtrFactory<V4LocalDatabaseManager> weak_factory_;
+
friend class base::RefCountedThreadSafe<V4LocalDatabaseManager>;
DISALLOW_COPY_AND_ASSIGN(V4LocalDatabaseManager);
}; // class V4LocalDatabaseManager
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698