| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 14 matching lines...) Expand all Loading... |
| 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 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.TimelineOverviewBase} | 33 * @extends {WebInspector.TimelineOverviewBase} |
| 34 * @param {string} id | 34 * @param {string} id |
| 35 * @param {string} title |
| 35 * @param {!WebInspector.TimelineModel} model | 36 * @param {!WebInspector.TimelineModel} model |
| 36 */ | 37 */ |
| 37 WebInspector.TimelineEventOverview = function(id, model) | 38 WebInspector.TimelineEventOverview = function(id, title, model) |
| 38 { | 39 { |
| 39 WebInspector.TimelineOverviewBase.call(this); | 40 WebInspector.TimelineOverviewBase.call(this); |
| 40 this.element.id = "timeline-overview-" + id; | 41 this.element.id = "timeline-overview-" + id; |
| 41 this.element.classList.add("overview-strip"); | 42 this.element.classList.add("overview-strip"); |
| 43 this.element.createChild("div", "timeline-overview-strip-placeholder").textC
ontent = title; |
| 42 this._model = model; | 44 this._model = model; |
| 43 } | 45 } |
| 44 | 46 |
| 45 WebInspector.TimelineEventOverview.prototype = { | 47 WebInspector.TimelineEventOverview.prototype = { |
| 46 /** | 48 /** |
| 47 * @param {number} y | 49 * @param {number} y |
| 48 * @param {string} label | 50 * @param {string} label |
| 49 */ | 51 */ |
| 50 _drawHorizontalGuide: function(y, label) | 52 _drawHorizontalGuide: function(y, label) |
| 51 { | 53 { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 __proto__: WebInspector.TimelineOverviewBase.prototype | 119 __proto__: WebInspector.TimelineOverviewBase.prototype |
| 118 } | 120 } |
| 119 | 121 |
| 120 /** | 122 /** |
| 121 * @constructor | 123 * @constructor |
| 122 * @extends {WebInspector.TimelineEventOverview} | 124 * @extends {WebInspector.TimelineEventOverview} |
| 123 * @param {!WebInspector.TimelineModel} model | 125 * @param {!WebInspector.TimelineModel} model |
| 124 */ | 126 */ |
| 125 WebInspector.TimelineEventOverview.Input = function(model) | 127 WebInspector.TimelineEventOverview.Input = function(model) |
| 126 { | 128 { |
| 127 WebInspector.TimelineEventOverview.call(this, "input", model); | 129 WebInspector.TimelineEventOverview.call(this, "input", WebInspector.UIString
("Input"), model); |
| 128 } | 130 } |
| 129 | 131 |
| 130 WebInspector.TimelineEventOverview.Input.prototype = { | 132 WebInspector.TimelineEventOverview.Input.prototype = { |
| 131 /** | 133 /** |
| 132 * @override | 134 * @override |
| 133 */ | 135 */ |
| 134 update: function() | 136 update: function() |
| 135 { | 137 { |
| 136 this.resetCanvas(); | 138 this.resetCanvas(); |
| 137 var events = this._model.mainThreadEvents(); | 139 var events = this._model.mainThreadEvents(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 __proto__: WebInspector.TimelineEventOverview.prototype | 173 __proto__: WebInspector.TimelineEventOverview.prototype |
| 172 } | 174 } |
| 173 | 175 |
| 174 /** | 176 /** |
| 175 * @constructor | 177 * @constructor |
| 176 * @extends {WebInspector.TimelineEventOverview} | 178 * @extends {WebInspector.TimelineEventOverview} |
| 177 * @param {!WebInspector.TimelineModel} model | 179 * @param {!WebInspector.TimelineModel} model |
| 178 */ | 180 */ |
| 179 WebInspector.TimelineEventOverview.Network = function(model) | 181 WebInspector.TimelineEventOverview.Network = function(model) |
| 180 { | 182 { |
| 181 WebInspector.TimelineEventOverview.call(this, "network", model); | 183 WebInspector.TimelineEventOverview.call(this, "network", WebInspector.UIStri
ng("Net"), model); |
| 182 } | 184 } |
| 183 | 185 |
| 184 WebInspector.TimelineEventOverview.Network.prototype = { | 186 WebInspector.TimelineEventOverview.Network.prototype = { |
| 185 /** | 187 /** |
| 186 * @override | 188 * @override |
| 187 */ | 189 */ |
| 188 update: function() | 190 update: function() |
| 189 { | 191 { |
| 190 this.resetCanvas(); | 192 this.resetCanvas(); |
| 191 var events = this._model.mainThreadEvents(); | 193 var events = this._model.mainThreadEvents(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 222 WebInspector.TimelineUIUtils.iterateNetworkRequestsInRoundRobin(events,
bandsCount, drawBar.bind(this)); | 224 WebInspector.TimelineUIUtils.iterateNetworkRequestsInRoundRobin(events,
bandsCount, drawBar.bind(this)); |
| 223 }, | 225 }, |
| 224 | 226 |
| 225 __proto__: WebInspector.TimelineEventOverview.prototype | 227 __proto__: WebInspector.TimelineEventOverview.prototype |
| 226 } | 228 } |
| 227 | 229 |
| 228 /** | 230 /** |
| 229 * @constructor | 231 * @constructor |
| 230 * @extends {WebInspector.TimelineEventOverview} | 232 * @extends {WebInspector.TimelineEventOverview} |
| 231 * @param {string} id | 233 * @param {string} id |
| 234 * @param {string} title |
| 232 * @param {!WebInspector.TimelineModel} model | 235 * @param {!WebInspector.TimelineModel} model |
| 233 */ | 236 */ |
| 234 WebInspector.TimelineEventOverview.Thread = function(id, model) | 237 WebInspector.TimelineEventOverview.Thread = function(id, title, model) |
| 235 { | 238 { |
| 236 WebInspector.TimelineEventOverview.call(this, id, model) | 239 WebInspector.TimelineEventOverview.call(this, id, title, model) |
| 237 this._fillStyles = {}; | 240 this._fillStyles = {}; |
| 238 var categories = WebInspector.TimelineUIUtils.categories(); | 241 var categories = WebInspector.TimelineUIUtils.categories(); |
| 239 for (var category in categories) { | 242 for (var category in categories) { |
| 240 this._fillStyles[category] = categories[category].fillColorStop1; | 243 this._fillStyles[category] = categories[category].fillColorStop1; |
| 241 categories[category].addEventListener(WebInspector.TimelineCategory.Even
ts.VisibilityChanged, this._onCategoryVisibilityChanged, this); | 244 categories[category].addEventListener(WebInspector.TimelineCategory.Even
ts.VisibilityChanged, this._onCategoryVisibilityChanged, this); |
| 242 } | 245 } |
| 243 this._disabledCategoryFillStyle = "hsl(0, 0%, 67%)"; | 246 this._disabledCategoryFillStyle = "hsl(0, 0%, 67%)"; |
| 244 } | 247 } |
| 245 | 248 |
| 246 WebInspector.TimelineEventOverview.Thread.prototype = { | 249 WebInspector.TimelineEventOverview.Thread.prototype = { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 272 __proto__: WebInspector.TimelineEventOverview.prototype | 275 __proto__: WebInspector.TimelineEventOverview.prototype |
| 273 } | 276 } |
| 274 | 277 |
| 275 /** | 278 /** |
| 276 * @constructor | 279 * @constructor |
| 277 * @extends {WebInspector.TimelineEventOverview.Thread} | 280 * @extends {WebInspector.TimelineEventOverview.Thread} |
| 278 * @param {!WebInspector.TimelineModel} model | 281 * @param {!WebInspector.TimelineModel} model |
| 279 */ | 282 */ |
| 280 WebInspector.TimelineEventOverview.MainThread = function(model) | 283 WebInspector.TimelineEventOverview.MainThread = function(model) |
| 281 { | 284 { |
| 282 WebInspector.TimelineEventOverview.Thread.call(this, "main-thread", model) | 285 WebInspector.TimelineEventOverview.Thread.call(this, "main-thread", WebInspe
ctor.UIString("CPU"), model) |
| 283 } | 286 } |
| 284 | 287 |
| 285 WebInspector.TimelineEventOverview.MainThread.prototype = { | 288 WebInspector.TimelineEventOverview.MainThread.prototype = { |
| 286 /** | 289 /** |
| 287 * @override | 290 * @override |
| 288 */ | 291 */ |
| 289 update: function() | 292 update: function() |
| 290 { | 293 { |
| 291 this.resetCanvas(); | 294 this.resetCanvas(); |
| 292 var events = this._model.mainThreadEvents(); | 295 var events = this._model.mainThreadEvents(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 __proto__: WebInspector.TimelineEventOverview.Thread.prototype | 359 __proto__: WebInspector.TimelineEventOverview.Thread.prototype |
| 357 } | 360 } |
| 358 | 361 |
| 359 /** | 362 /** |
| 360 * @constructor | 363 * @constructor |
| 361 * @extends {WebInspector.TimelineEventOverview.Thread} | 364 * @extends {WebInspector.TimelineEventOverview.Thread} |
| 362 * @param {!WebInspector.TimelineModel} model | 365 * @param {!WebInspector.TimelineModel} model |
| 363 */ | 366 */ |
| 364 WebInspector.TimelineEventOverview.OtherThreads = function(model) | 367 WebInspector.TimelineEventOverview.OtherThreads = function(model) |
| 365 { | 368 { |
| 366 WebInspector.TimelineEventOverview.Thread.call(this, "other-threads", model)
; | 369 WebInspector.TimelineEventOverview.Thread.call(this, "other-threads", WebIns
pector.UIString("BG"), model); |
| 367 } | 370 } |
| 368 | 371 |
| 369 WebInspector.TimelineEventOverview.OtherThreads.prototype = { | 372 WebInspector.TimelineEventOverview.OtherThreads.prototype = { |
| 370 /** | 373 /** |
| 371 * @override | 374 * @override |
| 372 */ | 375 */ |
| 373 update: function() | 376 update: function() |
| 374 { | 377 { |
| 375 this.resetCanvas(); | 378 this.resetCanvas(); |
| 376 this._model.virtualThreads().forEach(this._drawThread.bind(this)); | 379 this._model.virtualThreads().forEach(this._drawThread.bind(this)); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 } | 431 } |
| 429 | 432 |
| 430 /** | 433 /** |
| 431 * @constructor | 434 * @constructor |
| 432 * @extends {WebInspector.TimelineEventOverview} | 435 * @extends {WebInspector.TimelineEventOverview} |
| 433 * @param {!WebInspector.TimelineModel} model | 436 * @param {!WebInspector.TimelineModel} model |
| 434 * @param {!WebInspector.TimelineFrameModelBase} frameModel | 437 * @param {!WebInspector.TimelineFrameModelBase} frameModel |
| 435 */ | 438 */ |
| 436 WebInspector.TimelineEventOverview.Responsiveness = function(model, frameModel) | 439 WebInspector.TimelineEventOverview.Responsiveness = function(model, frameModel) |
| 437 { | 440 { |
| 438 WebInspector.TimelineEventOverview.call(this, "responsiveness", model) | 441 WebInspector.TimelineEventOverview.call(this, "responsiveness", WebInspector
.UIString("Warn"), model) |
| 439 this._frameModel = frameModel; | 442 this._frameModel = frameModel; |
| 440 } | 443 } |
| 441 | 444 |
| 442 WebInspector.TimelineEventOverview.Responsiveness.prototype = { | 445 WebInspector.TimelineEventOverview.Responsiveness.prototype = { |
| 443 /** | 446 /** |
| 444 * @override | 447 * @override |
| 445 */ | 448 */ |
| 446 update: function() | 449 update: function() |
| 447 { | 450 { |
| 448 this.resetCanvas(); | 451 this.resetCanvas(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 470 } | 473 } |
| 471 | 474 |
| 472 /** | 475 /** |
| 473 * @constructor | 476 * @constructor |
| 474 * @extends {WebInspector.TimelineEventOverview} | 477 * @extends {WebInspector.TimelineEventOverview} |
| 475 * @param {!WebInspector.TimelineModel} model | 478 * @param {!WebInspector.TimelineModel} model |
| 476 * @param {!WebInspector.TimelineFrameModelBase} frameModel | 479 * @param {!WebInspector.TimelineFrameModelBase} frameModel |
| 477 */ | 480 */ |
| 478 WebInspector.TimelineEventOverview.Frames = function(model, frameModel) | 481 WebInspector.TimelineEventOverview.Frames = function(model, frameModel) |
| 479 { | 482 { |
| 480 WebInspector.TimelineEventOverview.call(this, "framerate", model); | 483 WebInspector.TimelineEventOverview.call(this, "framerate", "FPS", model); |
| 481 this._frameModel = frameModel; | 484 this._frameModel = frameModel; |
| 482 } | 485 } |
| 483 | 486 |
| 484 WebInspector.TimelineEventOverview.Frames.prototype = { | 487 WebInspector.TimelineEventOverview.Frames.prototype = { |
| 485 /** | 488 /** |
| 486 * @override | 489 * @override |
| 487 */ | 490 */ |
| 488 update: function() | 491 update: function() |
| 489 { | 492 { |
| 490 this.resetCanvas(); | 493 this.resetCanvas(); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 counters[group] = this._quantDuration; | 653 counters[group] = this._quantDuration; |
| 651 this._callback(counters); | 654 this._callback(counters); |
| 652 interval -= this._quantDuration; | 655 interval -= this._quantDuration; |
| 653 } | 656 } |
| 654 this._counters = []; | 657 this._counters = []; |
| 655 this._counters[group] = interval; | 658 this._counters[group] = interval; |
| 656 this._lastTime = time; | 659 this._lastTime = time; |
| 657 this._remainder = this._quantDuration - interval; | 660 this._remainder = this._quantDuration - interval; |
| 658 } | 661 } |
| 659 } | 662 } |
| OLD | NEW |