| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 this._framePendingCommit = | 332 this._framePendingCommit = |
| 333 new WebInspector.PendingFrame(this._lastTaskBeginTime || event.startTi
me, this._currentTaskTimeByCategory); | 333 new WebInspector.PendingFrame(this._lastTaskBeginTime || event.startTi
me, this._currentTaskTimeByCategory); |
| 334 if (!this._framePendingCommit) { | 334 if (!this._framePendingCommit) { |
| 335 this._addTimeForCategory(this._currentTaskTimeByCategory, event); | 335 this._addTimeForCategory(this._currentTaskTimeByCategory, event); |
| 336 return; | 336 return; |
| 337 } | 337 } |
| 338 this._addTimeForCategory(this._framePendingCommit.timeByCategory, event); | 338 this._addTimeForCategory(this._framePendingCommit.timeByCategory, event); |
| 339 | 339 |
| 340 if (event.name === eventNames.BeginMainThreadFrame && event.args['data'] &&
event.args['data']['frameId']) | 340 if (event.name === eventNames.BeginMainThreadFrame && event.args['data'] &&
event.args['data']['frameId']) |
| 341 this._framePendingCommit.mainFrameId = event.args['data']['frameId']; | 341 this._framePendingCommit.mainFrameId = event.args['data']['frameId']; |
| 342 if (event.name === eventNames.Paint && event.args['data']['layerId'] && even
t.picture && this._target) | 342 if (event.name === eventNames.Paint && event.args['data']['layerId'] && WebI
nspector.TimelineData.forEvent(event).picture && this._target) |
| 343 this._framePendingCommit.paints.push(new WebInspector.LayerPaintEvent(even
t, this._target)); | 343 this._framePendingCommit.paints.push(new WebInspector.LayerPaintEvent(even
t, this._target)); |
| 344 if (event.name === eventNames.CompositeLayers && event.args['layerTreeId'] =
== this._layerTreeId) | 344 if (event.name === eventNames.CompositeLayers && event.args['layerTreeId'] =
== this._layerTreeId) |
| 345 this.handleCompositeLayers(); | 345 this.handleCompositeLayers(); |
| 346 } | 346 } |
| 347 | 347 |
| 348 /** | 348 /** |
| 349 * @param {!Object.<string, number>} timeByCategory | 349 * @param {!Object.<string, number>} timeByCategory |
| 350 * @param {!WebInspector.TracingModel.Event} event | 350 * @param {!WebInspector.TracingModel.Event} event |
| 351 */ | 351 */ |
| 352 _addTimeForCategory(timeByCategory, event) { | 352 _addTimeForCategory(timeByCategory, event) { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 * @return {!WebInspector.TracingModel.Event} | 501 * @return {!WebInspector.TracingModel.Event} |
| 502 */ | 502 */ |
| 503 event() { | 503 event() { |
| 504 return this._event; | 504 return this._event; |
| 505 } | 505 } |
| 506 | 506 |
| 507 /** | 507 /** |
| 508 * @return {!Promise<?{rect: !Array<number>, serializedPicture: string}>} | 508 * @return {!Promise<?{rect: !Array<number>, serializedPicture: string}>} |
| 509 */ | 509 */ |
| 510 picturePromise() { | 510 picturePromise() { |
| 511 return this._event.picture.objectPromise().then(result => { | 511 var picture = WebInspector.TimelineData.forEvent(this._event).picture; |
| 512 return picture.objectPromise().then(result => { |
| 512 if (!result) | 513 if (!result) |
| 513 return null; | 514 return null; |
| 514 var rect = result['params'] && result['params']['layer_rect']; | 515 var rect = result['params'] && result['params']['layer_rect']; |
| 515 var picture = result['skp64']; | 516 var picture = result['skp64']; |
| 516 return rect && picture ? {rect: rect, serializedPicture: picture} : null; | 517 return rect && picture ? {rect: rect, serializedPicture: picture} : null; |
| 517 }); | 518 }); |
| 518 } | 519 } |
| 519 | 520 |
| 520 /** | 521 /** |
| 521 * @return !Promise<?{rect: !Array<number>, snapshot: !WebInspector.PaintProfi
lerSnapshot}>} | 522 * @return !Promise<?{rect: !Array<number>, snapshot: !WebInspector.PaintProfi
lerSnapshot}>} |
| (...skipping 19 matching lines...) Expand all Loading... |
| 541 constructor(triggerTime, timeByCategory) { | 542 constructor(triggerTime, timeByCategory) { |
| 542 /** @type {!Object.<string, number>} */ | 543 /** @type {!Object.<string, number>} */ |
| 543 this.timeByCategory = timeByCategory; | 544 this.timeByCategory = timeByCategory; |
| 544 /** @type {!Array.<!WebInspector.LayerPaintEvent>} */ | 545 /** @type {!Array.<!WebInspector.LayerPaintEvent>} */ |
| 545 this.paints = []; | 546 this.paints = []; |
| 546 /** @type {number|undefined} */ | 547 /** @type {number|undefined} */ |
| 547 this.mainFrameId = undefined; | 548 this.mainFrameId = undefined; |
| 548 this.triggerTime = triggerTime; | 549 this.triggerTime = triggerTime; |
| 549 } | 550 } |
| 550 }; | 551 }; |
| OLD | NEW |