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

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

Issue 1187623006: Service Worker: Update stale workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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.cc
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc
index d4ba0a34daf693fa1e8cc0426af972e80dd5597b..439011719e777b4ab73edd1cf3175754fc0d69de 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -437,6 +437,20 @@ ServiceWorkerContextCore::GetAllLiveVersionInfo() {
return infos;
}
+void ServiceWorkerContextCore::ProtectVersion(
+ const scoped_refptr<ServiceWorkerVersion>& version) {
+ DCHECK(protected_versions_.find(version->version_id()) ==
+ protected_versions_.end());
+ protected_versions_[version->version_id()] = version;
+}
+
+void ServiceWorkerContextCore::UnprotectVersion(
+ const scoped_refptr<ServiceWorkerVersion>& version) {
+ DCHECK(protected_versions_.find(version->version_id()) !=
+ protected_versions_.end());
+ protected_versions_.erase(version->version_id());
+}
+
int ServiceWorkerContextCore::GetNewServiceWorkerHandleId() {
return next_handle_id_++;
}

Powered by Google App Engine
This is Rietveld 408576698