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

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

Issue 2717393003: [DevTools] Turn starting tracing into promise. (Closed)
Patch Set: more work Created 3 years, 10 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/TracingManager.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js
index f60455d5f9cca54f4b19676b9a469001790cacfa..06f4e03ecfbe69b35b411b5f24b1eae53538838d 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js
@@ -9,7 +9,6 @@
SDK.TracingManagerClient = function() {};
SDK.TracingManagerClient.prototype = {
- tracingStarted() {},
/**
* @param {!Array.<!SDK.TracingManager.EventPayload>} events
*/
@@ -84,17 +83,15 @@ SDK.TracingManager = class {
* @param {!SDK.TracingManagerClient} client
* @param {string} categoryFilter
* @param {string} options
- * @param {function(?string)=} callback
+ * @return {!Promise}
*/
- start(client, categoryFilter, options, callback) {
+ start(client, categoryFilter, options) {
if (this._activeClient)
throw new Error('Tracing is already started');
var bufferUsageReportingIntervalMs = 500;
this._activeClient = client;
- this._target.tracingAgent().start(
- categoryFilter, options, bufferUsageReportingIntervalMs, SDK.TracingManager.TransferMode.ReportEvents,
- callback);
- this._activeClient.tracingStarted();
+ return this._target.tracingAgent().start(
+ categoryFilter, options, bufferUsageReportingIntervalMs, SDK.TracingManager.TransferMode.ReportEvents);
}
stop() {

Powered by Google App Engine
This is Rietveld 408576698