Index: content/browser/appcache/appcache_host.cc |
diff --git a/content/browser/appcache/appcache_host.cc b/content/browser/appcache/appcache_host.cc |
index 3af81c5eef57a9a55e8d38147f0ef6ffa3f3d95a..ecfa39ca9a6fb5d2b2744d45c16be091d45a6b59 100644 |
--- a/content/browser/appcache/appcache_host.cc |
+++ b/content/browser/appcache/appcache_host.cc |
@@ -44,21 +44,26 @@ void FillCacheInfo(const AppCache* cache, |
} // Anonymous namespace |
-AppCacheHost::AppCacheHost(int host_id, AppCacheFrontend* frontend, |
+AppCacheHost::AppCacheHost(int host_id, |
+ AppCacheFrontend* frontend, |
AppCacheServiceImpl* service) |
: host_id_(host_id), |
- spawning_host_id_(kAppCacheNoHostId), spawning_process_id_(0), |
- parent_host_id_(kAppCacheNoHostId), parent_process_id_(0), |
+ spawning_host_id_(kAppCacheNoHostId), |
+ spawning_process_id_(0), |
+ parent_host_id_(kAppCacheNoHostId), |
+ parent_process_id_(0), |
pending_main_resource_cache_id_(kAppCacheNoCacheId), |
pending_selected_cache_id_(kAppCacheNoCacheId), |
was_select_cache_called_(false), |
is_cache_selection_enabled_(true), |
- frontend_(frontend), service_(service), |
+ frontend_(frontend), |
+ service_(service), |
storage_(service->storage()), |
pending_callback_param_(NULL), |
main_resource_was_namespace_entry_(false), |
main_resource_blocked_(false), |
- associated_cache_info_pending_(false) { |
+ associated_cache_info_pending_(false), |
+ weak_factory_(this) { |
service_->AddObserver(this); |
} |
@@ -543,6 +548,10 @@ void AppCacheHost::CompleteTransfer(int host_id, AppCacheFrontend* frontend) { |
frontend_ = frontend; |
} |
+base::WeakPtr<AppCacheHost> AppCacheHost::GetWeakPtr() { |
+ return weak_factory_.GetWeakPtr(); |
+} |
+ |
void AppCacheHost::AssociateNoCache(const GURL& manifest_url) { |
// manifest url can be empty. |
AssociateCacheHelper(NULL, manifest_url); |