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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp

Issue 900793002: ServiceWorker: Support SWRegistration.unregister() in SWGlobalScope [2/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP: add test Created 5 years, 10 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: Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp b/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp
index 43869698db63831fde47c937d250eac9368afed3..9047eb9fca4e0eeab49c9e67d14ee970a559b98c 100644
--- a/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp
@@ -44,6 +44,12 @@ ServiceWorkerContainerClient* ServiceWorkerContainerClient::from(ExecutionContex
return static_cast<ServiceWorkerContainerClient*>(DocumentSupplement::from(document, supplementName()));
}
+ if (context->isServiceWorkerGlobalScope()) {
+ ServiceWorkerContainerClient* client = static_cast<ServiceWorkerContainerClient*>(WillBeHeapSupplement<WorkerClients>::from(toWorkerGlobalScope(context)->clients(), supplementName()));
+ ASSERT(client);
+ return client;
+ }
+
ASSERT(context->isWorkerGlobalScope());
return static_cast<ServiceWorkerContainerClient*>(WillBeHeapSupplement<WorkerClients>::from(toWorkerGlobalScope(context)->clients(), supplementName()));
}

Powered by Google App Engine
This is Rietveld 408576698