Index: content/browser/appcache/appcache_host.h |
diff --git a/content/browser/appcache/appcache_host.h b/content/browser/appcache/appcache_host.h |
index 31c714b5be4ba898f56955402ec8a0fc99ee0ae6..16efa4cd1e45db5ab773e7e84a0fc3d383106a30 100644 |
--- a/content/browser/appcache/appcache_host.h |
+++ b/content/browser/appcache/appcache_host.h |
@@ -13,6 +13,7 @@ |
#include "base/gtest_prod_util.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
#include "base/observer_list.h" |
#include "content/browser/appcache/appcache_group.h" |
#include "content/browser/appcache/appcache_service_impl.h" |
@@ -194,6 +195,9 @@ class CONTENT_EXPORT AppCacheHost |
void PrepareForTransfer(); |
void CompleteTransfer(int host_id, AppCacheFrontend* frontend); |
+ // Returns a weak pointer reference to the host. |
+ base::WeakPtr<AppCacheHost> GetWeakPtr(); |
+ |
private: |
friend class content::AppCacheHostTest; |
friend class content::AppCacheStorageImplTest; |
@@ -353,6 +357,10 @@ class CONTENT_EXPORT AppCacheHost |
FRIEND_TEST_ALL_PREFIXES(content::AppCacheHostTest, SelectCacheTwice); |
FRIEND_TEST_ALL_PREFIXES(content::AppCacheTest, CleanupUnusedCache); |
+ // The WeakPtrFactory below must occur last in the class definition so they |
+ // get destroyed last. |
kinuko
2017/07/03 06:34:15
nit: this comment felt a bit confusing to me (two
ananta
2017/07/03 07:36:47
Removed this comment. I checked other places in th
|
+ base::WeakPtrFactory<AppCacheHost> weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AppCacheHost); |
}; |