File tree 2 files changed +8
-4
lines changed
chromium/content/browser/appcache 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ AppCacheDispatcherHost::AppCacheDispatcherHost(
18
18
: BrowserMessageFilter(AppCacheMsgStart),
19
19
appcache_service_ (appcache_service),
20
20
frontend_proxy_(this ),
21
- process_id_(process_id) {
21
+ process_id_(process_id),
22
+ weak_factory_(this ) {
22
23
}
23
24
24
25
void AppCacheDispatcherHost::OnChannelConnected (int32 peer_pid) {
@@ -27,13 +28,13 @@ void AppCacheDispatcherHost::OnChannelConnected(int32 peer_pid) {
27
28
appcache_service_.get (), &frontend_proxy_, process_id_);
28
29
get_status_callback_ =
29
30
base::Bind (&AppCacheDispatcherHost::GetStatusCallback,
30
- base::Unretained ( this ));
31
+ weak_factory_. GetWeakPtr ( ));
31
32
start_update_callback_ =
32
33
base::Bind (&AppCacheDispatcherHost::StartUpdateCallback,
33
- base::Unretained ( this ));
34
+ weak_factory_. GetWeakPtr ( ));
34
35
swap_cache_callback_ =
35
36
base::Bind (&AppCacheDispatcherHost::SwapCacheCallback,
36
- base::Unretained ( this ));
37
+ weak_factory_. GetWeakPtr ( ));
37
38
}
38
39
}
39
40
Original file line number Diff line number Diff line change 9
9
10
10
#include " base/memory/ref_counted.h"
11
11
#include " base/memory/scoped_ptr.h"
12
+ #include " base/memory/weak_ptr.h"
12
13
#include " base/process/process.h"
13
14
#include " content/browser/appcache/appcache_backend_impl.h"
14
15
#include " content/browser/appcache/appcache_frontend_proxy.h"
@@ -72,6 +73,8 @@ class AppCacheDispatcherHost : public BrowserMessageFilter {
72
73
// The corresponding ChildProcessHost object's id().
73
74
int process_id_;
74
75
76
+ base::WeakPtrFactory<AppCacheDispatcherHost> weak_factory_;
77
+
75
78
DISALLOW_COPY_AND_ASSIGN (AppCacheDispatcherHost);
76
79
};
77
80
You can’t perform that action at this time.
0 commit comments