Changeset 186368 in webkit
- Timestamp:
- Jul 6, 2015, 12:44:23 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r186367 r186368 1 2015-07-04 Timothy Hatcher <timothy@apple.com> 2 3 Web Inspector: Add a dedicated Network tab that is always live 4 https://bugs.webkit.org/show_bug.cgi?id=146568 5 6 Make sure the executionStopwatch is always started and never stops so resource loads 7 always get timestamps, even when Timeline is not recording. 8 9 Reviewed by Joseph Pecoraro. 10 11 * inspector/InspectorPageAgent.cpp: 12 (WebCore::InspectorPageAgent::enable): Start executionStopwatch. 13 (WebCore::InspectorPageAgent::frameStartedLoading): Reset and start executionStopwatch. 14 * inspector/InspectorTimelineAgent.cpp: 15 (WebCore::InspectorTimelineAgent::internalStart): Removed executionStopwatch code. 16 (WebCore::InspectorTimelineAgent::internalStop): Ditto. 17 1 18 2015-07-02 Timothy Hatcher <timothy@apple.com> 2 19 -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r186279 r186368 368 368 m_instrumentingAgents->setInspectorPageAgent(this); 369 369 370 m_instrumentingAgents->inspectorEnvironment().executionStopwatch()->start(); 371 370 372 if (Frame* frame = mainFrame()) 371 373 m_originalScriptExecutionDisabled = !frame->settings().isScriptEnabled(); … … 820 822 void InspectorPageAgent::frameStartedLoading(Frame& frame) 821 823 { 824 if (frame.isMainFrame()) { 825 auto stopwatch = m_instrumentingAgents->inspectorEnvironment().executionStopwatch(); 826 stopwatch->reset(); 827 stopwatch->start(); 828 } 829 822 830 m_frontendDispatcher->frameStartedLoading(frameId(&frame)); 823 831 } -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r186279 r186368 141 141 m_maxCallStackDepth = 5; 142 142 143 // If the debugger is paused the environment's stopwatch will be stopped, and shouldn't be144 // restarted until the debugger continues.145 if (!m_scriptDebugServer->isPaused())146 m_instrumentingAgents->inspectorEnvironment().executionStopwatch()->start();147 148 143 m_instrumentingAgents->setInspectorTimelineAgent(this); 149 144 … … 198 193 if (!m_enabled) 199 194 return; 200 201 // The environment's stopwatch could be already stopped if the debugger has paused.202 auto stopwatch = m_instrumentingAgents->inspectorEnvironment().executionStopwatch();203 if (stopwatch->isActive())204 stopwatch->stop();205 195 206 196 m_instrumentingAgents->setInspectorTimelineAgent(nullptr); -
trunk/Source/WebInspectorUI/ChangeLog
r186354 r186368 1 2015-07-02 Timothy Hatcher <timothy@apple.com> 2 3 Web Inspector: Add a dedicated Network tab that is always live 4 https://bugs.webkit.org/show_bug.cgi?id=146568 5 6 Reviewed by Joseph Pecoraro. 7 8 * Localizations/en.lproj/localizedStrings.js: Updated. 9 10 * UserInterface/Base/Main.js: 11 (WebInspector.loaded): 12 (WebInspector.isTabTypeAllowed): 13 (WebInspector._tabContentViewForType): 14 (WebInspector._updateNewTabButtonState): 15 Add NetworkTabContentView to the right places. 16 17 * UserInterface/Controllers/TimelineManager.js: 18 (WebInspector.TimelineManager): 19 (WebInspector.TimelineManager.prototype.get persistentNetworkTimeline): 20 (WebInspector.TimelineManager.prototype._mainResourceDidChange): 21 (WebInspector.TimelineManager.prototype._resourceWasAdded): 22 Add a persistent network timeline that always has all resources. 23 24 * UserInterface/Images/Network.svg: Added. 25 26 * UserInterface/Main.html: Added new files. 27 28 * UserInterface/Views/NavigationSidebarPanel.css: 29 (.sidebar > .panel.navigation > .content): 30 Drive-by fix. The bottom was off by one. This caused misalignment between sidebar and content view when 31 scrolled all the way to the bottom of the content view. 32 33 * UserInterface/Views/NetworkGridContentView.css: Added. 34 (.content-view.network-grid > .data-grid): 35 (.content-view.network-grid > .data-grid th): 36 (.content-view.network-grid > .data-grid td): 37 (.content-view.network-grid > .data-grid table.data): 38 Mostly copied from TimelineView.css and NetworkTimelineView.css. 39 40 * UserInterface/Views/NetworkGridContentView.js: Added. 41 (WebInspector.NetworkGridContentView): 42 (WebInspector.NetworkGridContentView.prototype.get navigationSidebarTreeOutline): 43 (WebInspector.NetworkGridContentView.prototype.get selectionPathComponents): 44 (WebInspector.NetworkGridContentView.prototype.get zeroTime): 45 (WebInspector.NetworkGridContentView.prototype.shown): 46 (WebInspector.NetworkGridContentView.prototype.hidden): 47 (WebInspector.NetworkGridContentView.prototype.closed): 48 (WebInspector.NetworkGridContentView.prototype.updateLayout): 49 (WebInspector.NetworkGridContentView.prototype.needsLayout): 50 (WebInspector.NetworkGridContentView.prototype.reset): 51 (WebInspector.NetworkGridContentView.prototype._processPendingRecords): 52 (WebInspector.NetworkGridContentView.prototype._networkTimelineReset): 53 (WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded): 54 (WebInspector.NetworkGridContentView.prototype._treeElementPathComponentSelected): 55 (WebInspector.NetworkGridContentView.prototype._dataGridNodeSelected): 56 Mostly copied from NetworkTimelineView. 57 58 * UserInterface/Views/NetworkSidebarPanel.css: Added. 59 (.sidebar > .panel.navigation.network > :matches(.content, .empty-content-placeholder)): 60 (.sidebar > .panel.navigation.network > .navigation-bar): 61 (.sidebar > .panel.navigation.network > .title-bar): 62 (.sidebar > .panel.navigation.network.network-grid-content-view-showing > .content): 63 (.sidebar > .panel.navigation.network .item:hover:not(.selected) .status .close.status-button): 64 (.sidebar > .panel.navigation.network:not(.network-grid-content-view-showing) .status .go-to-arrow.status-button): 65 (.sidebar > .panel.navigation.network.network-grid-content-view-showing .status .close.status-button): 66 (.sidebar > .panel.navigation.network.network-grid-content-view-showing .navigation-sidebar-panel-content-tree-outline.network-grid .item .subtitle): 67 (.sidebar > .panel.navigation.network > .content > .navigation-sidebar-panel-content-tree-outline): 68 (.sidebar > .panel.navigation.network.network-grid-content-view-showing > .content > .navigation-sidebar-panel-content-tree-outline): 69 Mostly copied from TimelineSidebarPanel.css and NetworkTimelineView.css. 70 71 * UserInterface/Views/NetworkSidebarPanel.js: Added. 72 (WebInspector.NetworkSidebarPanel): 73 (WebInspector.NetworkSidebarPanel.prototype.closed): 74 (WebInspector.NetworkSidebarPanel.prototype.showDefaultContentView): 75 (WebInspector.NetworkSidebarPanel.prototype.saveStateToCookie): 76 (WebInspector.NetworkSidebarPanel.prototype.restoreStateFromCookie): 77 (WebInspector.NetworkSidebarPanel.prototype.hasCustomFilters): 78 (WebInspector.NetworkSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match): 79 (WebInspector.NetworkSidebarPanel.prototype.matchTreeElementAgainstCustomFilters): 80 (WebInspector.NetworkSidebarPanel.prototype.treeElementAddedOrChanged): 81 (WebInspector.NetworkSidebarPanel.prototype._networkTimelineReset): 82 (WebInspector.NetworkSidebarPanel.prototype._contentBrowserCurrentContentViewDidChange): 83 (WebInspector.NetworkSidebarPanel.prototype._treeElementGoToArrowWasClicked): 84 (WebInspector.NetworkSidebarPanel.prototype._treeElementCloseButtonClicked): 85 (WebInspector.NetworkSidebarPanel.prototype._canShowDifferentContentView): 86 (WebInspector.NetworkSidebarPanel.prototype._treeElementSelected): 87 (WebInspector.NetworkSidebarPanel.prototype._scopeBarSelectionDidChange): 88 A hybrid of ResourceSidebarPanel and TimelineSidebarPanel. 89 90 * UserInterface/Views/NetworkTabContentView.js: Added. 91 (WebInspector.NetworkTabContentView): 92 (WebInspector.NetworkTabContentView.prototype.get type): 93 (WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject): 94 95 * UserInterface/Views/NewTabContentView.js: 96 (WebInspector.NewTabContentView): Add Network tab and sort the tabs by their localized name. 97 98 * UserInterface/Views/TabBar.js: 99 (WebInspector.TabBar.prototype._handleNewTabClick): 100 Drive-by fix. Don't fire the click event if the new tab button is disabled. 101 1 102 2015-07-06 Nikita Vasilyev <nvasilyev@apple.com> 2 103 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r186133 r186368 321 321 localizedStrings["Mixed"] = "Mixed"; 322 322 localizedStrings["Name"] = "Name"; 323 localizedStrings["Network"] = "Network"; 323 324 localizedStrings["Network Issue"] = "Network Issue"; 324 325 localizedStrings["Network Requests"] = "Network Requests"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r185968 r186368 147 147 this._splitConsoleHeightSetting = new WebInspector.Setting("split-console-height", 150); 148 148 149 this._openTabsSetting = new WebInspector.Setting("open-tab s", ["elements", "resources", "timeline", "debugger", "storage", "console"]);149 this._openTabsSetting = new WebInspector.Setting("open-tab-types", ["elements", "network", "resources", "timeline", "debugger", "storage", "console"]); 150 150 this._selectedTabIndexSetting = new WebInspector.Setting("selected-tab-index", 0); 151 151 … … 384 384 case WebInspector.ElementsTabContentView.Type: 385 385 return !!window.DOMAgent; 386 case WebInspector.NetworkTabContentView.Type: 387 return !!window.NetworkAgent && !!window.PageAgent; 386 388 case WebInspector.StorageTabContentView.Type: 387 389 return !!window.DOMStorageAgent || !!window.DatabaseAgent || !!window.IndexedDBAgent; … … 402 404 case WebInspector.ElementsTabContentView.Type: 403 405 return new WebInspector.ElementsTabContentView; 406 case WebInspector.NetworkTabContentView.Type: 407 return new WebInspector.NetworkTabContentView; 404 408 case WebInspector.NewTabContentView.Type: 405 409 return new WebInspector.NewTabContentView; … … 440 444 var newTabAllowed = this.isNewTabWithTypeAllowed(WebInspector.ConsoleTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.ElementsTabContentView.Type) 441 445 || this.isNewTabWithTypeAllowed(WebInspector.ResourcesTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.StorageTabContentView.Type) 442 || this.isNewTabWithTypeAllowed(WebInspector.TimelineTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.DebuggerTabContentView.Type); 446 || this.isNewTabWithTypeAllowed(WebInspector.TimelineTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.DebuggerTabContentView.Type) 447 || this.isNewTabWithTypeAllowed(WebInspector.NetworkTabContentView.Type); 443 448 this.tabBar.newTabItem.disabled = !newTabAllowed; 444 449 }; -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r186133 r186368 34 34 WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this); 35 35 36 this._persistentNetworkTimeline = new WebInspector.NetworkTimeline; 37 36 38 this._isCapturing = false; 37 39 this._isCapturingPageReload = false; … … 61 63 console.assert(this._activeRecording || !this._isCapturing); 62 64 return this._activeRecording; 65 } 66 67 get persistentNetworkTimeline() 68 { 69 return this._persistentNetworkTimeline; 63 70 } 64 71 … … 550 557 _mainResourceDidChange(event) 551 558 { 559 if (event.target.isMainFrame()) 560 this._persistentNetworkTimeline.reset(); 561 562 var mainResource = event.target.mainResource; 563 var record = new WebInspector.ResourceTimelineRecord(mainResource); 564 if (!isNaN(record.startTime)) 565 this._persistentNetworkTimeline.addRecord(record); 566 552 567 // Ignore resource events when there isn't a main frame yet. Those events are triggered by 553 568 // loading the cached resources when the inspector opens, and they do not have timing information. … … 561 576 return; 562 577 563 var mainResource = event.target.mainResource;564 578 if (mainResource === this._autoCapturingMainResource) 565 579 return; 566 580 567 this._addRecord( new WebInspector.ResourceTimelineRecord(mainResource));581 this._addRecord(record); 568 582 } 569 583 570 584 _resourceWasAdded(event) 571 585 { 586 var record = new WebInspector.ResourceTimelineRecord(event.data.resource); 587 if (!isNaN(record.startTime)) 588 this._persistentNetworkTimeline.addRecord(record); 589 572 590 // Ignore resource events when there isn't a main frame yet. Those events are triggered by 573 591 // loading the cached resources when the inspector opens, and they do not have timing information. … … 578 596 return; 579 597 580 this._addRecord( new WebInspector.ResourceTimelineRecord(event.data.resource));598 this._addRecord(record); 581 599 } 582 600 }; -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r186217 r186368 101 101 <link rel="stylesheet" href="Views/NavigationBar.css"> 102 102 <link rel="stylesheet" href="Views/NavigationSidebarPanel.css"> 103 <link rel="stylesheet" href="Views/NetworkGridContentView.css"> 104 <link rel="stylesheet" href="Views/NetworkSidebarPanel.css"> 103 105 <link rel="stylesheet" href="Views/NetworkTimelineOverviewGraph.css"> 104 106 <link rel="stylesheet" href="Views/NetworkTimelineView.css"> … … 344 346 <script src="Views/FolderTreeElement.js"></script> 345 347 <script src="Views/FolderizedTreeElement.js"></script> 348 <script src="Views/NetworkTabContentView.js"></script> 346 349 <script src="Views/NewTabContentView.js"></script> 347 350 <script src="Views/ObjectTreeBaseTreeElement.js"></script> … … 461 464 <script src="Views/MultipleScopeBarItem.js"></script> 462 465 <script src="Views/NavigationBar.js"></script> 466 <script src="Views/NetworkGridContentView.js"></script> 467 <script src="Views/NetworkSidebarPanel.js"></script> 463 468 <script src="Views/NetworkTimelineOverviewGraph.js"></script> 464 469 <script src="Views/NetworkTimelineView.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Models/Timeline.js
r186119 r186368 107 107 this._endTime = NaN; 108 108 109 if (!suppressEvents) 109 if (!suppressEvents) { 110 110 this.dispatchEventToListeners(WebInspector.Timeline.Event.TimesUpdated); 111 this.dispatchEventToListeners(WebInspector.Timeline.Event.Reset); 112 } 111 113 } 112 114 … … 155 157 156 158 WebInspector.Timeline.Event = { 159 Reset: "timeline-reset", 157 160 RecordAdded: "timeline-record-added", 158 161 TimesUpdated: "timeline-times-updated" -
trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.css
r186302 r186368 25 25 26 26 .sidebar > .panel.navigation > .content { 27 bottom: 2 8px;27 bottom: 29px; 28 28 } 29 29 -
trunk/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js
r184971 r186368 31 31 32 32 var allowedNewTabs = [ 33 {image: "Images/Console.svg", title: WebInspector.UIString("Console"), type: WebInspector.ConsoleTabContentView.Type}, 34 {image: "Images/Debugger.svg", title: WebInspector.UIString("Debugger"), type: WebInspector.DebuggerTabContentView.Type}, 33 35 {image: "Images/Elements.svg", title: WebInspector.UIString("Elements"), type: WebInspector.ElementsTabContentView.Type}, 36 {image: "Images/Network.svg", title: WebInspector.UIString("Network"), type: WebInspector.NetworkTabContentView.Type}, 34 37 {image: "Images/Resources.svg", title: WebInspector.UIString("Resources"), type: WebInspector.ResourcesTabContentView.Type}, 35 {image: "Images/Timeline.svg", title: WebInspector.UIString("Timelines"), type: WebInspector.TimelineTabContentView.Type},36 {image: "Images/Debugger.svg", title: WebInspector.UIString("Debugger"), type: WebInspector.DebuggerTabContentView.Type},37 38 {image: "Images/Storage.svg", title: WebInspector.UIString("Storage"), type: WebInspector.StorageTabContentView.Type}, 38 {image: "Images/ Console.svg", title: WebInspector.UIString("Console"), type: WebInspector.ConsoleTabContentView.Type}39 {image: "Images/Timeline.svg", title: WebInspector.UIString("Timelines"), type: WebInspector.TimelineTabContentView.Type} 39 40 ]; 41 42 allowedNewTabs.sort(function(a, b) { return a.title.localeCompare(b.title); }); 40 43 41 44 for (var info of allowedNewTabs) { -
trunk/Source/WebInspectorUI/UserInterface/Views/TabBar.js
r185236 r186368 732 732 } 733 733 734 _handleNewTabClick(event) { 734 _handleNewTabClick(event) 735 { 736 if (this._newTabItem.disabled) 737 return; 735 738 this.dispatchEventToListeners(WebInspector.TabBar.Event.NewTabItemClicked); 736 739 }
Note:
See TracChangeset
for help on using the changeset viewer.