Changeset 225708 in webkit
- Timestamp:
- Dec 8, 2017, 2:57:30 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r225707 r225708 1 2017-12-08 Joseph Pecoraro <pecoraro@apple.com> 2 3 ServiceWorker Inspector: Should be able to see image content from CacheStorage.add(url) network request 4 https://bugs.webkit.org/show_bug.cgi?id=180506 5 6 Reviewed by Brian Burg. 7 8 No test as this only happens inside a ServiceWorker inspector which 9 we don't yet have a way to test. In a Page Inspector, the 10 CacheStorage.add network request already behaves as expected. 11 12 * inspector/NetworkResourcesData.cpp: 13 (WebCore::NetworkResourcesData::responseReceived): 14 (WebCore::shouldBufferResourceData): 15 * inspector/NetworkResourcesData.h: 16 (WebCore::NetworkResourcesData::ResourceData::forceBufferData const): 17 (WebCore::NetworkResourcesData::ResourceData::setForceBufferData): 18 Provide a way to force buffering in NetworkResourceData. 19 20 * inspector/agents/InspectorNetworkAgent.cpp: 21 (WebCore::InspectorNetworkAgent::didReceiveResponse): 22 * inspector/agents/InspectorNetworkAgent.h: 23 * inspector/agents/page/PageNetworkAgent.h: 24 * inspector/agents/worker/WorkerNetworkAgent.h: 25 Enable force buffering in a Worker Network Agent. 26 1 27 2017-12-08 Daniel Bates <dabates@apple.com> 2 28 -
trunk/Source/WebCore/inspector/NetworkResourcesData.cpp
r225546 r225708 151 151 } 152 152 153 void NetworkResourcesData::responseReceived(const String& requestId, const String& frameId, const ResourceResponse& response, InspectorPageAgent::ResourceType type )153 void NetworkResourcesData::responseReceived(const String& requestId, const String& frameId, const ResourceResponse& response, InspectorPageAgent::ResourceType type, bool forceBufferData) 154 154 { 155 155 ResourceData* resourceData = resourceDataForRequestId(requestId); … … 161 161 resourceData->setHTTPStatusCode(response.httpStatusCode()); 162 162 resourceData->setType(type); 163 resourceData->setForceBufferData(forceBufferData); 163 164 164 165 if (InspectorNetworkAgent::shouldTreatAsText(response.mimeType())) … … 206 207 static bool shouldBufferResourceData(const NetworkResourcesData::ResourceData& resourceData) 207 208 { 209 if (resourceData.forceBufferData()) 210 return true; 211 208 212 if (resourceData.decoder()) 209 213 return true; -
trunk/Source/WebCore/inspector/NetworkResourcesData.h
r225546 r225708 88 88 void setCachedResource(CachedResource* cachedResource) { m_cachedResource = cachedResource; } 89 89 90 bool forceBufferData() const { return m_forceBufferData; } 91 void setForceBufferData(bool force) { m_forceBufferData = force; } 92 90 93 private: 91 94 bool hasData() const { return m_dataBuffer; } … … 108 111 bool m_isContentEvicted { false }; 109 112 bool m_base64Encoded { false }; 113 bool m_forceBufferData { false }; 110 114 }; 111 115 … … 115 119 void resourceCreated(const String& requestId, const String& loaderId, InspectorPageAgent::ResourceType); 116 120 void resourceCreated(const String& requestId, const String& loaderId, CachedResource&); 117 void responseReceived(const String& requestId, const String& frameId, const ResourceResponse&, InspectorPageAgent::ResourceType );121 void responseReceived(const String& requestId, const String& frameId, const ResourceResponse&, InspectorPageAgent::ResourceType, bool forceBufferData); 118 122 void setResourceType(const String& requestId, InspectorPageAgent::ResourceType); 119 123 InspectorPageAgent::ResourceType resourceType(const String& requestId); -
trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
r225546 r225708 451 451 String loaderId = loaderIdentifier(loader); 452 452 453 m_resourcesData->responseReceived(requestId, frameId, response, type );453 m_resourcesData->responseReceived(requestId, frameId, response, type, shouldForceBufferingNetworkResourceData()); 454 454 455 455 m_frontendDispatcher->responseReceived(requestId, frameId, loaderId, timestamp(), InspectorPageAgent::resourceTypeJSON(type), resourceResponse); -
trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.h
r225546 r225708 124 124 virtual void setResourceCachingDisabled(bool) = 0; 125 125 virtual ScriptExecutionContext* scriptExecutionContext(ErrorString&, const String& frameId) = 0; 126 virtual bool shouldForceBufferingNetworkResourceData() const = 0; 126 127 127 128 private: -
trunk/Source/WebCore/inspector/agents/page/PageNetworkAgent.h
r225263 r225708 43 43 void setResourceCachingDisabled(bool) final; 44 44 ScriptExecutionContext* scriptExecutionContext(ErrorString&, const String& frameId) final; 45 bool shouldForceBufferingNetworkResourceData() const final { return false; } 45 46 46 47 InspectorPageAgent* m_pageAgent { nullptr }; -
trunk/Source/WebCore/inspector/agents/worker/WorkerNetworkAgent.h
r225263 r225708 43 43 void setResourceCachingDisabled(bool) final; 44 44 ScriptExecutionContext* scriptExecutionContext(ErrorString&, const String& frameId) final; 45 bool shouldForceBufferingNetworkResourceData() const final { return true; } 45 46 46 47 WorkerGlobalScope& m_workerGlobalScope;
Note:
See TracChangeset
for help on using the changeset viewer.