Code:  void AppCacheDispatcherHost::OnChannelConnected(int32 peer_pid) {
  if (appcache_service_.get()) {
    backend_impl_.Initialize(
         appcache_service_.get(), &frontend_proxy_, process_id_);
     get_status_callback_ =
         base::Bind(&AppCacheDispatcherHost::GetStatusCallback,
                   base::Unretained(this));
     start_update_callback_ =
         base::Bind(&AppCacheDispatcherHost::StartUpdateCallback,
                   base::Unretained(this));
     swap_cache_callback_ =
         base::Bind(&AppCacheDispatcherHost::SwapCacheCallback,
                   base::Unretained(this));
   }
 }

Commit Message: AppCache: Use WeakPtr<> to fix a potential uaf bug.

BUG=554908

Review URL: https://codereview.chromium.org/1441683004

Cr-Commit-Position: refs/heads/master@{#359930}
CWE ID: 
 void AppCacheDispatcherHost::OnChannelConnected(int32 peer_pid) {
  if (appcache_service_.get()) {
    backend_impl_.Initialize(
         appcache_service_.get(), &frontend_proxy_, process_id_);
     get_status_callback_ =
         base::Bind(&AppCacheDispatcherHost::GetStatusCallback,
                    weak_factory_.GetWeakPtr());
     start_update_callback_ =
         base::Bind(&AppCacheDispatcherHost::StartUpdateCallback,
                    weak_factory_.GetWeakPtr());
     swap_cache_callback_ =
         base::Bind(&AppCacheDispatcherHost::SwapCacheCallback,
                    weak_factory_.GetWeakPtr());
   }
 }
