Index: content/browser/service_worker/service_worker_cache.h |
diff --git a/content/browser/service_worker/service_worker_cache.h b/content/browser/service_worker/service_worker_cache.h |
index d8709690f22e8362bb9f04e524dbd50432c8d0ed..3a7aea1394df4cc41df305992c9b099c605f0b63 100644 |
--- a/content/browser/service_worker/service_worker_cache.h |
+++ b/content/browser/service_worker/service_worker_cache.h |
@@ -7,6 +7,7 @@ |
#include "base/callback.h" |
#include "base/files/file_path.h" |
+#include "base/memory/weak_ptr.h" |
namespace content { |
@@ -21,9 +22,11 @@ namespace content { |
// InitializeIfNeeded must be called before calling the other public members. |
class ServiceWorkerCache { |
public: |
- static ServiceWorkerCache* CreateMemoryCache(const std::string& name); |
- static ServiceWorkerCache* CreatePersistentCache(const base::FilePath& path, |
- const std::string& name); |
+ static scoped_ptr<ServiceWorkerCache> CreateMemoryCache( |
+ const std::string& name); |
+ static scoped_ptr<ServiceWorkerCache> CreatePersistentCache( |
+ const base::FilePath& path, |
+ const std::string& name); |
virtual ~ServiceWorkerCache(); |
// Loads the backend and calls the callback with the result (true for |
@@ -36,6 +39,8 @@ class ServiceWorkerCache { |
int32 id() const { return id_; } |
void set_id(int32 id) { id_ = id; } |
+ base::WeakPtr<ServiceWorkerCache> AsWeakPtr(); |
+ |
private: |
ServiceWorkerCache(const base::FilePath& path, const std::string& name); |
@@ -43,6 +48,8 @@ class ServiceWorkerCache { |
std::string name_; |
int32 id_; |
+ base::WeakPtrFactory<ServiceWorkerCache> weak_ptr_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCache); |
}; |