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

Unified Diff: Source/devtools/front_end/timeline/TracingTimelineModel.js

Issue 317273004: Create Tracing{Timeline}Model in TimelinePanel constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePanel.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TracingTimelineModel.js
diff --git a/Source/devtools/front_end/timeline/TracingTimelineModel.js b/Source/devtools/front_end/timeline/TracingTimelineModel.js
index 9d707af8818bc97d71f8feb186ca42a79af3f5eb..539de3c35f36fbf3004de55c96642d8777785616 100644
--- a/Source/devtools/front_end/timeline/TracingTimelineModel.js
+++ b/Source/devtools/front_end/timeline/TracingTimelineModel.js
@@ -5,9 +5,11 @@
/**
* @param {!WebInspector.TracingModel} tracingModel
* @constructor
+ * @extends {WebInspector.TargetAwareObject}
*/
WebInspector.TracingTimelineModel = function(tracingModel)
{
+ WebInspector.TargetAwareObject.call(this, tracingModel.target());
this._tracingModel = tracingModel;
this._mainThreadEvents = [];
this._inspectedTargetEvents = [];
@@ -88,7 +90,37 @@ WebInspector.TracingTimelineModel.RecordType = {
LayerTreeHostImplSnapshot: "cc::LayerTreeHostImpl"
};
+WebInspector.TracingTimelineModel.Events = {
+ TracingComplete: "TracingComplete"
+};
+
+WebInspector.TracingTimelineModel.defaultTracingCategoryFilter = "*,disabled-by-default-cc.debug,disabled-by-default-devtools.timeline";
+
WebInspector.TracingTimelineModel.prototype = {
+ /**
+ * @param {boolean} captureStacks
+ * @param {boolean} captureMemory
+ */
+ startRecording: function(captureStacks, captureMemory)
+ {
+ var categories;
+ if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()) {
+ categories = WebInspector.TracingTimelineModel.defaultTracingCategoryFilter;
+ } else {
+ var categoriesArray = ["disabled-by-default-devtools.timeline", "devtools"];
+ if (captureStacks)
+ categoriesArray.push("disabled-by-default-devtools.timeline.stack");
+ categories = categoriesArray.join(",");
+ }
+ this._tracingModel.start(categories, "");
+ this.willStartRecordingTraceEvents();
+ },
+
+ stopRecording: function()
+ {
+ this._tracingModel.stop(this.didStopRecordingTraceEvents.bind(this));
+ },
+
willStartRecordingTraceEvents: function()
{
this._mainThreadEvents = [];
@@ -115,6 +147,8 @@ WebInspector.TracingTimelineModel.prototype = {
this._resetProcessingState();
this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compareStartTime);
+
+ this.dispatchEventToListeners(WebInspector.TracingTimelineModel.Events.TracingComplete);
},
/**
@@ -341,6 +375,7 @@ WebInspector.TracingTimelineModel.prototype = {
return event;
}
return null;
- }
-}
+ },
+ __proto__: WebInspector.TargetAwareObject.prototype
+}
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePanel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698