Skip to content

Commit

Permalink
browser(webkit): fix loader after terminal state access (#2654)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman authored Jun 19, 2020
1 parent 2bfb675 commit e0ac11c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion browser_patches/webkit/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1291
1292
15 changes: 12 additions & 3 deletions browser_patches/webkit/patches/bootstrap.diff
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@ index ddbb5d5347f3beabe3cfab201d6838c896d21e39..25f1798cad5a4ef135a27d3bd5146798
class Page;
class SecurityOrigin;
diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
index 1ccc5f5de274bd263c8bec5c72fe417ea99534fd..bbb831ec7a714a476baaa5069117c873a7033693 100644
index 1ccc5f5de274bd263c8bec5c72fe417ea99534fd..5dac8d209b4d2f19eee3471ba4a3cd530a691b65 100644
--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
@@ -44,6 +44,7 @@
Expand Down Expand Up @@ -2660,7 +2660,16 @@ index 1ccc5f5de274bd263c8bec5c72fe417ea99534fd..bbb831ec7a714a476baaa5069117c873
}

bool InspectorNetworkAgent::shouldInterceptRequest(const ResourceRequest& request)
@@ -1335,6 +1342,11 @@ void InspectorNetworkAgent::interceptRequestWithError(ErrorString& errorString,
@@ -1291,6 +1298,8 @@ void InspectorNetworkAgent::interceptRequestWithResponse(ErrorString& errorStrin
response.setHTTPHeaderFields(WTFMove(explicitHeaders));
response.setHTTPHeaderField(HTTPHeaderName::ContentType, response.mimeType());
loader->didReceiveResponse(response, [loader, buffer = data.releaseNonNull()]() mutable {
+ if (loader->reachedTerminalState())
+ return;
if (buffer->size())
loader->didReceiveBuffer(WTFMove(buffer), buffer->size(), DataPayloadWholeResource);
loader->didFinishLoading(NetworkLoadMetrics());
@@ -1335,6 +1344,11 @@ void InspectorNetworkAgent::interceptRequestWithError(ErrorString& errorString,
loader.didFail(error);
}

Expand All @@ -2672,7 +2681,7 @@ index 1ccc5f5de274bd263c8bec5c72fe417ea99534fd..bbb831ec7a714a476baaa5069117c873
bool InspectorNetworkAgent::shouldTreatAsText(const String& mimeType)
{
return startsWithLettersIgnoringASCIICase(mimeType, "text/")
@@ -1376,6 +1388,12 @@ Optional<String> InspectorNetworkAgent::textContentForCachedResource(CachedResou
@@ -1376,6 +1390,12 @@ Optional<String> InspectorNetworkAgent::textContentForCachedResource(CachedResou
return WTF::nullopt;
}

Expand Down

0 comments on commit e0ac11c

Please sign in to comment.