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); |