Index: content/browser/service_worker/service_worker_context_core.h |
diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h |
index c764f0724f8267bd6cd4cf4b585e56d54074b6e4..128a8f7f0dae3edb7f9f61ee46d0338beedd4bed 100644 |
--- a/content/browser/service_worker/service_worker_context_core.h |
+++ b/content/browser/service_worker/service_worker_context_core.h |
@@ -195,6 +195,11 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
std::vector<ServiceWorkerRegistrationInfo> GetAllLiveRegistrationInfo(); |
std::vector<ServiceWorkerVersionInfo> GetAllLiveVersionInfo(); |
+ // ProtectVersion holds a reference to |version| until UnprotectVersion is |
+ // called. |
+ void ProtectVersion(const scoped_refptr<ServiceWorkerVersion>& version); |
+ void UnprotectVersion(int64 version_id); |
+ |
// Returns new context-local unique ID. |
int GetNewServiceWorkerHandleId(); |
int GetNewRegistrationHandleId(); |
@@ -254,6 +259,7 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
scoped_ptr<ServiceWorkerJobCoordinator> job_coordinator_; |
std::map<int64, ServiceWorkerRegistration*> live_registrations_; |
std::map<int64, ServiceWorkerVersion*> live_versions_; |
+ std::map<int64, scoped_refptr<ServiceWorkerVersion>> protected_versions_; |
int next_handle_id_; |
int next_registration_handle_id_; |
scoped_refptr<base::ObserverListThreadSafe<ServiceWorkerContextObserver>> |