Web Inspector: Audit: provide a way to get the contents of resources
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2019 10:13:57 +0000 (10:13 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2019 10:13:57 +0000 (10:13 +0000)
commite47e999819c41bb198e474a733c0ba805ebceae1
tree607681c4f1bdabe9ec379bd5024db1a3a1050de9
parent871d8ddde8f4e2e7a7c36f59f318d765ca458cfd
Web Inspector: Audit: provide a way to get the contents of resources
https://bugs.webkit.org/show_bug.cgi?id=195266
<rdar://problem/48550911>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::makeAsyncCall):
Drive-by: fix missing `else`.
Source/WebCore:

Test: inspector/audit/run-resources.html

* inspector/InspectorAuditResourcesObject.idl: Added.
* inspector/InspectorAuditResourcesObject.h: Added.
(WebCore::InspectorAuditResourcesObject::create):
(WebCore::InspectorAuditResourcesObject::Resource):
(WebCore::InspectorAuditResourcesObject::ResourceContent):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient):
* inspector/InspectorAuditResourcesObject.cpp: Added.
(WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject):
(WebCore::InspectorAuditResourcesObject::getResources):
(WebCore::InspectorAuditResourcesObject::getResourceContent):
(WebCore::InspectorAuditResourcesObject::clientForResource):

* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourcesForFrame): Added.
(WebCore::allResourcesURLsForFrame):
Moved a file static function to be a class static function so it can be used elsewhere.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* inspector/audit/resources/sample-resource.css: Added.
* inspector/audit/resources/sample-resource.js: Added.
* inspector/audit/run-resources.html: Added.
* inspector/audit/run-resources-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/audit/resources/sample-resource.css [new file with mode: 0644]
LayoutTests/inspector/audit/resources/sample-resource.js [new file with mode: 0644]
LayoutTests/inspector/audit/run-resources-expected.txt [new file with mode: 0644]
LayoutTests/inspector/audit/run-resources.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InjectedScriptBase.cpp
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources-input.xcfilelist
Source/WebCore/DerivedSources-output.xcfilelist
Source/WebCore/DerivedSources.make
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/inspector/InspectorAuditResourcesObject.cpp [new file with mode: 0644]
Source/WebCore/inspector/InspectorAuditResourcesObject.h [new file with mode: 0644]
Source/WebCore/inspector/InspectorAuditResourcesObject.idl [new file with mode: 0644]
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.h
Source/WebCore/inspector/agents/page/PageAuditAgent.cpp