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

Unified Diff: Source/devtools/front_end/sdk/TracingModel.js

Issue 254613002: DevTools: add Tracing agent on back-end (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed a stray call to TracingAgent.enable() Created 6 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: Source/devtools/front_end/sdk/TracingModel.js
diff --git a/Source/devtools/front_end/sdk/TracingModel.js b/Source/devtools/front_end/sdk/TracingModel.js
index b5e316b3621fdb477b535a57c54b696fd045b3c4..af940d06921a84dc543d92dd1deadd8f4e3e8097 100644
--- a/Source/devtools/front_end/sdk/TracingModel.js
+++ b/Source/devtools/front_end/sdk/TracingModel.js
@@ -65,18 +65,44 @@ WebInspector.TracingModel.MetadataEvent = {
ThreadName: "thread_name"
}
+WebInspector.TracingModel.DevToolsMetadataEventCategory = "disabled-by-default-devtools.timeline";
+
+WebInspector.TracingModel.DevToolsMetadataEvent = {
+ TracingStartedInPage: "TracingStartedInPage",
+ SetLayerTreeId: "SetLayerTreeId"
+};
+
WebInspector.TracingModel.prototype = {
/**
- * @param {string} categoryPatterns
+ * @param {string} categoryFilter
+ */
+ enable: function(categoryFilter)
+ {
+ TracingAgent.enable(categoryFilter);
+ },
+
+ /**
+ * @param {string} categoryFilter
* @param {string} options
* @param {function(?string)=} callback
*/
- start: function(categoryPatterns, options, callback)
+ start: function(categoryFilter, options, callback)
{
this.reset();
var bufferUsageReportingIntervalMs = 500;
- TracingAgent.start(categoryPatterns, options, bufferUsageReportingIntervalMs, callback);
+ /**
+ * @param {?string} error
+ * @param {string} sessionId
+ * @this {WebInspector.TracingModel}
+ */
+ function callbackWrapper(error, sessionId)
+ {
+ this._sessionId = sessionId;
+ callback(error);
+ }
+ TracingAgent.start(categoryFilter, options, bufferUsageReportingIntervalMs, callbackWrapper.bind(this));
this._active = true;
+ this._sessionId = null;
},
/**
@@ -93,6 +119,14 @@ WebInspector.TracingModel.prototype = {
},
/**
+ * @return {?string}
+ */
+ sessionId: function()
+ {
+ return this._sessionId;
+ },
+
+ /**
* @param {number} usage
*/
_bufferUsage: function(usage)
@@ -433,11 +467,17 @@ WebInspector.TracingDispatcher = function(tracingModel)
}
WebInspector.TracingDispatcher.prototype = {
+ /**
+ * @param {number} usage
+ */
bufferUsage: function(usage)
{
this._tracingModel._bufferUsage(usage);
},
+ /**
+ * @param {!Array.<!WebInspector.TracingModel.EventPayload>} data
+ */
dataCollected: function(data)
{
this._tracingModel._eventsCollected(data);
« no previous file with comments | « Source/devtools/front_end/sdk/TimelineManager.js ('k') | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698