Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Unified Diff: content/browser/service_worker/service_worker_context_core.h

Issue 1187623006: Service Worker: Update stale workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix DCHECK Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>>

Powered by Google App Engine
This is Rietveld 408576698