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

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: add "FIXME" 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..9c183f1d61a0c27713f20e0d22fd6e10a9b36dca 100644
--- a/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
@@ -126,10 +126,14 @@ void ServiceWorkerGlobalScope::close(ExceptionState& exceptionState)
ScriptPromise ServiceWorkerGlobalScope::skipWaiting(ScriptState* scriptState)
{
+ ExecutionContext* executionContext = scriptState->executionContext();
+ // FIXME: short-term fix, see details at: https://codereview.chromium.org/535193002/.
+ if (!executionContext)
+ return ScriptPromise();
+
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