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

Unified Diff: content/browser/appcache/appcache_dispatcher_host.cc

Issue 1441683004: AppCache: Use WeakPtr<> to fix a potential uaf bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « content/browser/appcache/appcache_dispatcher_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/appcache/appcache_dispatcher_host.cc
diff --git a/content/browser/appcache/appcache_dispatcher_host.cc b/content/browser/appcache/appcache_dispatcher_host.cc
index e35610fe9df3414bb2da824d41886c09e694c69e..6a864f7dff105ed03fa52a021c47f2388691b38a 100644
--- a/content/browser/appcache/appcache_dispatcher_host.cc
+++ b/content/browser/appcache/appcache_dispatcher_host.cc
@@ -19,7 +19,8 @@ AppCacheDispatcherHost::AppCacheDispatcherHost(
: BrowserMessageFilter(AppCacheMsgStart),
appcache_service_(appcache_service),
frontend_proxy_(this),
- process_id_(process_id) {
+ process_id_(process_id),
+ weak_factory_(this) {
}
void AppCacheDispatcherHost::OnChannelConnected(int32 peer_pid) {
@@ -28,13 +29,13 @@ void AppCacheDispatcherHost::OnChannelConnected(int32 peer_pid) {
appcache_service_.get(), &frontend_proxy_, process_id_);
get_status_callback_ =
base::Bind(&AppCacheDispatcherHost::GetStatusCallback,
- base::Unretained(this));
+ weak_factory_.GetWeakPtr());
start_update_callback_ =
base::Bind(&AppCacheDispatcherHost::StartUpdateCallback,
- base::Unretained(this));
+ weak_factory_.GetWeakPtr());
swap_cache_callback_ =
base::Bind(&AppCacheDispatcherHost::SwapCacheCallback,
- base::Unretained(this));
+ weak_factory_.GetWeakPtr());
}
}
« no previous file with comments | « content/browser/appcache/appcache_dispatcher_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698