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

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

Issue 396963002: ServiceWorker: Bypass resolving a promise when ExecutionContext is gone (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: handle ownership of WebServiceWorker Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/ServiceWorker.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorker.cpp b/Source/modules/serviceworkers/ServiceWorker.cpp
index 2974a93ab3584ea5965086125359c4ee211fae8d..2bdf84df6a6dd01764ee808dacd7219658880aa7 100644
--- a/Source/modules/serviceworkers/ServiceWorker.cpp
+++ b/Source/modules/serviceworkers/ServiceWorker.cpp
@@ -156,6 +156,12 @@ PassRefPtrWillBeRawPtr<ServiceWorker> ServiceWorker::from(ExecutionContext* exec
PassRefPtrWillBeRawPtr<ServiceWorker> ServiceWorker::from(ScriptPromiseResolver* resolver, WebType* worker)
{
+ if (resolver->scriptState()->contextIsEmpty()) {
haraken 2014/07/17 07:53:36 Shouldn't this check be if(!resolver->scriptState-
nhiroki 2014/07/17 08:30:02 ScriptState::executionContext() refers to V8::Cont
+ if (worker && !worker->proxy())
+ delete worker;
haraken 2014/07/17 07:53:36 I don't understand the memory management here eith
+ return nullptr;
+ }
+
RefPtrWillBeRawPtr<ServiceWorker> serviceWorker = ServiceWorker::from(resolver->scriptState()->executionContext(), worker);
ScriptState::Scope scope(resolver->scriptState());
serviceWorker->waitOnPromise(resolver->promise());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698