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

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

Issue 2631153002: Do not initiate fetch() on a destroyed FetchManager. (Closed)
Patch Set: Created 3 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: 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 25c7a74f52714a0c22a98ec95e68607c0c6a6f74..f58d57c1ad37334dd6c4f227507aba1e1a0107f6 100644
--- a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
+++ b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
@@ -40,7 +40,8 @@ class GlobalFetchImpl final
const RequestInfo& input,
const Dictionary& init,
ExceptionState& exceptionState) override {
- if (!scriptState->contextIsValid()) {
+ ExecutionContext* executionContext = m_fetchManager->getExecutionContext();
+ if (!scriptState->contextIsValid() || !executionContext) {
// TODO(yhirano): Should this be moved to bindings?
exceptionState.throwTypeError("The global scope is shutting down.");
return ScriptPromise();
@@ -53,10 +54,8 @@ class GlobalFetchImpl final
if (exceptionState.hadException())
return ScriptPromise();
- if (ExecutionContext* executionContext =
- m_fetchManager->getExecutionContext())
- InspectorInstrumentation::willSendXMLHttpOrFetchNetworkRequest(
- executionContext, r->url());
+ InspectorInstrumentation::willSendXMLHttpOrFetchNetworkRequest(
+ executionContext, r->url());
return m_fetchManager->fetch(scriptState, r->passRequestData(scriptState));
}
« 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