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

Unified Diff: third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp

Issue 1924193002: [Fetch API] Abort fetching when the passed ScriptState is invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
index bae556366045de25d0f4c6bf790e4cd5e7f39ca7..a4bdd715b4aee27eda21eecc871e944e426fea19 100644
--- a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
+++ b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
@@ -33,6 +33,11 @@ public:
ScriptPromise fetch(ScriptState* scriptState, const RequestInfo& input, const Dictionary& init, ExceptionState& exceptionState) override
{
+ if (!scriptState->contextIsValid()) {
+ // TODO(yhirano): Should this be moved to bindings?
+ exceptionState.throwTypeError("The global scope is shutting down.");
+ return ScriptPromise();
+ }
if (m_fetchManager->isStopped()) {
exceptionState.throwTypeError("The global scope is shutting down.");
return ScriptPromise();
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698