Changeset 88937 in webkit
- Timestamp:
- Jun 15, 2011 8:20:27 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r88936 r88937 1 2011-06-15 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Cache XHR content in backend, do not use initialContentSet for XHRs. 6 https://bugs.webkit.org/show_bug.cgi?id=61205 7 8 Added inspector backend cache for XHR content. 9 10 * http/tests/inspector/network/network-xhr-async-expected.txt: Added. 11 * http/tests/inspector/network/network-xhr-async.html: Added. 12 * http/tests/inspector/network/network-xhr-sync-expected.txt: Added. 13 * http/tests/inspector/network/network-xhr-sync.html: Added. 14 1 15 2011-06-15 Pavel Podivilov <podivilov@chromium.org> 2 16 -
trunk/Source/WebCore/CMakeLists.txt
r88798 r88937 886 886 inspector/InspectorValues.cpp 887 887 inspector/InspectorWorkerAgent.cpp 888 inspector/NetworkResourcesData.cpp 888 889 inspector/PageDebuggerAgent.cpp 889 890 inspector/ScriptArguments.cpp -
trunk/Source/WebCore/ChangeLog
r88936 r88937 1 2011-06-15 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Cache XHR content in backend, do not use initialContentSet for XHRs. 6 https://bugs.webkit.org/show_bug.cgi?id=61205 7 8 Added inspector backend cache for XHR content. 9 10 Tests: http/tests/inspector/network/network-xhr-async.html 11 http/tests/inspector/network/network-xhr-sync.html 12 13 * CMakeLists.txt: 14 * GNUmakefile.list.am: 15 * WebCore.gypi: 16 * WebCore.pro: 17 * WebCore.vcproj/WebCore.vcproj: 18 * WebCore.xcodeproj/project.pbxproj: 19 * fileapi/FileReaderLoader.cpp: 20 (WebCore::FileReaderLoader::didReceiveResponse): 21 * fileapi/FileReaderLoader.h: 22 * inspector/Inspector.json: 23 * inspector/InspectorInstrumentation.cpp: 24 (WebCore::InspectorInstrumentation::didReceiveXHRResponseImpl): 25 (WebCore::InspectorInstrumentation::willLoadXHRSynchronouslyImpl): 26 (WebCore::InspectorInstrumentation::didLoadXHRSynchronouslyImpl): 27 (WebCore::InspectorInstrumentation::didCommitLoadImpl): 28 * inspector/InspectorInstrumentation.h: 29 (WebCore::InspectorInstrumentation::didReceiveXHRResponse): 30 (WebCore::InspectorInstrumentation::willLoadXHRSynchronously): 31 (WebCore::InspectorInstrumentation::didLoadXHRSynchronously): 32 * inspector/InspectorResourceAgent.cpp: 33 (WebCore::InspectorResourceAgent::willSendRequest): 34 (WebCore::InspectorResourceAgent::didReceiveResponse): 35 (WebCore::InspectorResourceAgent::setInitialXHRContent): 36 (WebCore::InspectorResourceAgent::didReceiveXHRResponse): 37 (WebCore::InspectorResourceAgent::willLoadXHRSynchronously): 38 (WebCore::InspectorResourceAgent::didLoadXHRSynchronously): 39 (WebCore::InspectorResourceAgent::getResourceContent): 40 (WebCore::InspectorResourceAgent::mainFrameNavigated): 41 (WebCore::InspectorResourceAgent::InspectorResourceAgent): 42 * inspector/InspectorResourceAgent.h: 43 * inspector/NetworkResourcesData.cpp: Added. 44 (WebCore::NetworkResourcesData::ResourceData::ResourceData): 45 (WebCore::NetworkResourcesData::ResourceData::content): 46 (WebCore::NetworkResourcesData::ResourceData::appendContent): 47 (WebCore::NetworkResourcesData::ResourceData::purgeContent): 48 (WebCore::NetworkResourcesData::NetworkResourcesData): 49 (WebCore::NetworkResourcesData::~NetworkResourcesData): 50 (WebCore::NetworkResourcesData::resourceCreated): 51 (WebCore::NetworkResourcesData::responseReceived): 52 (WebCore::NetworkResourcesData::didReceiveXHRResponse): 53 (WebCore::NetworkResourcesData::addResourceContent): 54 (WebCore::NetworkResourcesData::isXHR): 55 (WebCore::NetworkResourcesData::data): 56 (WebCore::NetworkResourcesData::clear): 57 (WebCore::NetworkResourcesData::ensureFreeSpace): 58 * inspector/NetworkResourcesData.h: Added. 59 (WebCore::NetworkResourcesData::ResourceData::identifier): 60 (WebCore::NetworkResourcesData::ResourceData::loaderId): 61 (WebCore::NetworkResourcesData::ResourceData::frameId): 62 (WebCore::NetworkResourcesData::ResourceData::setFrameId): 63 (WebCore::NetworkResourcesData::ResourceData::url): 64 (WebCore::NetworkResourcesData::ResourceData::setUrl): 65 (WebCore::NetworkResourcesData::ResourceData::isXHR): 66 (WebCore::NetworkResourcesData::ResourceData::setIsXHR): 67 (WebCore::NetworkResourcesData::ResourceData::hasContent): 68 (WebCore::NetworkResourcesData::ResourceData::isContentPurged): 69 (WebCore::NetworkResourcesData::ResourceData::setIsContentPurged): 70 * inspector/front-end/NetworkManager.js: 71 (WebInspector.NetworkManager.prototype.requestContent): 72 (WebInspector.NetworkDispatcher.prototype._appendRedirect): 73 * inspector/front-end/NetworkPanel.js: 74 (WebInspector.NetworkPanel.prototype._appendResource): 75 (WebInspector.NetworkPanel.prototype._frameNavigated): 76 * loader/DocumentThreadableLoader.cpp: 77 (WebCore::DocumentThreadableLoader::didReceiveResponse): 78 (WebCore::DocumentThreadableLoader::receivedCancellation): 79 (WebCore::DocumentThreadableLoader::loadRequest): 80 * loader/DocumentThreadableLoader.h: 81 * loader/ThreadableLoaderClient.h: 82 (WebCore::ThreadableLoaderClient::didReceiveResponse): 83 (WebCore::ThreadableLoaderClient::didReceiveAuthenticationCancellation): 84 * loader/ThreadableLoaderClientWrapper.h: 85 (WebCore::ThreadableLoaderClientWrapper::didReceiveResponse): 86 (WebCore::ThreadableLoaderClientWrapper::didReceiveAuthenticationCancellation): 87 * loader/WorkerThreadableLoader.cpp: 88 (WebCore::workerContextDidReceiveResponse): 89 (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse): 90 (WebCore::workerContextDidReceiveAuthenticationCancellation): 91 (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveAuthenticationCancellation): 92 * loader/WorkerThreadableLoader.h: 93 * notifications/Notification.cpp: 94 (WebCore::Notification::didReceiveResponse): 95 (WebCore::Notification::didReceiveAuthenticationCancellation): 96 * notifications/Notification.h: 97 * page/EventSource.cpp: 98 (WebCore::EventSource::didReceiveResponse): 99 * page/EventSource.h: 100 * xml/XMLHttpRequest.cpp: 101 (WebCore::XMLHttpRequest::createRequest): 102 (WebCore::XMLHttpRequest::didReceiveResponse): 103 (WebCore::XMLHttpRequest::didReceiveAuthenticationCancellation): 104 * xml/XMLHttpRequest.h: 105 1 106 2011-06-15 Pavel Podivilov <podivilov@chromium.org> 2 107 -
trunk/Source/WebCore/GNUmakefile.list.am
r88800 r88937 2010 2010 Source/WebCore/inspector/InspectorWorkerResource.h \ 2011 2011 Source/WebCore/inspector/InstrumentingAgents.h \ 2012 Source/WebCore/inspector/NetworkResourcesData.cpp \ 2013 Source/WebCore/inspector/NetworkResourcesData.h \ 2012 2014 Source/WebCore/inspector/PageDebuggerAgent.cpp \ 2013 2015 Source/WebCore/inspector/PageDebuggerAgent.h \ -
trunk/Source/WebCore/WebCore.gypi
r88798 r88937 3316 3316 'inspector/InspectorWorkerAgent.h', 3317 3317 'inspector/InstrumentingAgents.h', 3318 'inspector/NetworkResourcesData.cpp', 3319 'inspector/NetworkResourcesData.h', 3318 3320 'inspector/PageDebuggerAgent.cpp', 3319 3321 'inspector/PageDebuggerAgent.h', -
trunk/Source/WebCore/WebCore.pro
r88798 r88937 840 840 inspector/InspectorValues.cpp \ 841 841 inspector/InspectorWorkerAgent.cpp \ 842 inspector/NetworkResourcesData.cpp \ 842 843 inspector/PageDebuggerAgent.cpp \ 843 844 inspector/ScriptArguments.cpp \ … … 1789 1790 inspector/InspectorWorkerAgent.h \ 1790 1791 inspector/InstrumentingAgents.h \ 1792 inspector/NetworkResourcesData.h \ 1791 1793 inspector/PageDebuggerAgent.h \ 1792 1794 inspector/ScriptGCEventListener.h \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r88798 r88937 67715 67715 </File> 67716 67716 <File 67717 RelativePath="..\inspector\NetworkResourcesData.cpp" 67718 > 67719 </File> 67720 <File 67721 RelativePath="..\inspector\NetworkResourcesData.h" 67722 > 67723 </File> 67724 <File 67717 67725 RelativePath="..\inspector\PageDebuggerAgent.cpp" 67718 67726 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r88905 r88937 1450 1450 59B5977511086579007159E8 /* BridgeJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59B5977411086579007159E8 /* BridgeJSC.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1451 1451 59BC393F11054A1300FD85DB /* JavaStringJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59BC393E11054A1300FD85DB /* JavaStringJSC.h */; }; 1452 59C27F05138D28C10079B7E2 /* NetworkResourcesData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59C27F04138D28C10079B7E2 /* NetworkResourcesData.cpp */; }; 1453 59C27F07138D28CF0079B7E2 /* NetworkResourcesData.h in Headers */ = {isa = PBXBuildFile; fileRef = 59C27F06138D28CF0079B7E2 /* NetworkResourcesData.h */; }; 1452 1454 59D1C10411EB5DCF00B638C8 /* DeviceOrientation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */; }; 1453 1455 59E560A71105336600AA1258 /* JavaClassJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59E560A61105336600AA1258 /* JavaClassJSC.h */; }; … … 7933 7935 59B5977411086579007159E8 /* BridgeJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BridgeJSC.h; path = bridge/jsc/BridgeJSC.h; sourceTree = "<group>"; }; 7934 7936 59BC393E11054A1300FD85DB /* JavaStringJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaStringJSC.h; path = jsc/JavaStringJSC.h; sourceTree = "<group>"; }; 7937 59C27F04138D28C10079B7E2 /* NetworkResourcesData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkResourcesData.cpp; sourceTree = "<group>"; }; 7938 59C27F06138D28CF0079B7E2 /* NetworkResourcesData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkResourcesData.h; sourceTree = "<group>"; }; 7935 7939 59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceOrientation.cpp; sourceTree = "<group>"; }; 7936 7940 59E560A61105336600AA1258 /* JavaClassJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaClassJSC.h; path = jsc/JavaClassJSC.h; sourceTree = "<group>"; }; … … 13302 13306 1C81BA050E97348300266E07 /* JavaScriptCallFrame.idl */, 13303 13307 BCC64F5F0DCFB84E0081EF3B /* localizedStrings.js */, 13308 59C27F04138D28C10079B7E2 /* NetworkResourcesData.cpp */, 13309 59C27F06138D28CF0079B7E2 /* NetworkResourcesData.h */, 13304 13310 F34742DA134362F000531BC2 /* PageDebuggerAgent.cpp */, 13305 13311 F34742DB134362F000531BC2 /* PageDebuggerAgent.h */, … … 21949 21955 656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */, 21950 21956 628D214C12131ED10055DCFC /* NetworkingContext.h in Headers */, 21957 59C27F07138D28CF0079B7E2 /* NetworkResourcesData.h in Headers */, 21951 21958 1A7FA6190DDA3B3A0028F8A5 /* NetworkStateNotifier.h in Headers */, 21952 21959 BCEF43DD0E674012001C1287 /* NinePieceImage.h in Headers */, … … 24902 24909 E12719CA0EEEC21300F61213 /* NavigatorBase.cpp in Sources */, 24903 24910 5D874F130D161D3200796C3B /* NetscapePlugInStreamLoader.cpp in Sources */, 24911 59C27F05138D28C10079B7E2 /* NetworkResourcesData.cpp in Sources */, 24904 24912 1A7FA61B0DDA3BBE0028F8A5 /* NetworkStateNotifier.cpp in Sources */, 24905 24913 1A7FA6490DDA3CBA0028F8A5 /* NetworkStateNotifierMac.cpp in Sources */, -
trunk/Source/WebCore/fileapi/FileReaderLoader.cpp
r84260 r88937 124 124 } 125 125 126 void FileReaderLoader::didReceiveResponse( const ResourceResponse& response)126 void FileReaderLoader::didReceiveResponse(unsigned long, const ResourceResponse& response) 127 127 { 128 128 if (response.httpStatusCode() != 200) { -
trunk/Source/WebCore/fileapi/FileReaderLoader.h
r78782 r88937 67 67 68 68 // ThreadableLoaderClient 69 virtual void didReceiveResponse( const ResourceResponse&);69 virtual void didReceiveResponse(unsigned long, const ResourceResponse&); 70 70 virtual void didReceiveData(const char*, int); 71 71 virtual void didFinishLoading(unsigned long, double); -
trunk/Source/WebCore/inspector/Inspector.json
r88331 r88937 486 486 { "name": "enabled", "type": "boolean" } 487 487 ] 488 }, 489 { 490 "name": "getResourceContent", 491 "description": "Returns content of the given resource.", 492 "parameters": [ 493 { "name": "identifier", "type": "number", "description": "Identifier of the resource to get content for." }, 494 { "name": "base64Encode", "type": "boolean", "optional": true, "description": "Requests that resource content is served as base64." } 495 ], 496 "returns": [ 497 { "name": "content", "type": "string", "description": "Resource content." } 498 ] 488 499 } 489 500 ], … … 561 572 { 562 573 "name": "initialContentSet", 563 "description": "Fired for XMLHttpRequests when their content becomes available.",574 "description": "Fired for worker scripts when their content becomes available.", 564 575 "parameters": [ 565 576 { "name": "identifier", "type": "integer", "description": "Request identifier." }, -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r87992 r88937 517 517 } 518 518 519 void InspectorInstrumentation::didReceiveXHRResponseImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier) 520 { 521 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) 522 resourceAgent->didReceiveXHRResponse(identifier); 523 } 524 525 void InspectorInstrumentation::willLoadXHRSynchronouslyImpl(InstrumentingAgents* instrumentingAgents) 526 { 527 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) 528 resourceAgent->willLoadXHRSynchronously(); 529 } 530 531 void InspectorInstrumentation::didLoadXHRSynchronouslyImpl(InstrumentingAgents* instrumentingAgents) 532 { 533 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) 534 resourceAgent->didLoadXHRSynchronously(); 535 } 536 519 537 void InspectorInstrumentation::scriptImportedImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const String& sourceString) 520 538 { … … 578 596 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorConsoleAgent()) 579 597 consoleAgent->reset(); 598 599 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) 600 resourceAgent->mainFrameNavigated(loader); 601 580 602 #if ENABLE(JAVASCRIPT_DEBUGGER) 581 603 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDebuggerAgent()) { -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r87992 r88937 129 129 static void didFailLoading(Frame*, unsigned long identifier, const ResourceError&); 130 130 static void resourceRetrievedByXMLHttpRequest(ScriptExecutionContext*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber); 131 static void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier); 132 static void willLoadXHRSynchronously(ScriptExecutionContext*); 133 static void didLoadXHRSynchronously(ScriptExecutionContext*); 131 134 static void scriptImported(ScriptExecutionContext*, unsigned long identifier, const String& sourceString); 132 135 static void domContentLoadedEventFired(Frame*, const KURL&); … … 253 256 static void didFailLoadingImpl(InstrumentingAgents*, unsigned long identifier, const ResourceError&); 254 257 static void resourceRetrievedByXMLHttpRequestImpl(InstrumentingAgents*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber); 258 static void didReceiveXHRResponseImpl(InstrumentingAgents*, unsigned long identifier); 259 static void willLoadXHRSynchronouslyImpl(InstrumentingAgents*); 260 static void didLoadXHRSynchronouslyImpl(InstrumentingAgents*); 255 261 static void scriptImportedImpl(InstrumentingAgents*, unsigned long identifier, const String& sourceString); 256 262 static void domContentLoadedEventFiredImpl(InstrumentingAgents*, Frame*, const KURL&); … … 776 782 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) 777 783 resourceRetrievedByXMLHttpRequestImpl(instrumentingAgents, identifier, sourceString, url, sendURL, sendLineNumber); 784 #endif 785 } 786 787 inline void InspectorInstrumentation::didReceiveXHRResponse(ScriptExecutionContext* context, unsigned long identifier) 788 { 789 #if ENABLE(INSPECTOR) 790 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) 791 didReceiveXHRResponseImpl(instrumentingAgents, identifier); 792 #endif 793 } 794 795 inline void InspectorInstrumentation::willLoadXHRSynchronously(ScriptExecutionContext* context) 796 { 797 #if ENABLE(INSPECTOR) 798 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) 799 willLoadXHRSynchronouslyImpl(instrumentingAgents); 800 #endif 801 } 802 803 inline void InspectorInstrumentation::didLoadXHRSynchronously(ScriptExecutionContext* context) 804 { 805 #if ENABLE(INSPECTOR) 806 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) 807 didLoadXHRSynchronouslyImpl(instrumentingAgents); 778 808 #endif 779 809 } -
trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp
r88682 r88937 49 49 #include "InstrumentingAgents.h" 50 50 #include "KURL.h" 51 #include "NetworkResourcesData.h" 51 52 #include "ProgressTracker.h" 52 53 #include "ResourceError.h" … … 195 196 void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse) 196 197 { 198 m_resourcesData->resourceCreated(identifier, m_pageAgent->loaderId(loader)); 199 197 200 RefPtr<InspectorObject> headers = m_state->getObject(ResourceAgentState::extraRequestHeaders); 198 201 … … 242 245 else if (equalIgnoringFragmentIdentifier(response.url(), loader->url()) && type == InspectorPageAgent::OtherResource) 243 246 type = InspectorPageAgent::DocumentResource; 244 } 247 else if (m_loadingXHRSynchronously || m_resourcesData->isXHR(identifier)) 248 type = InspectorPageAgent::XHRResource; 249 250 m_resourcesData->responseReceived(identifier, m_pageAgent->frameId(loader->frame()), response.url()); 251 } 252 245 253 m_frontend->responseReceived(static_cast<int>(identifier), currentTime(), InspectorPageAgent::resourceTypeString(type), resourceResponse); 246 254 // If we revalidated the resource and got Not modified, send content length following didReceiveResponse … … 280 288 void InspectorResourceAgent::setInitialXHRContent(unsigned long identifier, const String& sourceString) 281 289 { 282 m_frontend->initialContentSet(static_cast<int>(identifier), sourceString, InspectorPageAgent::resourceTypeString(InspectorPageAgent::XHRResource)); 290 m_resourcesData->addResourceContent(identifier, sourceString); 291 } 292 293 void InspectorResourceAgent::didReceiveXHRResponse(unsigned long identifier) 294 { 295 m_resourcesData->didReceiveXHRResponse(identifier); 296 } 297 298 void InspectorResourceAgent::willLoadXHRSynchronously() 299 { 300 m_loadingXHRSynchronously = true; 301 } 302 303 void InspectorResourceAgent::didLoadXHRSynchronously() 304 { 305 m_loadingXHRSynchronously = false; 283 306 } 284 307 … … 403 426 } 404 427 428 void InspectorResourceAgent::getResourceContent(ErrorString* errorString, int identifier, const bool* const optionalBase64Encode, String* content) 429 { 430 NetworkResourcesData::ResourceData* resourceData = m_resourcesData->data(identifier); 431 if (!resourceData) { 432 *errorString = "No resource with given identifier found"; 433 return; 434 } 435 436 if (resourceData->hasContent()) 437 *content = resourceData->content(); 438 else if (!resourceData->frameId().isNull() && !resourceData->url().isNull()) 439 m_pageAgent->getResourceContent(errorString, resourceData->frameId(), resourceData->url(), optionalBase64Encode, content); 440 else 441 *errorString = "No data found for resource with given identifier"; 442 } 443 444 void InspectorResourceAgent::mainFrameNavigated(DocumentLoader* loader) 445 { 446 m_resourcesData->clear(m_pageAgent->loaderId(loader)); 447 } 448 405 449 InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorState* state) 406 450 : m_instrumentingAgents(instrumentingAgents) 407 451 , m_pageAgent(pageAgent) 408 452 , m_state(state) 453 , m_resourcesData(adoptPtr(new NetworkResourcesData())) 454 , m_loadingXHRSynchronously(false) 409 455 { 410 456 if (isBackgroundEventsCollectionEnabled()) { -
trunk/Source/WebCore/inspector/InspectorResourceAgent.h
r86959 r88937 35 35 #include "PlatformString.h" 36 36 37 #include <wtf/OwnPtr.h>38 37 #include <wtf/PassRefPtr.h> 39 38 #include <wtf/Vector.h> … … 50 49 class Document; 51 50 class DocumentLoader; 51 class EventsCollector; 52 52 class Frame; 53 53 class InspectorArray; … … 59 59 class InstrumentingAgents; 60 60 class KURL; 61 class EventsCollector;61 class NetworkResourcesData; 62 62 class Page; 63 63 class ResourceError; … … 95 95 void didFailLoading(unsigned long identifier, const ResourceError&); 96 96 void didLoadResourceFromMemoryCache(DocumentLoader*, const CachedResource*); 97 void mainFrameNavigated(DocumentLoader*); 97 98 void setInitialScriptContent(unsigned long identifier, const String& sourceString); 98 99 void setInitialXHRContent(unsigned long identifier, const String& sourceString); 100 void didReceiveXHRResponse(unsigned long identifier); 101 void willLoadXHRSynchronously(); 102 void didLoadXHRSynchronously(); 103 99 104 void applyUserAgentOverride(String* userAgent); 100 105 … … 114 119 void setUserAgentOverride(ErrorString*, const String& userAgent); 115 120 void setExtraHeaders(ErrorString*, PassRefPtr<InspectorObject>); 116 121 void getResourceContent(ErrorString*, int identifier, const bool* const base64Encode, String* content); 122 void clearCache(ErrorString*, const String* const optionalPreservedLoaderId); 117 123 118 124 private: … … 131 137 OwnPtr<InspectorFrontend::Network> m_mockFrontend; 132 138 String m_userAgentOverride; 139 OwnPtr<NetworkResourcesData> m_resourcesData; 140 bool m_loadingXHRSynchronously; 133 141 }; 134 142 -
trunk/Source/WebCore/inspector/front-end/NetworkManager.js
r87681 r88937 49 49 callback(!error ? content : null); 50 50 } 51 PageAgent.getResourceContent(resource.frameId, resource.url, base64Encode, callbackWrapper); 51 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=61363 We should separate NetworkResource (NetworkPanel resource) 52 // from ResourceRevision (ResourcesPanel/ScriptsPanel resource) and request content accordingly. 53 if (resource.identifier) 54 NetworkAgent.getResourceContent(resource.identifier, base64Encode, callbackWrapper); 55 else 56 PageAgent.getResourceContent(resource.frameId, resource.url, base64Encode, callbackWrapper); 52 57 }, 53 58 … … 264 269 var originalResource = this._inflightResourcesById[identifier]; 265 270 var previousRedirects = originalResource.redirects || []; 266 originalResource.identifier = "redirected:" + identifier + "." + previousRedirects.length;271 delete originalResource.identifier; 267 272 delete originalResource.redirects; 268 273 this._finishResource(originalResource, time); -
trunk/Source/WebCore/inspector/front-end/NetworkPanel.js
r88927 r88937 742 742 { 743 743 this._resources.push(resource); 744 this._resourcesById[resource.identifier] = resource; 744 if (resource.identifier) 745 this._resourcesById[resource.identifier] = resource; 745 746 this._resourcesByURL[resource.url] = resource; 746 747 … … 779 780 var loaderId = event.data.loaderId; 780 781 // Main frame committed load. 781 if (this._preserveLogToggle.toggled) 782 if (this._preserveLogToggle.toggled) { 783 for (var i = 0; i < this._resources.length; ++i) { 784 var resource = this._resources[i]; 785 if (resource.loaderId !== loaderId) 786 resource.identifier = null; 787 } 782 788 return; 789 } 783 790 784 791 // Preserve provisional load resources. -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r87423 r88937 172 172 void DocumentThreadableLoader::didReceiveResponse(SubresourceLoader* loader, const ResourceResponse& response) 173 173 { 174 ASSERT(m_client); 175 ASSERT_UNUSED(loader, loader == m_loader); 174 ASSERT(loader == m_loader); 175 didReceiveResponse(loader->identifier(), response); 176 } 177 178 void DocumentThreadableLoader::didReceiveResponse(unsigned long identifier, const ResourceResponse& response) 179 { 180 ASSERT(m_client); 176 181 177 182 String accessControlErrorDescription; … … 199 204 } 200 205 201 m_client->didReceiveResponse( response);206 m_client->didReceiveResponse(identifier, response); 202 207 } 203 208 } … … 286 291 ASSERT(m_client); 287 292 ASSERT_UNUSED(loader, loader == m_loader); 288 m_client->didReceiveAuthenticationCancellation( challenge.failureResponse());293 m_client->didReceiveAuthenticationCancellation(loader->identifier(), challenge.failureResponse()); 289 294 } 290 295 … … 352 357 } 353 358 354 didReceiveResponse( 0, response);359 didReceiveResponse(identifier, response); 355 360 356 361 const char* bytes = static_cast<const char*>(data.data()); -
trunk/Source/WebCore/loader/DocumentThreadableLoader.h
r87423 r88937 87 87 virtual void receivedCancellation(SubresourceLoader*, const AuthenticationChallenge&); 88 88 89 void didReceiveResponse(unsigned long identifier, const ResourceResponse&); 89 90 void didFinishLoading(unsigned long identifier, double finishTime); 90 91 void makeSimpleCrossOriginAccessRequest(const ResourceRequest& request); -
trunk/Source/WebCore/loader/ThreadableLoaderClient.h
r79110 r88937 43 43 virtual void didSendData(unsigned long long /*bytesSent*/, unsigned long long /*totalBytesToBeSent*/) { } 44 44 45 virtual void didReceiveResponse( const ResourceResponse&) { }45 virtual void didReceiveResponse(unsigned long identifier, const ResourceResponse&) { } 46 46 virtual void didReceiveData(const char*, int /*dataLength*/) { } 47 47 virtual void didReceiveCachedMetadata(const char*, int /*dataLength*/) { } … … 50 50 virtual void didFailRedirectCheck() { } 51 51 52 virtual void didReceiveAuthenticationCancellation( const ResourceResponse&) { }52 virtual void didReceiveAuthenticationCancellation(unsigned long identifier, const ResourceResponse&) { } 53 53 54 54 virtual bool isDocumentThreadableLoaderClient() { return false; } -
trunk/Source/WebCore/loader/ThreadableLoaderClientWrapper.h
r81567 r88937 63 63 } 64 64 65 void didReceiveResponse( const ResourceResponse& response)65 void didReceiveResponse(unsigned long identifier, const ResourceResponse& response) 66 66 { 67 67 if (m_client) 68 m_client->didReceiveResponse( response);68 m_client->didReceiveResponse(identifier, response); 69 69 } 70 70 … … 102 102 } 103 103 104 void didReceiveAuthenticationCancellation( const ResourceResponse& response)104 void didReceiveAuthenticationCancellation(unsigned long identifier, const ResourceResponse& response) 105 105 { 106 106 if (m_client) 107 m_client->didReceiveResponse( response);107 m_client->didReceiveResponse(identifier, response); 108 108 } 109 109 -
trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp
r85165 r88937 178 178 } 179 179 180 static void workerContextDidReceiveResponse(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<CrossThreadResourceResponseData> responseData)180 static void workerContextDidReceiveResponse(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, unsigned long identifier, PassOwnPtr<CrossThreadResourceResponseData> responseData) 181 181 { 182 182 ASSERT_UNUSED(context, context->isWorkerContext()); 183 183 OwnPtr<ResourceResponse> response(ResourceResponse::adopt(responseData)); 184 workerClientWrapper->didReceiveResponse( *response);185 } 186 187 void WorkerThreadableLoader::MainThreadBridge::didReceiveResponse( const ResourceResponse& response)188 { 189 m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveResponse, m_workerClientWrapper, response), m_taskMode);184 workerClientWrapper->didReceiveResponse(identifier, *response); 185 } 186 187 void WorkerThreadableLoader::MainThreadBridge::didReceiveResponse(unsigned long identifier, const ResourceResponse& response) 188 { 189 m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveResponse, m_workerClientWrapper, identifier, response), m_taskMode); 190 190 } 191 191 … … 249 249 } 250 250 251 static void workerContextDidReceiveAuthenticationCancellation(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<CrossThreadResourceResponseData> responseData)251 static void workerContextDidReceiveAuthenticationCancellation(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, unsigned long identifier, PassOwnPtr<CrossThreadResourceResponseData> responseData) 252 252 { 253 253 ASSERT_UNUSED(context, context->isWorkerContext()); 254 254 OwnPtr<ResourceResponse> response(ResourceResponse::adopt(responseData)); 255 workerClientWrapper->didReceiveAuthenticationCancellation( *response);256 } 257 258 void WorkerThreadableLoader::MainThreadBridge::didReceiveAuthenticationCancellation( const ResourceResponse& response)259 { 260 m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveAuthenticationCancellation, m_workerClientWrapper, response), m_taskMode);255 workerClientWrapper->didReceiveAuthenticationCancellation(identifier, *response); 256 } 257 258 void WorkerThreadableLoader::MainThreadBridge::didReceiveAuthenticationCancellation(unsigned long identifier, const ResourceResponse& response) 259 { 260 m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveAuthenticationCancellation, m_workerClientWrapper, identifier, response), m_taskMode); 261 261 } 262 262 -
trunk/Source/WebCore/loader/WorkerThreadableLoader.h
r81639 r88937 114 114 static void mainThreadCancel(ScriptExecutionContext*, MainThreadBridge*); 115 115 virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent); 116 virtual void didReceiveResponse( const ResourceResponse&);116 virtual void didReceiveResponse(unsigned long identifier, const ResourceResponse&); 117 117 virtual void didReceiveData(const char*, int dataLength); 118 118 virtual void didReceiveCachedMetadata(const char*, int dataLength); … … 120 120 virtual void didFail(const ResourceError&); 121 121 virtual void didFailRedirectCheck(); 122 virtual void didReceiveAuthenticationCancellation( const ResourceResponse&);122 virtual void didReceiveAuthenticationCancellation(unsigned long identifier, const ResourceResponse&); 123 123 124 124 // Only to be used on the main thread. -
trunk/Source/WebCore/notifications/Notification.cpp
r86325 r88937 182 182 } 183 183 184 void Notification::didReceiveResponse( const ResourceResponse& response)184 void Notification::didReceiveResponse(unsigned long, const ResourceResponse& response) 185 185 { 186 186 int status = response.httpStatusCode(); … … 212 212 } 213 213 214 void Notification::didReceiveAuthenticationCancellation( const ResourceResponse&)214 void Notification::didReceiveAuthenticationCancellation(unsigned long, const ResourceResponse&) 215 215 { 216 216 finishLoading(); -
trunk/Source/WebCore/notifications/Notification.h
r86325 r88937 103 103 void detachPresenter() { } 104 104 105 virtual void didReceiveResponse( const ResourceResponse&);105 virtual void didReceiveResponse(unsigned long, const ResourceResponse&); 106 106 virtual void didReceiveData(const char* data, int dataLength); 107 107 virtual void didFinishLoading(unsigned long identifier, double finishTime); 108 108 virtual void didFail(const ResourceError&); 109 109 virtual void didFailRedirectCheck(); 110 virtual void didReceiveAuthenticationCancellation( const ResourceResponse&);110 virtual void didReceiveAuthenticationCancellation(unsigned long, const ResourceResponse&); 111 111 112 112 private: -
trunk/Source/WebCore/page/EventSource.cpp
r86135 r88937 182 182 } 183 183 184 void EventSource::didReceiveResponse( const ResourceResponse& response)184 void EventSource::didReceiveResponse(unsigned long, const ResourceResponse& response) 185 185 { 186 186 int statusCode = response.httpStatusCode(); -
trunk/Source/WebCore/page/EventSource.h
r78782 r88937 91 91 virtual EventTargetData* ensureEventTargetData(); 92 92 93 virtual void didReceiveResponse( const ResourceResponse&);93 virtual void didReceiveResponse(unsigned long, const ResourceResponse&); 94 94 virtual void didReceiveData(const char*, int); 95 95 virtual void didFinishLoading(unsigned long, double); -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r87423 r88937 673 673 setPendingActivity(this); 674 674 } 675 } else 675 } else { 676 InspectorInstrumentation::willLoadXHRSynchronously(scriptExecutionContext()); 676 677 ThreadableLoader::loadResourceSynchronously(scriptExecutionContext(), request, *this, options); 678 InspectorInstrumentation::didLoadXHRSynchronously(scriptExecutionContext()); 679 } 677 680 678 681 if (!m_exceptionCode && m_error) … … 1033 1036 } 1034 1037 1035 void XMLHttpRequest::didReceiveResponse(const ResourceResponse& response) 1036 { 1038 void XMLHttpRequest::didReceiveResponse(unsigned long identifier, const ResourceResponse& response) 1039 { 1040 InspectorInstrumentation::didReceiveXHRResponse(scriptExecutionContext(), identifier); 1041 1037 1042 m_response = response; 1038 1043 m_responseEncoding = extractCharsetFromMediaType(m_mimeTypeOverride); … … 1041 1046 } 1042 1047 1043 void XMLHttpRequest::didReceiveAuthenticationCancellation( const ResourceResponse& failureResponse)1048 void XMLHttpRequest::didReceiveAuthenticationCancellation(unsigned long, const ResourceResponse& failureResponse) 1044 1049 { 1045 1050 m_response = failureResponse; -
trunk/Source/WebCore/xml/XMLHttpRequest.h
r87423 r88937 151 151 152 152 virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent); 153 virtual void didReceiveResponse( const ResourceResponse&);153 virtual void didReceiveResponse(unsigned long identifier, const ResourceResponse&); 154 154 virtual void didReceiveData(const char* data, int dataLength); 155 155 virtual void didFinishLoading(unsigned long identifier, double finishTime); 156 156 virtual void didFail(const ResourceError&); 157 157 virtual void didFailRedirectCheck(); 158 virtual void didReceiveAuthenticationCancellation( const ResourceResponse&);158 virtual void didReceiveAuthenticationCancellation(unsigned long identifier, const ResourceResponse&); 159 159 160 160 String responseMIMEType() const; -
trunk/Source/WebKit/chromium/ChangeLog
r88922 r88937 1 2011-06-15 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Cache XHR content in backend, do not use initialContentSet for XHRs. 6 https://bugs.webkit.org/show_bug.cgi?id=61205 7 8 Added inspector backend cache for XHR content. 9 10 * src/AssociatedURLLoader.cpp: 11 (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveResponse): 12 1 13 2011-06-15 Pavel Feldman <pfeldman@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/src/AssociatedURLLoader.cpp
r88523 r88937 61 61 virtual void willSendRequest(ResourceRequest& /*newRequest*/, const ResourceResponse& /*redirectResponse*/); 62 62 63 virtual void didReceiveResponse( const ResourceResponse&);63 virtual void didReceiveResponse(unsigned long, const ResourceResponse&); 64 64 virtual void didReceiveData(const char*, int /*dataLength*/); 65 65 virtual void didReceiveCachedMetadata(const char*, int /*dataLength*/); … … 114 114 } 115 115 116 void AssociatedURLLoader::ClientAdapter::didReceiveResponse( const ResourceResponse& response)116 void AssociatedURLLoader::ClientAdapter::didReceiveResponse(unsigned long, const ResourceResponse& response) 117 117 { 118 118 WrappedResourceResponse wrappedResponse(response);
Note: See TracChangeset
for help on using the changeset viewer.