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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/PaintProfiler.js

Issue 2434393002: Timeline: promisify paint profiler and Layers panel, part I (Closed)
Patch Set: review comments addressed 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/sdk/PaintProfiler.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/PaintProfiler.js b/third_party/WebKit/Source/devtools/front_end/sdk/PaintProfiler.js
index f8756bf7092b4b2a6280dbec7cc24eb98a0a44fd..5eb744d540fbbea3ffbf41c69f6ddfdaa684df89 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/PaintProfiler.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/PaintProfiler.js
@@ -47,27 +47,26 @@ WebInspector.PaintProfilerSnapshot = function(target, snapshotId)
/**
* @param {!WebInspector.Target} target
* @param {!Array.<!WebInspector.PictureFragment>} fragments
- * @param {function(?WebInspector.PaintProfilerSnapshot)} callback
+ * @return {!Promise<?WebInspector.PaintProfilerSnapshot>}
*/
-WebInspector.PaintProfilerSnapshot.loadFromFragments = function(target, fragments, callback)
+WebInspector.PaintProfilerSnapshot.loadFromFragments = function(target, fragments)
{
- var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.loadSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, target));
- target.layerTreeAgent().loadSnapshot(fragments, wrappedCallback);
+ return target.layerTreeAgent().loadSnapshot(fragments, (error, snapshotId) => error ? null : new WebInspector.PaintProfilerSnapshot(target, snapshotId));
}
/**
* @param {!WebInspector.Target} target
* @param {string} encodedPicture
- * @param {function(?WebInspector.PaintProfilerSnapshot)} callback
+ * @return {!Promise<?WebInspector.PaintProfilerSnapshot>}
*/
-WebInspector.PaintProfilerSnapshot.load = function(target, encodedPicture, callback)
+WebInspector.PaintProfilerSnapshot.load = function(target, encodedPicture)
{
var fragment = {
x: 0,
y: 0,
picture: encodedPicture
};
- WebInspector.PaintProfilerSnapshot.loadFromFragments(target, [fragment], callback);
+ return WebInspector.PaintProfilerSnapshot.loadFromFragments(target, [fragment]);
}
WebInspector.PaintProfilerSnapshot.prototype = {

Powered by Google App Engine
This is Rietveld 408576698