Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineFrameModel.js

Issue 2845813003: [DevTools] Host paint profiles in PaintProfilerModel (Closed)
Patch Set: addressed comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698