Changeset 91006 in webkit
- Timestamp:
- Jul 14, 2011 9:59:11 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r91005 r91006 1 2011-07-14 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: InspectorResourceAgent should generate unique identifier and save cachedResource for resources from memory cache. 4 https://bugs.webkit.org/show_bug.cgi?id=64356 5 6 Reviewed by Yury Semikhatsky. 7 8 * inspector/Inspector.json: 9 * inspector/InspectorInstrumentation.cpp: 10 (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl): 11 * inspector/InspectorInstrumentation.h: 12 (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache): 13 * inspector/InspectorResourceAgent.cpp: 14 (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache): 15 * inspector/InspectorResourceAgent.h: 16 * inspector/front-end/NetworkManager.js: 17 (WebInspector.NetworkManager.prototype.requestContent): 18 (WebInspector.NetworkDispatcher): 19 (WebInspector.NetworkDispatcher.prototype.resourceLoadedFromMemoryCache): 20 (WebInspector.NetworkDispatcher.prototype._appendRedirect): 21 * inspector/front-end/NetworkPanel.js: 22 (WebInspector.NetworkLogView.prototype._frameNavigated): 23 * loader/FrameLoader.cpp: 24 (WebCore::FrameLoader::loadedResourceFromMemoryCache): 25 * loader/FrameLoader.h: 26 1 27 2011-07-14 Tim Horton <timothy_horton@apple.com> 2 28 -
trunk/Source/WebCore/inspector/Inspector.json
r90626 r91006 574 574 "description": "Fired when HTTP request has been served from memory cache.", 575 575 "parameters": [ 576 { "name": "identifier", "type": "integer", "description": "Request identifier." }, 576 577 { "name": "frameId", "type": "string", "description": "Frame identifier." }, 577 578 { "name": "loaderId", "type": "string", "description": "Loader identifier." }, -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r90544 r91006 423 423 } 424 424 425 void InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl(InstrumentingAgents* instrumentingAgents, DocumentLoader* loader, constCachedResource* cachedResource)425 void InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl(InstrumentingAgents* instrumentingAgents, DocumentLoader* loader, CachedResource* cachedResource) 426 426 { 427 427 InspectorAgent* inspectorAgent = instrumentingAgents->inspectorAgent(); -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r90389 r91006 119 119 static void continueAfterPingLoader(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&); 120 120 static void markResourceAsCached(Page*, unsigned long identifier); 121 static void didLoadResourceFromMemoryCache(Page*, DocumentLoader*, constCachedResource*);121 static void didLoadResourceFromMemoryCache(Page*, DocumentLoader*, CachedResource*); 122 122 static InspectorInstrumentationCookie willReceiveResourceData(Frame*, unsigned long identifier); 123 123 static void didReceiveResourceData(const InspectorInstrumentationCookie&); … … 246 246 static void continueAfterPingLoaderImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&); 247 247 static void markResourceAsCachedImpl(InstrumentingAgents*, unsigned long identifier); 248 static void didLoadResourceFromMemoryCacheImpl(InstrumentingAgents*, DocumentLoader*, constCachedResource*);248 static void didLoadResourceFromMemoryCacheImpl(InstrumentingAgents*, DocumentLoader*, CachedResource*); 249 249 static InspectorInstrumentationCookie willReceiveResourceDataImpl(InstrumentingAgents*, unsigned long identifier); 250 250 static void didReceiveResourceDataImpl(const InspectorInstrumentationCookie&); … … 697 697 } 698 698 699 inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page* page, DocumentLoader* loader, constCachedResource* resource)699 inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page* page, DocumentLoader* loader, CachedResource* resource) 700 700 { 701 701 #if ENABLE(INSPECTOR) -
trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp
r90553 r91006 52 52 #include "KURL.h" 53 53 #include "NetworkResourcesData.h" 54 #include "Page.h" 54 55 #include "ProgressTracker.h" 55 56 #include "ResourceError.h" … … 292 293 } 293 294 294 void InspectorResourceAgent::didLoadResourceFromMemoryCache(DocumentLoader* loader, const CachedResource* resource) 295 { 296 m_frontend->resourceLoadedFromMemoryCache(m_pageAgent->frameId(loader->frame()), m_pageAgent->loaderId(loader), loader->url().string(), currentTime(), buildObjectForCachedResource(*resource)); 295 void InspectorResourceAgent::didLoadResourceFromMemoryCache(DocumentLoader* loader, CachedResource* resource) 296 { 297 String loaderId = m_pageAgent->loaderId(loader); 298 String frameId = m_pageAgent->frameId(loader->frame()); 299 unsigned long identifier = loader->frame()->page()->progress()->createUniqueIdentifier(); 300 m_resourcesData->resourceCreated(identifier, loaderId); 301 m_resourcesData->addCachedResource(identifier, resource); 302 303 m_frontend->resourceLoadedFromMemoryCache(static_cast<int>(identifier), frameId, loaderId, loader->url().string(), currentTime(), buildObjectForCachedResource(*resource)); 297 304 } 298 305 -
trunk/Source/WebCore/inspector/InspectorResourceAgent.h
r90553 r91006 95 95 void didFinishLoading(unsigned long identifier, DocumentLoader*, double finishTime); 96 96 void didFailLoading(unsigned long identifier, DocumentLoader*, const ResourceError&); 97 void didLoadResourceFromMemoryCache(DocumentLoader*, constCachedResource*);97 void didLoadResourceFromMemoryCache(DocumentLoader*, CachedResource*); 98 98 void mainFrameNavigated(DocumentLoader*); 99 99 void setInitialScriptContent(unsigned long identifier, const String& sourceString); -
trunk/Source/WebCore/inspector/front-end/NetworkManager.js
r90913 r91006 54 54 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=61363 We should separate NetworkResource (NetworkPanel resource) 55 55 // from ResourceRevision (ResourcesPanel/ScriptsPanel resource) and request content accordingly. 56 if (resource. hasNetworkData)56 if (resource.identifier && !resource.networkDataRemoved) 57 57 NetworkAgent.getResourceContent(resource.identifier, callbackWrapper); 58 58 else … … 73 73 this._inflightResourcesById = {}; 74 74 this._inflightResourcesByURL = {}; 75 this._lastIdentifierForCachedResource = 0;76 75 InspectorBackend.registerDomainDispatcher("Network", this); 77 76 } … … 205 204 }, 206 205 207 resourceLoadedFromMemoryCache: function( frameId, loaderId, documentURL, time, cachedResource)208 { 209 var resource = this._createResource( "cached:" + ++this._lastIdentifierForCachedResource, frameId, loaderId, cachedResource.url, documentURL);206 resourceLoadedFromMemoryCache: function(identifier, frameId, loaderId, documentURL, time, cachedResource) 207 { 208 var resource = this._createResource(identifier, frameId, loaderId, cachedResource.url, documentURL); 210 209 this._updateResourceWithCachedResource(resource, cachedResource); 211 210 resource.cached = true; … … 277 276 originalResource.identifier = "redirected:" + identifier + "." + previousRedirects.length; 278 277 delete originalResource.redirects; 279 originalResource. hasNetworkData = false;278 originalResource.networkDataRemoved = true; 280 279 this._finishResource(originalResource, time); 281 280 var newResource = this._createResource(identifier, originalResource.frameId, originalResource.loaderId, -
trunk/Source/WebCore/inspector/front-end/NetworkPanel.js
r90913 r91006 758 758 var resource = this._resources[i]; 759 759 if (resource.loaderId !== loaderId) 760 resource.hasNetworkData = false;760 originalResource.networkDataRemoved = true; 761 761 } 762 762 return; -
trunk/Source/WebCore/loader/FrameLoader.cpp
r90936 r91006 2860 2860 } 2861 2861 2862 void FrameLoader::loadedResourceFromMemoryCache( constCachedResource* resource)2862 void FrameLoader::loadedResourceFromMemoryCache(CachedResource* resource) 2863 2863 { 2864 2864 Page* page = m_frame->page(); -
trunk/Source/WebCore/loader/FrameLoader.h
r90164 r91006 178 178 void didFirstVisuallyNonEmptyLayout(); 179 179 180 void loadedResourceFromMemoryCache( constCachedResource*);180 void loadedResourceFromMemoryCache(CachedResource*); 181 181 void tellClientAboutPastMemoryCacheLoads(); 182 182
Note: See TracChangeset
for help on using the changeset viewer.