Web Inspector: XHR content sometimes shows as error even though load succeeded
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Aug 2018 17:59:56 +0000 (17:59 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Aug 2018 17:59:56 +0000 (17:59 +0000)
commit27883dce18733c7acb32caf94fc15c858d1732cf
treeadd3be0392ba473d7a0ed95c2408a84506b49652
parent48f964c4e2ef4c7fea9170896592fcef06c0810b
Web Inspector: XHR content sometimes shows as error even though load succeeded
https://bugs.webkit.org/show_bug.cgi?id=188385
<rdar://problem/42646160>

Source/WebCore:

Reviewed by Devin Rousso.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didReceiveData):
Avoid a double hash lookup in the common case.
Allow synchronous XHR to have text data appended in the normal case.
Allow synchronous XHR to set base64 encoded data right here for non-text data.

* inspector/NetworkResourcesData.h:
(WebCore::NetworkResourcesData::ResourceData::hasBufferedData const):
Getter to see if data is buffered or not for this resource.

* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::maybeAddResourceData):
Return the updated ResourceData to avoid clients having to do a lookup.

LayoutTests:

Reviewed by Devin Rousso.

* http/tests/inspector/network/xhr-response-body-expected.txt:
* http/tests/inspector/network/xhr-response-body.html:
Extend this test to include synchronous XHR for text and non-text resources.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/xhr-response-body-expected.txt
LayoutTests/http/tests/inspector/network/xhr-response-body.html
Source/WebCore/ChangeLog
Source/WebCore/inspector/NetworkResourcesData.cpp
Source/WebCore/inspector/NetworkResourcesData.h
Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp