Changeset 87681 in webkit
- Timestamp:
- May 30, 2011 2:18:16 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87680 r87681 1 2011-05-30 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: do not issue frontendReused for reload or navigation. 6 https://bugs.webkit.org/show_bug.cgi?id=61192 7 8 - only issue frontendReused when inspector is attached after main resource committed load 9 - upon committing loading main resource, reset agents before sending FrameNavigated to page agent 10 - Ensure main resource is set early so that abbreviations of URLs in resource tree are consistent after reload 11 - do not enable agents explicitly in frontendReused (this is done by backend when resotring state from cookie) 12 13 * inspector/InspectorAgent.cpp: 14 (WebCore::InspectorAgent::InspectorAgent): 15 (WebCore::InspectorAgent::restore): 16 (WebCore::InspectorAgent::clearFrontend): 17 (WebCore::InspectorAgent::didCommitLoad): 18 * inspector/InspectorAgent.h: 19 * inspector/InspectorInstrumentation.cpp: 20 (WebCore::InspectorInstrumentation::didCommitLoadImpl): 21 * inspector/front-end/NetworkManager.js: 22 * inspector/front-end/ResourceTreeModel.js: 23 (WebInspector.ResourceTreeModel.prototype._processCachedResources): 24 (WebInspector.ResourceTreeModel.prototype._frameNavigated): 25 (WebInspector.ResourceTreeModel.prototype._cleanupFramesAfterNavigation): 26 (WebInspector.ResourceTreeModel.prototype._addFramesRecursively): 27 * inspector/front-end/ResourcesPanel.js: 28 (WebInspector.ResourcesPanel.prototype.reset): 29 (WebInspector.ResourcesPanel.prototype._resetResourcesTree): 30 (WebInspector.DatabaseTreeElement.prototype.onpopulate): 31 (WebInspector.SearchResultsTreeElementsTraverser.prototype._lastTreeElement): 32 * inspector/front-end/inspector.js: 33 (WebInspector.reset): 34 (WebInspector.frontendReused): 35 1 36 2011-05-30 Ryan Sleevi <rsleevi@chromium.org> 2 37 -
trunk/Source/WebCore/inspector/InspectorAgent.cpp
r86564 r87681 68 68 , m_injectedScriptManager(injectedScriptManager) 69 69 , m_canIssueEvaluateForTestInFrontend(false) 70 , m_didCommitLoadFired(false) 70 71 { 71 72 ASSERT_ARG(page, page); … … 91 92 void InspectorAgent::restore() 92 93 { 93 m_frontend->inspector()->frontendReused(); 94 if (m_didCommitLoadFired) 95 m_frontend->inspector()->frontendReused(); 94 96 } 95 97 … … 128 130 m_pendingEvaluateTestCommands.clear(); 129 131 m_frontend = 0; 132 m_didCommitLoadFired = false; 130 133 } 131 134 132 135 void InspectorAgent::didCommitLoad() 133 136 { 137 m_didCommitLoadFired = true; 134 138 if (m_frontend) 135 139 m_frontend->inspector()->reset(); -
trunk/Source/WebCore/inspector/InspectorAgent.h
r86564 r87681 125 125 #endif 126 126 bool m_canIssueEvaluateForTestInFrontend; 127 bool m_didCommitLoadFired; 127 128 }; 128 129 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r86752 r87681 574 574 return; 575 575 576 Frame* mainFrame = page->mainFrame(); 577 if (loader->frame() == mainFrame) { 578 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorConsoleAgent()) 579 consoleAgent->reset(); 580 #if ENABLE(JAVASCRIPT_DEBUGGER) 581 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDebuggerAgent()) { 582 KURL url = inspectorAgent->inspectedURLWithoutFragment(); 583 debuggerAgent->inspectedURLChanged(url); 584 } 585 #endif 586 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC) 587 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorProfilerAgent()) { 588 profilerAgent->stopUserInitiatedProfiling(true); 589 profilerAgent->resetState(); 590 } 591 #endif 592 if (InspectorCSSAgent* cssAgent = instrumentingAgents->inspectorCSSAgent()) 593 cssAgent->reset(); 594 #if ENABLE(DATABASE) 595 if (InspectorDatabaseAgent* databaseAgent = instrumentingAgents->inspectorDatabaseAgent()) 596 databaseAgent->clearResources(); 597 #endif 598 #if ENABLE(DOM_STORAGE) 599 if (InspectorDOMStorageAgent* domStorageAgent = instrumentingAgents->inspectorDOMStorageAgent()) 600 domStorageAgent->clearResources(); 601 #endif 602 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) 603 domAgent->setDocument(mainFrame->document()); 604 605 inspectorAgent->didCommitLoad(); 606 } 576 607 if (InspectorPageAgent* pageAgent = instrumentingAgents->inspectorPageAgent()) 577 608 pageAgent->frameNavigated(loader); 578 579 Frame* mainFrame = page->mainFrame();580 if (loader->frame() != mainFrame)581 return;582 583 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorConsoleAgent())584 consoleAgent->reset();585 #if ENABLE(JAVASCRIPT_DEBUGGER)586 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDebuggerAgent()) {587 KURL url = inspectorAgent->inspectedURLWithoutFragment();588 debuggerAgent->inspectedURLChanged(url);589 }590 #endif591 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)592 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorProfilerAgent()) {593 profilerAgent->stopUserInitiatedProfiling(true);594 profilerAgent->resetState();595 }596 #endif597 if (InspectorCSSAgent* cssAgent = instrumentingAgents->inspectorCSSAgent())598 cssAgent->reset();599 #if ENABLE(DATABASE)600 if (InspectorDatabaseAgent* databaseAgent = instrumentingAgents->inspectorDatabaseAgent())601 databaseAgent->clearResources();602 #endif603 #if ENABLE(DOM_STORAGE)604 if (InspectorDOMStorageAgent* domStorageAgent = instrumentingAgents->inspectorDOMStorageAgent())605 domStorageAgent->clearResources();606 #endif607 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent())608 domAgent->setDocument(mainFrame->document());609 610 inspectorAgent->didCommitLoad();611 609 } 612 610 -
trunk/Source/WebCore/inspector/front-end/NetworkManager.js
r86752 r87681 43 43 44 44 WebInspector.NetworkManager.prototype = { 45 frontendReused: function()46 {47 NetworkAgent.enable();48 },49 50 45 requestContent: function(resource, base64Encode, callback) 51 46 { -
trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js
r87383 r87681 74 74 75 75 this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources); 76 WebInspector.mainResource =this._addFramesRecursively(mainFramePayload);76 this._addFramesRecursively(mainFramePayload); 77 77 this._dispatchInspectedURLChanged(WebInspector.mainResource.url); 78 78 this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded); … … 102 102 }, 103 103 104 frames: function(parentFrameId)105 {106 return this._subframes[parentFrameId] || [];107 },108 109 104 subframes: function(parentFrameId) 110 105 { … … 123 118 _frameNavigated: function(frame, loaderId) 124 119 { 120 var isMainFrame = !frame.parentId; 121 122 if (isMainFrame) { 123 this._cleanupFramesAfterNavigation(frame); 124 if (this.resourceForURL(frame.url)) 125 WebInspector.mainResource = this.resourceForURL(frame.url); 126 } 125 127 // Do nothing unless cached resource tree is processed - it will overwrite everything. 126 128 if (!this._cachedResourcesProcessed) … … 130 132 if (!this._frameIds[frame.id]) 131 133 this._addFrame(frame); 132 else 134 else { 133 135 this._clearChildFramesAndResources(frame.id, loaderId); 134 135 136 var isMainFrame = !frame.parentId; 137 136 frame.parentId = frame.parentId || ""; 137 this._frameIds[frame.id] = frame; 138 } 138 139 // Dispatch frame navigated event to clients prior to filling it with the resources. 139 140 this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, { frame: frame, loaderId: loaderId, isMainFrame: isMainFrame }); … … 146 147 } 147 148 148 // Update main frame, issue top-level navigate events. 149 if (isMainFrame && this.resourceForURL(frame.url)) { 150 WebInspector.mainResource = this.resourceForURL(frame.url); 149 if (isMainFrame) 151 150 this._dispatchInspectedURLChanged(frame.url); 151 }, 152 153 _cleanupFramesAfterNavigation: function(newMainFrame) 154 { 155 for (var frameId in this._frameIds) { 156 if (frameId !== newMainFrame.id) 157 this._frameDetached(frameId); 152 158 } 153 159 }, … … 318 324 frameResource.finished = true; 319 325 326 if (!framePayload.parentId) 327 WebInspector.mainResource = frameResource; 320 328 this._addFrame(framePayload); 321 329 this._addResourceToFrame(frameResource); … … 335 343 this._addResourceToFrame(resource); 336 344 } 337 return frameResource;338 345 }, 339 346 -
trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js
r87383 r87681 131 131 }, 132 132 133 _reset: function()133 reset: function() 134 134 { 135 135 delete this._initializedDefaultSelection; … … 256 256 this.resourcesListTreeElement.removeChildren(); 257 257 this._treeElementForFrameId = {}; 258 this. _reset();258 this.reset(); 259 259 }, 260 260 … … 1027 1027 } 1028 1028 } 1029 1029 1030 WebInspector.StorageCategoryTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype; 1030 1031 … … 1455 1456 this._database.getTableNames(tableNamesCallback.bind(this)); 1456 1457 } 1457 1458 } 1458 } 1459 1459 1460 WebInspector.DatabaseTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype; 1460 1461 … … 1730 1731 treeElement = nextTreeElement; 1731 1732 return treeElement; 1732 } ,1733 } 1733 } 1734 } -
trunk/Source/WebCore/inspector/front-end/inspector.js
r86932 r87681 974 974 { 975 975 this.debuggerModel.reset(); 976 977 976 for (var panelName in this.panels) { 978 977 var panel = this.panels[panelName]; … … 1357 1356 WebInspector.frontendReused = function() 1358 1357 { 1359 ConsoleAgent.enable(this.console.setConsoleMessageExpiredCount.bind(this.console));1360 DatabaseAgent.enable();1361 DOMStorageAgent.enable();1362 1363 this.networkManager.frontendReused();1364 1358 this.resourceTreeModel.frontendReused(); 1365 WebInspector.panels.network.clear();1366 1359 this.reset(); 1367 1360 }
Note: See TracChangeset
for help on using the changeset viewer.