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

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

Issue 2713413002: Blink bindings: use v8 to enforce method call access checks (Closed)
Patch Set: Restore comment Created 3 years, 10 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
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 7f508118ad91a1f97a21ee3fb0210cd04c22db53..72efc30ce371628a82755179d654c2adfabdb00f 100644
--- a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
+++ b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
@@ -98,6 +98,10 @@ ScriptPromise GlobalFetch::fetch(ScriptState* scriptState,
const Dictionary& init,
ExceptionState& exceptionState) {
UseCounter::count(window.getExecutionContext(), UseCounter::Fetch);
+ if (!window.frame()) {
+ exceptionState.throwTypeError("The global scope is shutting down.");
+ return ScriptPromise();
+ }
return ScopedFetcher::from(window)->fetch(scriptState, input, init,
exceptionState);
}

Powered by Google App Engine
This is Rietveld 408576698