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

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

Issue 535193002: [ServiceWorker] Add NULL check of ExecutionContext in FetchBodyStream::readAsync (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: same as patch set 1 Created 6 years, 3 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/FetchBodyStream.cpp
diff --git a/Source/modules/serviceworkers/FetchBodyStream.cpp b/Source/modules/serviceworkers/FetchBodyStream.cpp
index 386b642194a5c313aa2cd89e28e9fa31d0a580c6..cd8a1a59ed2eb214c8187f2f8f3244b407e15382 100644
--- a/Source/modules/serviceworkers/FetchBodyStream.cpp
+++ b/Source/modules/serviceworkers/FetchBodyStream.cpp
@@ -66,8 +66,15 @@ ScriptPromise FetchBodyStream::readAsync(ScriptState* scriptState, ResponseType
ASSERT_NOT_REACHED();
}
+ ExecutionContext* executionContext = scriptState->executionContext();
+ if (!executionContext) {
+ m_resolver->reject(V8ThrowException::createTypeError("ExecutionContext terminated", scriptState->isolate()));
+ m_resolver.clear();
+ return promise;
+ }
+
m_loader = adoptPtr(new FileReaderLoader(readType, this));
- m_loader->start(scriptState->executionContext(), m_blobDataHandle);
+ m_loader->start(executionContext, m_blobDataHandle);
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