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

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

Issue 2722993002: [DevTools] Turn TracingManager into SDKModel. (Closed)
Patch Set: review comment 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 06f4e03ecfbe69b35b411b5f24b1eae53538838d..9e7af8e8046bcdcc18a2e1cd2ac61f864f708e0a 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js
@@ -27,12 +27,13 @@ SDK.TracingManagerClient.prototype = {
/**
* @unrestricted
*/
-SDK.TracingManager = class {
+SDK.TracingManager = class extends SDK.SDKModel {
/**
* @param {!SDK.Target} target
*/
constructor(target) {
- this._target = target;
+ super(target);
+ this._tracingAgent = target.tracingAgent();
target.registerTracingDispatcher(new SDK.TracingDispatcher(this));
/** @type {?SDK.TracingManagerClient} */
@@ -42,13 +43,6 @@ SDK.TracingManager = class {
}
/**
- * @return {?SDK.Target}
- */
- target() {
- return this._target;
- }
-
- /**
* @param {number=} usage
* @param {number=} eventCount
* @param {number=} percentFull
@@ -90,7 +84,7 @@ SDK.TracingManager = class {
throw new Error('Tracing is already started');
var bufferUsageReportingIntervalMs = 500;
this._activeClient = client;
- return this._target.tracingAgent().start(
+ return this._tracingAgent.start(
categoryFilter, options, bufferUsageReportingIntervalMs, SDK.TracingManager.TransferMode.ReportEvents);
}
@@ -100,10 +94,12 @@ SDK.TracingManager = class {
if (this._finishing)
throw new Error('Tracing is already being stopped');
this._finishing = true;
- this._target.tracingAgent().end();
+ this._tracingAgent.end();
}
};
+SDK.SDKModel.register(SDK.TracingManager, SDK.Target.Capability.Tracing);
+
/** @typedef {!{
cat: string,
pid: number,

Powered by Google App Engine
This is Rietveld 408576698