Changeset 147109 in webkit
- Timestamp:
- Mar 28, 2013 6:46:13 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r147107 r147109 1 2013-03-28 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: name timeline overview controls consistently 4 https://bugs.webkit.org/show_bug.cgi?id=113503 5 6 Reviewed by Yury Semikhatsky. 7 8 Refactoring, covered by existing tests. 9 10 - rename HeapGraph to TimelineMemoryOverview; 11 - rename TimelineCategoryStrips to TimelineEventOvrview. 12 13 * inspector/front-end/TimelineOverviewPane.js: 14 (WebInspector.TimelineOverviewPane): 15 (WebInspector.TimelineOverviewPane.prototype.setMode): 16 (WebInspector.TimelineOverviewPane.prototype._setFrameMode): 17 (WebInspector.TimelineOverviewPane.prototype._onCategoryVisibilityChanged): 18 (WebInspector.TimelineOverviewPane.prototype._update): 19 (WebInspector.TimelineOverviewPane.prototype.setMinimumRecordDuration): 20 (WebInspector.TimelineMemoryOverview): 21 (WebInspector.TimelineEventOverview): 22 (WebInspector.TimelineEventOverview.prototype._renderBar): 23 1 24 2013-03-28 Eli Fidler <efidler@blackberry.com> 2 25 -
trunk/Source/WebCore/inspector/front-end/TimelineOverviewPane.js
r146970 r147109 78 78 this.element.appendChild(this._overviewGrid.element); 79 79 80 this._ heapGraph = new WebInspector.HeapGraph(this._model);81 this._ heapGraph.element.id = "timeline-overview-memory";82 this._overviewGrid.insertBeforeItemsGraphsElement(this._ heapGraph.element);80 this._memoryOverview = new WebInspector.TimelineMemoryOverview(this._model); 81 this._memoryOverview.element.id = "timeline-overview-memory"; 82 this._overviewGrid.insertBeforeItemsGraphsElement(this._memoryOverview.element); 83 83 84 84 var separatorElement = document.createElement("div"); … … 86 86 this.element.appendChild(separatorElement); 87 87 88 this._ categoryStrips = new WebInspector.TimelineCategoryStrips(this._model);89 this._overviewGrid.itemsGraphsElement().appendChild(this._ categoryStrips.element);88 this._eventOverview = new WebInspector.TimelineEventOverview(this._model); 89 this._overviewGrid.itemsGraphsElement().appendChild(this._eventOverview.element); 90 90 91 91 var categories = WebInspector.TimelinePresentationModel.categories(); … … 132 132 case WebInspector.TimelineOverviewPane.Mode.Events: 133 133 case WebInspector.TimelineOverviewPane.Mode.Frames: 134 this._ heapGraph.hide();134 this._memoryOverview.hide(); 135 135 this._overviewGrid.showItemsGraphsElement(); 136 136 break; 137 137 case WebInspector.TimelineOverviewPane.Mode.Memory: 138 138 this._overviewGrid.hideItemsGraphsElement(); 139 this._ heapGraph.show();139 this._memoryOverview.show(); 140 140 } 141 141 this._overviewItems[this._currentMode].revealAndSelect(false); … … 155 155 this._frameOverview = null; 156 156 this._overviewGrid.showItemsGraphsElement(); 157 this._ categoryStrips.update();157 this._eventOverview.update(); 158 158 } 159 159 }, … … 162 162 { 163 163 if (this._currentMode === WebInspector.TimelineOverviewPane.Mode.Events) 164 this._ categoryStrips.update();164 this._eventOverview.update(); 165 165 }, 166 166 … … 173 173 this._overviewCalculator.setDisplayWindow(0, this._overviewGrid.clientWidth()); 174 174 175 if (this._ heapGraph.visible)176 this._ heapGraph.update();175 if (this._memoryOverview.visible) 176 this._memoryOverview.update(); 177 177 else if (this._frameOverview) 178 178 this._frameOverview.update(); 179 179 else 180 this._ categoryStrips.update();180 this._eventOverview.update(); 181 181 182 182 this._overviewGrid.updateDividers(this._overviewCalculator); … … 323 323 setMinimumRecordDuration: function(value) 324 324 { 325 this._ categoryStrips.setMinimumRecordDuration(value);325 this._eventOverview.setMinimumRecordDuration(value); 326 326 }, 327 327 … … 417 417 * @param {WebInspector.TimelineModel} model 418 418 */ 419 WebInspector. HeapGraph= function(model)419 WebInspector.TimelineMemoryOverview = function(model) 420 420 { 421 421 this._canvas = document.createElement("canvas"); … … 436 436 } 437 437 438 WebInspector. HeapGraph.prototype = {438 WebInspector.TimelineMemoryOverview.prototype = { 439 439 /** 440 440 * @return {Node} … … 546 546 * @param {WebInspector.TimelineModel} model 547 547 */ 548 WebInspector.Timeline CategoryStrips= function(model)548 WebInspector.TimelineEventOverview = function(model) 549 549 { 550 550 this._model = model; … … 556 556 var categories = WebInspector.TimelinePresentationModel.categories(); 557 557 for (var category in categories) 558 this._fillStyles[category] = WebInspector.TimelinePresentationModel.createFillStyleForCategory(this._context, 0, WebInspector.Timeline CategoryStrips._innerStripHeight, categories[category]);559 560 this._disabledCategoryFillStyle = WebInspector.TimelinePresentationModel.createFillStyle(this._context, 0, WebInspector.Timeline CategoryStrips._innerStripHeight,558 this._fillStyles[category] = WebInspector.TimelinePresentationModel.createFillStyleForCategory(this._context, 0, WebInspector.TimelineEventOverview._innerStripHeight, categories[category]); 559 560 this._disabledCategoryFillStyle = WebInspector.TimelinePresentationModel.createFillStyle(this._context, 0, WebInspector.TimelineEventOverview._innerStripHeight, 561 561 "rgb(218, 218, 218)", "rgb(170, 170, 170)", "rgb(143, 143, 143)"); 562 562 … … 565 565 566 566 /** @const */ 567 WebInspector.Timeline CategoryStrips._canvasHeight = 60;567 WebInspector.TimelineEventOverview._canvasHeight = 60; 568 568 /** @const */ 569 WebInspector.Timeline CategoryStrips._numberOfStrips = 3;569 WebInspector.TimelineEventOverview._numberOfStrips = 3; 570 570 /** @const */ 571 WebInspector.Timeline CategoryStrips._stripHeight = Math.round(WebInspector.TimelineCategoryStrips._canvasHeight / WebInspector.TimelineCategoryStrips._numberOfStrips);571 WebInspector.TimelineEventOverview._stripHeight = Math.round(WebInspector.TimelineEventOverview._canvasHeight / WebInspector.TimelineEventOverview._numberOfStrips); 572 572 /** @const */ 573 WebInspector.Timeline CategoryStrips._stripPadding = 4;573 WebInspector.TimelineEventOverview._stripPadding = 4; 574 574 /** @const */ 575 WebInspector.Timeline CategoryStrips._innerStripHeight = WebInspector.TimelineCategoryStrips._stripHeight - 2 * WebInspector.TimelineCategoryStrips._stripPadding;576 577 WebInspector.Timeline CategoryStrips.prototype = {575 WebInspector.TimelineEventOverview._innerStripHeight = WebInspector.TimelineEventOverview._stripHeight - 2 * WebInspector.TimelineEventOverview._stripPadding; 576 577 WebInspector.TimelineEventOverview.prototype = { 578 578 update: function() 579 579 { 580 580 // Use real world, 1:1 coordinates in canvas. This will also take care of clearing it. 581 581 this.element.width = this.element.parentElement.clientWidth; 582 this.element.height = WebInspector.Timeline CategoryStrips._canvasHeight;582 this.element.height = WebInspector.TimelineEventOverview._canvasHeight; 583 583 584 584 var timeOffset = this._model.minimumRecordTime(); … … 589 589 590 590 this._context.fillStyle = "rgba(0, 0, 0, 0.05)"; 591 for (var i = 1; i < WebInspector.Timeline CategoryStrips._numberOfStrips; i += 2)592 this._context.fillRect(0.5, i * WebInspector.Timeline CategoryStrips._stripHeight + 0.5, this.element.width, WebInspector.TimelineCategoryStrips._stripHeight);591 for (var i = 1; i < WebInspector.TimelineEventOverview._numberOfStrips; i += 2) 592 this._context.fillRect(0.5, i * WebInspector.TimelineEventOverview._stripHeight + 0.5, this.element.width, WebInspector.TimelineEventOverview._stripHeight); 593 593 594 594 function appendRecord(record) … … 634 634 { 635 635 var x = begin + 0.5; 636 var y = category.overviewStripGroupIndex * WebInspector.Timeline CategoryStrips._stripHeight + WebInspector.TimelineCategoryStrips._stripPadding + 0.5;636 var y = category.overviewStripGroupIndex * WebInspector.TimelineEventOverview._stripHeight + WebInspector.TimelineEventOverview._stripPadding + 0.5; 637 637 var width = Math.max(end - begin, 1); 638 638 … … 640 640 this._context.translate(x, y); 641 641 this._context.fillStyle = category.hidden ? this._disabledCategoryFillStyle : this._fillStyles[category.name]; 642 this._context.fillRect(0, 0, width, WebInspector.Timeline CategoryStrips._innerStripHeight);642 this._context.fillRect(0, 0, width, WebInspector.TimelineEventOverview._innerStripHeight); 643 643 this._context.strokeStyle = category.hidden ? this._disabledCategoryBorderStyle : category.borderColor; 644 this._context.strokeRect(0, 0, width, WebInspector.Timeline CategoryStrips._innerStripHeight);644 this._context.strokeRect(0, 0, width, WebInspector.TimelineEventOverview._innerStripHeight); 645 645 this._context.restore(); 646 646 }
Note: See TracChangeset
for help on using the changeset viewer.