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

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

Issue 823583006: ServiceWorker: Add null check of ExecutionContext in skipWaiting. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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/ServiceWorkerGlobalScope.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
index f9b3dd25899fe75806e37b5b7494db94ccf5e639..28e66474bd2ed3a45aa200217331a82e28ace882 100644
--- a/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
@@ -126,10 +126,13 @@ void ServiceWorkerGlobalScope::close(ExceptionState& exceptionState)
ScriptPromise ServiceWorkerGlobalScope::skipWaiting(ScriptState* scriptState)
{
+ ExecutionContext* executionContext = scriptState->executionContext();
+ if (!executionContext)
+ return ScriptPromise();
falken 2015/01/08 04:31:52 I have some questions. 1. What happens if Termina
xiang 2015/01/08 08:16:13 I'm not sure about it in this case, from my code r
falken 2015/01/08 08:28:05 I see! That looks right.
+
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
- ExecutionContext* executionContext = scriptState->executionContext();
ServiceWorkerGlobalScopeClient::from(executionContext)->skipWaiting(new SkipWaitingCallback(resolver));
return 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