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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js

Issue 2434393002: Timeline: promisify paint profiler and Layers panel, part I (Closed)
Patch Set: Timeline: promisify paint profiler and Layers panel, part I Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
index 8043805990e102c3c5bb16cff7684376d1c72c34..e13de2835a9130dd2f03d9e1adf8cd16a4d8df89 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
@@ -1408,19 +1408,18 @@ WebInspector.TimelineUIUtils._aggregatedStatsForTraceEvent = function(total, mod
*/
WebInspector.TimelineUIUtils.buildPicturePreviewContent = function(event, target, callback)
{
- new WebInspector.LayerPaintEvent(event, target).loadSnapshot(onSnapshotLoaded);
+ new WebInspector.LayerPaintEvent(event, target).snapshotPromise().then(onSnapshotLoaded);
/**
- * @param {?Array.<number>} rect
- * @param {?WebInspector.PaintProfilerSnapshot} snapshot
+ * @param {?{rect: !Array<number>, snapshot: !WebInspector.PaintProfilerSnapshot}} snapshotWithRect
*/
- function onSnapshotLoaded(rect, snapshot)
+ function onSnapshotLoaded(snapshotWithRect)
{
- if (!snapshot) {
+ if (!snapshotWithRect) {
callback();
return;
}
- snapshot.requestImage(null, null, 1, onGotImage);
- snapshot.dispose();
+ snapshotWithRect.snapshot.requestImage(null, null, 1, onGotImage);
+ snapshotWithRect.snapshot.dispose();
}
/**

Powered by Google App Engine
This is Rietveld 408576698