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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 var rect = result['params'] && result['params']['layer_rect']; | 498 var rect = result['params'] && result['params']['layer_rect']; |
499 var picture = result['skp64']; | 499 var picture = result['skp64']; |
500 return rect && picture ? {rect: rect, serializedPicture: picture} : null; | 500 return rect && picture ? {rect: rect, serializedPicture: picture} : null; |
501 }); | 501 }); |
502 } | 502 } |
503 | 503 |
504 /** | 504 /** |
505 * @return !Promise<?{rect: !Array<number>, snapshot: !SDK.PaintProfilerSnapsh
ot}>} | 505 * @return !Promise<?{rect: !Array<number>, snapshot: !SDK.PaintProfilerSnapsh
ot}>} |
506 */ | 506 */ |
507 snapshotPromise() { | 507 snapshotPromise() { |
| 508 var paintProfilerModel = this._target && this._target.model(SDK.PaintProfile
rModel); |
508 return this.picturePromise().then(picture => { | 509 return this.picturePromise().then(picture => { |
509 if (!picture || !this._target) | 510 if (!picture || !paintProfilerModel) |
510 return null; | 511 return null; |
511 return SDK.PaintProfilerSnapshot.load(this._target, picture.serializedPict
ure) | 512 return paintProfilerModel.loadSnapshot(picture.serializedPicture) |
512 .then(snapshot => snapshot ? {rect: picture.rect, snapshot: snapshot}
: null); | 513 .then(snapshot => snapshot ? {rect: picture.rect, snapshot: snapshot}
: null); |
513 }); | 514 }); |
514 } | 515 } |
515 }; | 516 }; |
516 | 517 |
517 /** | 518 /** |
518 * @unrestricted | 519 * @unrestricted |
519 */ | 520 */ |
520 TimelineModel.PendingFrame = class { | 521 TimelineModel.PendingFrame = class { |
521 /** | 522 /** |
522 * @param {number} triggerTime | 523 * @param {number} triggerTime |
523 * @param {!Object.<string, number>} timeByCategory | 524 * @param {!Object.<string, number>} timeByCategory |
524 */ | 525 */ |
525 constructor(triggerTime, timeByCategory) { | 526 constructor(triggerTime, timeByCategory) { |
526 /** @type {!Object.<string, number>} */ | 527 /** @type {!Object.<string, number>} */ |
527 this.timeByCategory = timeByCategory; | 528 this.timeByCategory = timeByCategory; |
528 /** @type {!Array.<!TimelineModel.LayerPaintEvent>} */ | 529 /** @type {!Array.<!TimelineModel.LayerPaintEvent>} */ |
529 this.paints = []; | 530 this.paints = []; |
530 /** @type {number|undefined} */ | 531 /** @type {number|undefined} */ |
531 this.mainFrameId = undefined; | 532 this.mainFrameId = undefined; |
532 this.triggerTime = triggerTime; | 533 this.triggerTime = triggerTime; |
533 } | 534 } |
534 }; | 535 }; |
OLD | NEW |