| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 /** | 30 /** |
| 31 * @implements {WebInspector.TimelineModeView} | 31 * @implements {Timeline.TimelineModeView} |
| 32 * @unrestricted | 32 * @unrestricted |
| 33 */ | 33 */ |
| 34 WebInspector.CountersGraph = class extends WebInspector.VBox { | 34 Timeline.CountersGraph = class extends UI.VBox { |
| 35 /** | 35 /** |
| 36 * @param {!WebInspector.TimelineModeViewDelegate} delegate | 36 * @param {!Timeline.TimelineModeViewDelegate} delegate |
| 37 * @param {!WebInspector.TimelineModel} model | 37 * @param {!TimelineModel.TimelineModel} model |
| 38 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters | 38 * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters |
| 39 */ | 39 */ |
| 40 constructor(delegate, model, filters) { | 40 constructor(delegate, model, filters) { |
| 41 super(); | 41 super(); |
| 42 | 42 |
| 43 this.element.id = 'memory-graphs-container'; | 43 this.element.id = 'memory-graphs-container'; |
| 44 | 44 |
| 45 this._delegate = delegate; | 45 this._delegate = delegate; |
| 46 this._model = model; | 46 this._model = model; |
| 47 this._filters = filters; | 47 this._filters = filters; |
| 48 this._calculator = new WebInspector.CounterGraphCalculator(this._model); | 48 this._calculator = new Timeline.CounterGraphCalculator(this._model); |
| 49 | 49 |
| 50 // Create selectors | 50 // Create selectors |
| 51 this._infoWidget = new WebInspector.HBox(); | 51 this._infoWidget = new UI.HBox(); |
| 52 this._infoWidget.element.classList.add('memory-counter-selector-swatches', '
timeline-toolbar-resizer'); | 52 this._infoWidget.element.classList.add('memory-counter-selector-swatches', '
timeline-toolbar-resizer'); |
| 53 this._infoWidget.show(this.element); | 53 this._infoWidget.show(this.element); |
| 54 | 54 |
| 55 this._graphsContainer = new WebInspector.VBox(); | 55 this._graphsContainer = new UI.VBox(); |
| 56 this._graphsContainer.show(this.element); | 56 this._graphsContainer.show(this.element); |
| 57 var canvasWidget = new WebInspector.VBoxWithResizeCallback(this._resize.bind
(this)); | 57 var canvasWidget = new UI.VBoxWithResizeCallback(this._resize.bind(this)); |
| 58 canvasWidget.show(this._graphsContainer.element); | 58 canvasWidget.show(this._graphsContainer.element); |
| 59 this._createCurrentValuesBar(); | 59 this._createCurrentValuesBar(); |
| 60 this._canvasContainer = canvasWidget.element; | 60 this._canvasContainer = canvasWidget.element; |
| 61 this._canvasContainer.id = 'memory-graphs-canvas-container'; | 61 this._canvasContainer.id = 'memory-graphs-canvas-container'; |
| 62 this._canvas = this._canvasContainer.createChild('canvas'); | 62 this._canvas = this._canvasContainer.createChild('canvas'); |
| 63 this._canvas.id = 'memory-counters-graph'; | 63 this._canvas.id = 'memory-counters-graph'; |
| 64 | 64 |
| 65 this._canvasContainer.addEventListener('mouseover', this._onMouseMove.bind(t
his), true); | 65 this._canvasContainer.addEventListener('mouseover', this._onMouseMove.bind(t
his), true); |
| 66 this._canvasContainer.addEventListener('mousemove', this._onMouseMove.bind(t
his), true); | 66 this._canvasContainer.addEventListener('mousemove', this._onMouseMove.bind(t
his), true); |
| 67 this._canvasContainer.addEventListener('mouseleave', this._onMouseLeave.bind
(this), true); | 67 this._canvasContainer.addEventListener('mouseleave', this._onMouseLeave.bind
(this), true); |
| 68 this._canvasContainer.addEventListener('click', this._onClick.bind(this), tr
ue); | 68 this._canvasContainer.addEventListener('click', this._onClick.bind(this), tr
ue); |
| 69 // We create extra timeline grid here to reuse its event dividers. | 69 // We create extra timeline grid here to reuse its event dividers. |
| 70 this._timelineGrid = new WebInspector.TimelineGrid(); | 70 this._timelineGrid = new UI.TimelineGrid(); |
| 71 this._canvasContainer.appendChild(this._timelineGrid.dividersElement); | 71 this._canvasContainer.appendChild(this._timelineGrid.dividersElement); |
| 72 | 72 |
| 73 this._counters = []; | 73 this._counters = []; |
| 74 this._counterUI = []; | 74 this._counterUI = []; |
| 75 } | 75 } |
| 76 | 76 |
| 77 _createCurrentValuesBar() { | 77 _createCurrentValuesBar() { |
| 78 this._currentValuesBar = this._graphsContainer.element.createChild('div'); | 78 this._currentValuesBar = this._graphsContainer.element.createChild('div'); |
| 79 this._currentValuesBar.id = 'counter-values-bar'; | 79 this._currentValuesBar.id = 'counter-values-bar'; |
| 80 } | 80 } |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * @param {string} uiName | 83 * @param {string} uiName |
| 84 * @param {string} uiValueTemplate | 84 * @param {string} uiValueTemplate |
| 85 * @param {string} color | 85 * @param {string} color |
| 86 * @param {function(number):string=} formatter | 86 * @param {function(number):string=} formatter |
| 87 * @return {!WebInspector.CountersGraph.Counter} | 87 * @return {!Timeline.CountersGraph.Counter} |
| 88 */ | 88 */ |
| 89 createCounter(uiName, uiValueTemplate, color, formatter) { | 89 createCounter(uiName, uiValueTemplate, color, formatter) { |
| 90 var counter = new WebInspector.CountersGraph.Counter(); | 90 var counter = new Timeline.CountersGraph.Counter(); |
| 91 this._counters.push(counter); | 91 this._counters.push(counter); |
| 92 this._counterUI.push( | 92 this._counterUI.push( |
| 93 new WebInspector.CountersGraph.CounterUI(this, uiName, uiValueTemplate,
color, counter, formatter)); | 93 new Timeline.CountersGraph.CounterUI(this, uiName, uiValueTemplate, colo
r, counter, formatter)); |
| 94 return counter; | 94 return counter; |
| 95 } | 95 } |
| 96 | 96 |
| 97 /** | 97 /** |
| 98 * @override | 98 * @override |
| 99 * @return {!WebInspector.Widget} | 99 * @return {!UI.Widget} |
| 100 */ | 100 */ |
| 101 view() { | 101 view() { |
| 102 return this; | 102 return this; |
| 103 } | 103 } |
| 104 | 104 |
| 105 /** | 105 /** |
| 106 * @override | 106 * @override |
| 107 */ | 107 */ |
| 108 dispose() { | 108 dispose() { |
| 109 } | 109 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 140 * @override | 140 * @override |
| 141 * @param {number} startTime | 141 * @param {number} startTime |
| 142 * @param {number} endTime | 142 * @param {number} endTime |
| 143 */ | 143 */ |
| 144 setWindowTimes(startTime, endTime) { | 144 setWindowTimes(startTime, endTime) { |
| 145 this._calculator.setWindow(startTime, endTime); | 145 this._calculator.setWindow(startTime, endTime); |
| 146 this.scheduleRefresh(); | 146 this.scheduleRefresh(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 scheduleRefresh() { | 149 scheduleRefresh() { |
| 150 WebInspector.invokeOnceAfterBatchUpdate(this, this.refresh); | 150 UI.invokeOnceAfterBatchUpdate(this, this.refresh); |
| 151 } | 151 } |
| 152 | 152 |
| 153 draw() { | 153 draw() { |
| 154 for (var i = 0; i < this._counters.length; ++i) { | 154 for (var i = 0; i < this._counters.length; ++i) { |
| 155 this._counters[i]._calculateVisibleIndexes(this._calculator); | 155 this._counters[i]._calculateVisibleIndexes(this._calculator); |
| 156 this._counters[i]._calculateXValues(this._canvas.width); | 156 this._counters[i]._calculateXValues(this._canvas.width); |
| 157 } | 157 } |
| 158 this._clear(); | 158 this._clear(); |
| 159 | 159 |
| 160 for (var i = 0; i < this._counterUI.length; i++) | 160 for (var i = 0; i < this._counterUI.length; i++) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 refreshRecords() { | 224 refreshRecords() { |
| 225 } | 225 } |
| 226 | 226 |
| 227 _clear() { | 227 _clear() { |
| 228 var ctx = this._canvas.getContext('2d'); | 228 var ctx = this._canvas.getContext('2d'); |
| 229 ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); | 229 ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); |
| 230 } | 230 } |
| 231 | 231 |
| 232 /** | 232 /** |
| 233 * @override | 233 * @override |
| 234 * @param {?WebInspector.TracingModel.Event} event | 234 * @param {?SDK.TracingModel.Event} event |
| 235 * @param {string=} regex | 235 * @param {string=} regex |
| 236 * @param {boolean=} select | 236 * @param {boolean=} select |
| 237 */ | 237 */ |
| 238 highlightSearchResult(event, regex, select) { | 238 highlightSearchResult(event, regex, select) { |
| 239 } | 239 } |
| 240 | 240 |
| 241 /** | 241 /** |
| 242 * @override | 242 * @override |
| 243 * @param {?WebInspector.TracingModel.Event} event | 243 * @param {?SDK.TracingModel.Event} event |
| 244 */ | 244 */ |
| 245 highlightEvent(event) { | 245 highlightEvent(event) { |
| 246 } | 246 } |
| 247 | 247 |
| 248 /** | 248 /** |
| 249 * @override | 249 * @override |
| 250 * @param {?WebInspector.TimelineSelection} selection | 250 * @param {?Timeline.TimelineSelection} selection |
| 251 */ | 251 */ |
| 252 setSelection(selection) { | 252 setSelection(selection) { |
| 253 } | 253 } |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 /** | 256 /** |
| 257 * @unrestricted | 257 * @unrestricted |
| 258 */ | 258 */ |
| 259 WebInspector.CountersGraph.Counter = class { | 259 Timeline.CountersGraph.Counter = class { |
| 260 constructor() { | 260 constructor() { |
| 261 this.times = []; | 261 this.times = []; |
| 262 this.values = []; | 262 this.values = []; |
| 263 } | 263 } |
| 264 | 264 |
| 265 /** | 265 /** |
| 266 * @param {number} time | 266 * @param {number} time |
| 267 * @param {number} value | 267 * @param {number} value |
| 268 */ | 268 */ |
| 269 appendSample(time, value) { | 269 appendSample(time, value) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 maxValue = maxValue || 1; | 302 maxValue = maxValue || 1; |
| 303 if (this._limitValue) { | 303 if (this._limitValue) { |
| 304 if (maxValue > this._limitValue * 0.5) | 304 if (maxValue > this._limitValue * 0.5) |
| 305 maxValue = Math.max(maxValue, this._limitValue); | 305 maxValue = Math.max(maxValue, this._limitValue); |
| 306 minValue = Math.min(minValue, this._limitValue); | 306 minValue = Math.min(minValue, this._limitValue); |
| 307 } | 307 } |
| 308 return {min: minValue, max: maxValue}; | 308 return {min: minValue, max: maxValue}; |
| 309 } | 309 } |
| 310 | 310 |
| 311 /** | 311 /** |
| 312 * @param {!WebInspector.CounterGraphCalculator} calculator | 312 * @param {!Timeline.CounterGraphCalculator} calculator |
| 313 */ | 313 */ |
| 314 _calculateVisibleIndexes(calculator) { | 314 _calculateVisibleIndexes(calculator) { |
| 315 var start = calculator.minimumBoundary(); | 315 var start = calculator.minimumBoundary(); |
| 316 var end = calculator.maximumBoundary(); | 316 var end = calculator.maximumBoundary(); |
| 317 | 317 |
| 318 // Maximum index of element whose time <= start. | 318 // Maximum index of element whose time <= start. |
| 319 this._minimumIndex = Number.constrain(this.times.upperBound(start) - 1, 0, t
his.times.length - 1); | 319 this._minimumIndex = Number.constrain(this.times.upperBound(start) - 1, 0, t
his.times.length - 1); |
| 320 | 320 |
| 321 // Minimum index of element whose time >= end. | 321 // Minimum index of element whose time >= end. |
| 322 this._maximumIndex = Number.constrain(this.times.lowerBound(end), 0, this.ti
mes.length - 1); | 322 this._maximumIndex = Number.constrain(this.times.lowerBound(end), 0, this.ti
mes.length - 1); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 337 | 337 |
| 338 this.x = new Array(this.values.length); | 338 this.x = new Array(this.values.length); |
| 339 for (var i = this._minimumIndex + 1; i <= this._maximumIndex; i++) | 339 for (var i = this._minimumIndex + 1; i <= this._maximumIndex; i++) |
| 340 this.x[i] = xFactor * (this.times[i] - this._minTime); | 340 this.x[i] = xFactor * (this.times[i] - this._minTime); |
| 341 } | 341 } |
| 342 }; | 342 }; |
| 343 | 343 |
| 344 /** | 344 /** |
| 345 * @unrestricted | 345 * @unrestricted |
| 346 */ | 346 */ |
| 347 WebInspector.CountersGraph.CounterUI = class { | 347 Timeline.CountersGraph.CounterUI = class { |
| 348 /** | 348 /** |
| 349 * @param {!WebInspector.CountersGraph} memoryCountersPane | 349 * @param {!Timeline.CountersGraph} memoryCountersPane |
| 350 * @param {string} title | 350 * @param {string} title |
| 351 * @param {string} currentValueLabel | 351 * @param {string} currentValueLabel |
| 352 * @param {string} graphColor | 352 * @param {string} graphColor |
| 353 * @param {!WebInspector.CountersGraph.Counter} counter | 353 * @param {!Timeline.CountersGraph.Counter} counter |
| 354 * @param {(function(number): string)|undefined} formatter | 354 * @param {(function(number): string)|undefined} formatter |
| 355 */ | 355 */ |
| 356 constructor(memoryCountersPane, title, currentValueLabel, graphColor, counter,
formatter) { | 356 constructor(memoryCountersPane, title, currentValueLabel, graphColor, counter,
formatter) { |
| 357 this._memoryCountersPane = memoryCountersPane; | 357 this._memoryCountersPane = memoryCountersPane; |
| 358 this.counter = counter; | 358 this.counter = counter; |
| 359 this._formatter = formatter || Number.withThousandsSeparator; | 359 this._formatter = formatter || Number.withThousandsSeparator; |
| 360 var container = memoryCountersPane._infoWidget.element.createChild('div', 'm
emory-counter-selector-info'); | 360 var container = memoryCountersPane._infoWidget.element.createChild('div', 'm
emory-counter-selector-info'); |
| 361 | 361 |
| 362 this._setting = WebInspector.settings.createSetting('timelineCountersGraph-'
+ title, true); | 362 this._setting = Common.settings.createSetting('timelineCountersGraph-' + tit
le, true); |
| 363 this._filter = new WebInspector.ToolbarCheckbox(title, title, this._setting)
; | 363 this._filter = new UI.ToolbarCheckbox(title, title, this._setting); |
| 364 this._filter.inputElement.classList.add('-theme-preserve'); | 364 this._filter.inputElement.classList.add('-theme-preserve'); |
| 365 var color = WebInspector.Color.parse(graphColor).setAlpha(0.5).asString(WebI
nspector.Color.Format.RGBA); | 365 var color = Common.Color.parse(graphColor).setAlpha(0.5).asString(Common.Col
or.Format.RGBA); |
| 366 if (color) { | 366 if (color) { |
| 367 this._filter.element.backgroundColor = color; | 367 this._filter.element.backgroundColor = color; |
| 368 this._filter.element.borderColor = 'transparent'; | 368 this._filter.element.borderColor = 'transparent'; |
| 369 } | 369 } |
| 370 this._filter.inputElement.addEventListener('click', this._toggleCounterGraph
.bind(this)); | 370 this._filter.inputElement.addEventListener('click', this._toggleCounterGraph
.bind(this)); |
| 371 container.appendChild(this._filter.element); | 371 container.appendChild(this._filter.element); |
| 372 this._range = this._filter.element.createChild('span', 'range'); | 372 this._range = this._filter.element.createChild('span', 'range'); |
| 373 | 373 |
| 374 this._value = memoryCountersPane._currentValuesBar.createChild('span', 'memo
ry-counter-value'); | 374 this._value = memoryCountersPane._currentValuesBar.createChild('span', 'memo
ry-counter-value'); |
| 375 this._value.style.color = graphColor; | 375 this._value.style.color = graphColor; |
| 376 this.graphColor = graphColor; | 376 this.graphColor = graphColor; |
| 377 this.limitColor = WebInspector.Color.parse(graphColor).setAlpha(0.3).asStrin
g(WebInspector.Color.Format.RGBA); | 377 this.limitColor = Common.Color.parse(graphColor).setAlpha(0.3).asString(Comm
on.Color.Format.RGBA); |
| 378 this.graphYValues = []; | 378 this.graphYValues = []; |
| 379 this._verticalPadding = 10; | 379 this._verticalPadding = 10; |
| 380 | 380 |
| 381 this._currentValueLabel = currentValueLabel; | 381 this._currentValueLabel = currentValueLabel; |
| 382 this._marker = memoryCountersPane._canvasContainer.createChild('div', 'memor
y-counter-marker'); | 382 this._marker = memoryCountersPane._canvasContainer.createChild('div', 'memor
y-counter-marker'); |
| 383 this._marker.style.backgroundColor = graphColor; | 383 this._marker.style.backgroundColor = graphColor; |
| 384 this._clearCurrentValueAndMarker(); | 384 this._clearCurrentValueAndMarker(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 reset() { | 387 reset() { |
| 388 this._range.textContent = ''; | 388 this._range.textContent = ''; |
| 389 } | 389 } |
| 390 | 390 |
| 391 /** | 391 /** |
| 392 * @param {number} minValue | 392 * @param {number} minValue |
| 393 * @param {number} maxValue | 393 * @param {number} maxValue |
| 394 */ | 394 */ |
| 395 setRange(minValue, maxValue) { | 395 setRange(minValue, maxValue) { |
| 396 var min = this._formatter(minValue); | 396 var min = this._formatter(minValue); |
| 397 var max = this._formatter(maxValue); | 397 var max = this._formatter(maxValue); |
| 398 this._range.textContent = WebInspector.UIString('[%s\u2009\u2013\u2009%s]',
min, max); | 398 this._range.textContent = Common.UIString('[%s\u2009\u2013\u2009%s]', min, m
ax); |
| 399 } | 399 } |
| 400 | 400 |
| 401 /** | 401 /** |
| 402 * @param {!WebInspector.Event} event | 402 * @param {!Common.Event} event |
| 403 */ | 403 */ |
| 404 _toggleCounterGraph(event) { | 404 _toggleCounterGraph(event) { |
| 405 this._value.classList.toggle('hidden', !this._filter.checked()); | 405 this._value.classList.toggle('hidden', !this._filter.checked()); |
| 406 this._memoryCountersPane.refresh(); | 406 this._memoryCountersPane.refresh(); |
| 407 } | 407 } |
| 408 | 408 |
| 409 /** | 409 /** |
| 410 * @param {number} x | 410 * @param {number} x |
| 411 * @return {number} | 411 * @return {number} |
| 412 */ | 412 */ |
| 413 _recordIndexAt(x) { | 413 _recordIndexAt(x) { |
| 414 return this.counter.x.upperBound( | 414 return this.counter.x.upperBound( |
| 415 x * window.devicePixelRatio, null, this.counter._minimumIndex + 1
, this.counter._maximumIndex + 1) - | 415 x * window.devicePixelRatio, null, this.counter._minimumIndex + 1
, this.counter._maximumIndex + 1) - |
| 416 1; | 416 1; |
| 417 } | 417 } |
| 418 | 418 |
| 419 /** | 419 /** |
| 420 * @param {number} x | 420 * @param {number} x |
| 421 */ | 421 */ |
| 422 updateCurrentValue(x) { | 422 updateCurrentValue(x) { |
| 423 if (!this.visible() || !this.counter.values.length || !this.counter.x) | 423 if (!this.visible() || !this.counter.values.length || !this.counter.x) |
| 424 return; | 424 return; |
| 425 var index = this._recordIndexAt(x); | 425 var index = this._recordIndexAt(x); |
| 426 var value = Number.withThousandsSeparator(this.counter.values[index]); | 426 var value = Number.withThousandsSeparator(this.counter.values[index]); |
| 427 this._value.textContent = WebInspector.UIString(this._currentValueLabel, val
ue); | 427 this._value.textContent = Common.UIString(this._currentValueLabel, value); |
| 428 var y = this.graphYValues[index] / window.devicePixelRatio; | 428 var y = this.graphYValues[index] / window.devicePixelRatio; |
| 429 this._marker.style.left = x + 'px'; | 429 this._marker.style.left = x + 'px'; |
| 430 this._marker.style.top = y + 'px'; | 430 this._marker.style.top = y + 'px'; |
| 431 this._marker.classList.remove('hidden'); | 431 this._marker.classList.remove('hidden'); |
| 432 } | 432 } |
| 433 | 433 |
| 434 _clearCurrentValueAndMarker() { | 434 _clearCurrentValueAndMarker() { |
| 435 this._value.textContent = ''; | 435 this._value.textContent = ''; |
| 436 this._marker.classList.add('hidden'); | 436 this._marker.classList.add('hidden'); |
| 437 } | 437 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 501 |
| 502 /** | 502 /** |
| 503 * @return {boolean} | 503 * @return {boolean} |
| 504 */ | 504 */ |
| 505 visible() { | 505 visible() { |
| 506 return this._filter.checked(); | 506 return this._filter.checked(); |
| 507 } | 507 } |
| 508 }; | 508 }; |
| 509 | 509 |
| 510 /** | 510 /** |
| 511 * @implements {WebInspector.TimelineGrid.Calculator} | 511 * @implements {UI.TimelineGrid.Calculator} |
| 512 * @unrestricted | 512 * @unrestricted |
| 513 */ | 513 */ |
| 514 WebInspector.CounterGraphCalculator = class { | 514 Timeline.CounterGraphCalculator = class { |
| 515 /** | 515 /** |
| 516 * @param {!WebInspector.TimelineModel} model | 516 * @param {!TimelineModel.TimelineModel} model |
| 517 */ | 517 */ |
| 518 constructor(model) { | 518 constructor(model) { |
| 519 this._model = model; | 519 this._model = model; |
| 520 } | 520 } |
| 521 | 521 |
| 522 /** | 522 /** |
| 523 * @override | 523 * @override |
| 524 * @return {number} | 524 * @return {number} |
| 525 */ | 525 */ |
| 526 paddingLeft() { | 526 paddingLeft() { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 540 this._minimumBoundary = minimumBoundary; | 540 this._minimumBoundary = minimumBoundary; |
| 541 this._maximumBoundary = maximumBoundary; | 541 this._maximumBoundary = maximumBoundary; |
| 542 } | 542 } |
| 543 | 543 |
| 544 /** | 544 /** |
| 545 * @param {number} clientWidth | 545 * @param {number} clientWidth |
| 546 * @param {number=} paddingLeft | 546 * @param {number=} paddingLeft |
| 547 */ | 547 */ |
| 548 setDisplayWindow(clientWidth, paddingLeft) { | 548 setDisplayWindow(clientWidth, paddingLeft) { |
| 549 this._paddingLeft = paddingLeft || 0; | 549 this._paddingLeft = paddingLeft || 0; |
| 550 this._workingArea = clientWidth - WebInspector.CounterGraphCalculator._minWi
dth - this._paddingLeft; | 550 this._workingArea = clientWidth - Timeline.CounterGraphCalculator._minWidth
- this._paddingLeft; |
| 551 } | 551 } |
| 552 | 552 |
| 553 /** | 553 /** |
| 554 * @override | 554 * @override |
| 555 * @param {number} value | 555 * @param {number} value |
| 556 * @param {number=} precision | 556 * @param {number=} precision |
| 557 * @return {string} | 557 * @return {string} |
| 558 */ | 558 */ |
| 559 formatValue(value, precision) { | 559 formatValue(value, precision) { |
| 560 return Number.preciseMillisToString(value - this.zeroTime(), precision); | 560 return Number.preciseMillisToString(value - this.zeroTime(), precision); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 586 | 586 |
| 587 /** | 587 /** |
| 588 * @override | 588 * @override |
| 589 * @return {number} | 589 * @return {number} |
| 590 */ | 590 */ |
| 591 boundarySpan() { | 591 boundarySpan() { |
| 592 return this._maximumBoundary - this._minimumBoundary; | 592 return this._maximumBoundary - this._minimumBoundary; |
| 593 } | 593 } |
| 594 }; | 594 }; |
| 595 | 595 |
| 596 WebInspector.CounterGraphCalculator._minWidth = 5; | 596 Timeline.CounterGraphCalculator._minWidth = 5; |
| OLD | NEW |