Changeset 142626 in webkit
- Timestamp:
- Feb 12, 2013 7:56:28 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142621 r142626 1 2013-02-12 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: add initial implementation of native memory graph to Timeline 4 https://bugs.webkit.org/show_bug.cgi?id=109578 5 6 Reviewed by Alexander Pavlov. 7 8 This change adds inital implementation of native memory graph UI. The graph 9 will be shown in the same place as DOM counters graph on the Timeline panel. 10 11 Added NativeMemoryGraph.js that reuses parts of DOM counters graph 12 implementation. MemoryStatistics.js was refactor to allow sharing 13 more code between DOM counters and native memory graph. 14 15 * WebCore.gypi: 16 * WebCore.vcproj/WebCore.vcproj: 17 * inspector/compile-front-end.py: 18 * inspector/front-end/MemoryStatistics.js: 19 (WebInspector.MemoryStatistics): 20 (WebInspector.MemoryStatistics.prototype._createCurrentValuesBar): 21 (WebInspector.MemoryStatistics.prototype._createCounterUIList): 22 (WebInspector.MemoryStatistics.prototype._createCounterUIList.getNodeCount): 23 (WebInspector.MemoryStatistics.prototype._createCounterUIList.getListenerCount): 24 (WebInspector.MemoryStatistics.prototype._canvasHeight): 25 (WebInspector.MemoryStatistics.prototype._updateSize): 26 (WebInspector.MemoryStatistics.prototype._highlightCurrentPositionOnGraphs): 27 (WebInspector.MemoryStatistics.prototype._drawMarker): 28 * inspector/front-end/NativeMemoryGraph.js: Added. 29 (WebInspector.NativeMemoryGraph): 30 (WebInspector.NativeMemoryCounterUI): 31 (WebInspector.NativeMemoryCounterUI.prototype._hslToString): 32 (WebInspector.NativeMemoryCounterUI.prototype.updateCurrentValue): 33 (WebInspector.NativeMemoryCounterUI.prototype.clearCurrentValueAndMarker): 34 (WebInspector.NativeMemoryGraph.prototype._createCurrentValuesBar): 35 (WebInspector.NativeMemoryGraph.prototype._createCounterUIList.getCounterValue): 36 (WebInspector.NativeMemoryGraph.prototype._createCounterUIList): 37 (WebInspector.NativeMemoryGraph.prototype._canvasHeight): 38 (WebInspector.NativeMemoryGraph.prototype._onRecordAdded.addStatistics): 39 (WebInspector.NativeMemoryGraph.prototype._onRecordAdded): 40 (WebInspector.NativeMemoryGraph.prototype._draw): 41 (WebInspector.NativeMemoryGraph.prototype._clearCurrentValueAndMarker): 42 (WebInspector.NativeMemoryGraph.prototype._updateCurrentValue): 43 (WebInspector.NativeMemoryGraph.prototype._restoreImageUnderMarker): 44 (WebInspector.NativeMemoryGraph.prototype._saveImageUnderMarker): 45 (WebInspector.NativeMemoryGraph.prototype._drawMarker): 46 (WebInspector.NativeMemoryGraph.prototype._maxCounterValue): 47 (WebInspector.NativeMemoryGraph.prototype._resetTotalValues): 48 (WebInspector.NativeMemoryGraph.prototype.valueGetter): 49 (WebInspector.NativeMemoryGraph.prototype._drawGraph): 50 (WebInspector.NativeMemoryGraph.prototype._discardImageUnderMarker): 51 * inspector/front-end/TimelinePanel.js: 52 * inspector/front-end/WebKit.qrc: 53 * inspector/front-end/timelinePanel.css: 54 (#memory-graphs-canvas-container.dom-counters .resources-dividers): 55 (.memory-category-value): 56 1 57 2013-02-12 Andrey Lushnikov <lushnikov@chromium.org> 2 58 -
trunk/Source/WebCore/WebCore.gypi
r142610 r142626 5393 5393 'webinspector_timeline_js_files': [ 5394 5394 'inspector/front-end/MemoryStatistics.js', 5395 'inspector/front-end/NativeMemoryGraph.js', 5395 5396 'inspector/front-end/TimelineFrameController.js', 5396 5397 'inspector/front-end/TimelineModel.js', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r142610 r142626 77331 77331 </File> 77332 77332 <File 77333 RelativePath="..\inspector\front-end\MemoryStatistics.js" 77334 > 77335 </File> 77336 <File 77333 77337 RelativePath="..\inspector\front-end\MetricsSidebarPane.js" 77334 77338 > … … 77340 77344 <File 77341 77345 RelativePath="..\inspector\front-end\NativeHeapSnapshot.js" 77346 > 77347 </File> 77348 <File 77349 RelativePath="..\inspector\front-end\NativeMemoryGraph.js" 77342 77350 > 77343 77351 </File> -
trunk/Source/WebCore/inspector/compile-front-end.py
r142610 r142626 279 279 "sources": [ 280 280 "MemoryStatistics.js", 281 "NativeMemoryGraph.js", 281 282 "TimelineModel.js", 282 283 "TimelineOverviewPane.js", -
trunk/Source/WebCore/inspector/front-end/MemoryStatistics.js
r142278 r142626 52 52 this._canvasContainer = this._memorySidebarView.mainElement; 53 53 this._canvasContainer.id = "memory-graphs-canvas-container"; 54 this._currentValuesBar = this._canvasContainer.createChild("div"); 55 this._currentValuesBar.id = "counter-values-bar"; 54 this._createCurrentValuesBar(); 56 55 this._canvas = this._canvasContainer.createChild("canvas"); 57 56 this._canvas.id = "memory-counters-graph"; … … 68 67 // Populate sidebar 69 68 this._memorySidebarView.sidebarElement.createChild("div", "sidebar-tree sidebar-tree-section").textContent = WebInspector.UIString("COUNTERS"); 70 function getDocumentCount(entry) 71 { 72 return entry.documentCount; 73 } 74 function getNodeCount(entry) 75 { 76 return entry.nodeCount; 77 } 78 function getListenerCount(entry) 79 { 80 return entry.listenerCount; 81 } 82 this._counterUI = [ 83 new WebInspector.DOMCounterUI(this, "Document Count", "Documents: %d", [100,0,0], getDocumentCount), 84 new WebInspector.DOMCounterUI(this, "DOM Node Count", "Nodes: %d", [0,100,0], getNodeCount), 85 new WebInspector.DOMCounterUI(this, "Event Listener Count", "Listeners: %d", [0,0,100], getListenerCount) 86 ]; 69 this._counterUI = this._createCounterUIList(); 87 70 88 71 TimelineAgent.setIncludeMemoryDetails(true); … … 241 224 242 225 WebInspector.MemoryStatistics.prototype = { 226 _createCurrentValuesBar: function() 227 { 228 this._currentValuesBar = this._canvasContainer.createChild("div"); 229 this._currentValuesBar.id = "counter-values-bar"; 230 this._canvasContainer.addStyleClass("dom-counters"); 231 }, 232 233 _createCounterUIList: function() 234 { 235 function getDocumentCount(entry) 236 { 237 return entry.documentCount; 238 } 239 function getNodeCount(entry) 240 { 241 return entry.nodeCount; 242 } 243 function getListenerCount(entry) 244 { 245 return entry.listenerCount; 246 } 247 return [ 248 new WebInspector.DOMCounterUI(this, "Document Count", "Documents: %d", [100,0,0], getDocumentCount), 249 new WebInspector.DOMCounterUI(this, "DOM Node Count", "Nodes: %d", [0,100,0], getNodeCount), 250 new WebInspector.DOMCounterUI(this, "Event Listener Count", "Listeners: %d", [0,0,100], getListenerCount) 251 ]; 252 }, 253 243 254 _onRecordsCleared: function() 244 255 { … … 275 286 }, 276 287 288 _canvasHeight: function() 289 { 290 return this._canvasContainer.offsetHeight - this._currentValuesBar.offsetHeight; 291 }, 292 277 293 _updateSize: function() 278 294 { … … 280 296 this._canvasContainer.style.width = width + "px"; 281 297 282 var height = this._canvas Container.offsetHeight - this._currentValuesBar.offsetHeight;298 var height = this._canvasHeight(); 283 299 this._canvas.width = width; 284 300 this._canvas.height = height; … … 412 428 var ctx = this._canvas.getContext("2d"); 413 429 this._restoreImageUnderMarker(ctx); 414 this._saveImageUnderMarker(ctx, x, index);415 430 this._drawMarker(ctx, x, index); 416 431 }, … … 440 455 _drawMarker: function(ctx, x, index) 441 456 { 457 this._saveImageUnderMarker(ctx, x, index); 442 458 const radius = 2; 443 459 for (var i = 0; i < this._counterUI.length; i++) { -
trunk/Source/WebCore/inspector/front-end/TimelinePanel.js
r142460 r142626 31 31 32 32 importScript("MemoryStatistics.js"); 33 importScript("NativeMemoryGraph.js"); 33 34 importScript("TimelineModel.js"); 34 35 importScript("TimelineOverviewPane.js"); -
trunk/Source/WebCore/inspector/front-end/WebKit.qrc
r142610 r142626 115 115 <file>NativeBreakpointsSidebarPane.js</file> 116 116 <file>NativeHeapSnapshot.js</file> 117 <file>NativeMemoryGraph.js</file> 117 118 <file>NativeMemorySnapshotView.js</file> 118 119 <file>NavigatorOverlayController.js</file> -
trunk/Source/WebCore/inspector/front-end/timelinePanel.css
r138244 r142626 544 544 } 545 545 546 #memory-graphs-canvas-container .resources-dividers {546 #memory-graphs-canvas-container.dom-counters .resources-dividers { 547 547 top: 15px; 548 548 } … … 685 685 padding: 0; 686 686 } 687 688 .memory-category-value { 689 float: right; 690 }
Note: See TracChangeset
for help on using the changeset viewer.