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

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: 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.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..a45441c4a8b5d85a5c31964c5d74211716ac8961 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -437,6 +437,18 @@ 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(int64 version_id) {
+ DCHECK(protected_versions_.find(version_id) != protected_versions_.end());
+ protected_versions_.erase(version_id);
+}
+
int ServiceWorkerContextCore::GetNewServiceWorkerHandleId() {
return next_handle_id_++;
}

Powered by Google App Engine
This is Rietveld 408576698