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

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

Issue 2850333002: DevTools: Promisify Profiler and HeapProfiler domains (Closed)
Patch Set: addressing comments Created 3 years, 8 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/CPUProfilerModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js
index c5a2d615acc1a983aff49b0bfd549f31e355a27b..add751fd9896a262771c6cf682035f59f59c4f8f 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js
@@ -121,19 +121,11 @@ SDK.CPUProfilerModel = class extends SDK.SDKModel {
}
/**
- * @return {!Promise.<?Protocol.Profiler.Profile>}
+ * @return {!Promise<?Protocol.Profiler.Profile>}
*/
stopRecording() {
- /**
- * @param {?Protocol.Error} error
- * @param {?Protocol.Profiler.Profile} profile
- * @return {?Protocol.Profiler.Profile}
- */
- function extractProfile(error, profile) {
- return !error && profile ? profile : null;
- }
this._isRecording = false;
- return this._profilerAgent.stop(extractProfile);
+ return this._profilerAgent.stop();
}
/**
@@ -147,7 +139,7 @@ SDK.CPUProfilerModel = class extends SDK.SDKModel {
* @return {!Promise<!Array<!Protocol.Profiler.ScriptCoverage>>}
*/
takePreciseCoverage() {
- return this._profilerAgent.takePreciseCoverage((error, coverage) => error ? [] : coverage);
+ return this._profilerAgent.takePreciseCoverage().then(result => result || []);
}
/**

Powered by Google App Engine
This is Rietveld 408576698