OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @param {!WebInspector.TracingModel} tracingModel | 6 * @param {!WebInspector.TracingModel} tracingModel |
7 * @constructor | 7 * @constructor |
8 * @extends {WebInspector.TimelineModel} | 8 * @extends {WebInspector.TimelineModel} |
9 */ | 9 */ |
10 WebInspector.TracingTimelineModel = function(tracingModel) | 10 WebInspector.TracingTimelineModel = function(tracingModel) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 WebInspector.TracingTimelineModel.defaultTracingCategoryFilter = "*,disabled-by-
default-cc.debug,disabled-by-default-devtools.timeline"; | 95 WebInspector.TracingTimelineModel.defaultTracingCategoryFilter = "*,disabled-by-
default-cc.debug,disabled-by-default-devtools.timeline"; |
96 | 96 |
97 WebInspector.TracingTimelineModel.prototype = { | 97 WebInspector.TracingTimelineModel.prototype = { |
98 /** | 98 /** |
99 * @param {boolean} captureStacks | 99 * @param {boolean} captureStacks |
100 * @param {boolean} captureMemory | 100 * @param {boolean} captureMemory |
101 */ | 101 */ |
102 startRecording: function(captureStacks, captureMemory) | 102 startRecording: function(captureStacks, captureMemory) |
103 { | 103 { |
104 this.reset(); | |
105 var categories; | 104 var categories; |
106 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()) { | 105 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()) { |
107 categories = WebInspector.TracingTimelineModel.defaultTracingCategor
yFilter; | 106 categories = WebInspector.TracingTimelineModel.defaultTracingCategor
yFilter; |
108 } else { | 107 } else { |
109 var categoriesArray = ["disabled-by-default-devtools.timeline", "dev
tools"]; | 108 var categoriesArray = ["disabled-by-default-devtools.timeline", "dev
tools"]; |
110 if (captureStacks) | 109 if (captureStacks) |
111 categoriesArray.push("disabled-by-default-devtools.timeline.stac
k"); | 110 categoriesArray.push("disabled-by-default-devtools.timeline.stac
k"); |
112 categories = categoriesArray.join(","); | 111 categories = categoriesArray.join(","); |
113 } | 112 } |
114 this._startRecordingWithCategories(categories); | 113 this._startRecordingWithCategories(categories); |
(...skipping 14 matching lines...) Expand all Loading... |
129 this._didStartRecordingTraceEvents(); | 128 this._didStartRecordingTraceEvents(); |
130 this._tracingModel.setEventsForTest(sessionId, events); | 129 this._tracingModel.setEventsForTest(sessionId, events); |
131 this._didStopRecordingTraceEvents(); | 130 this._didStopRecordingTraceEvents(); |
132 }, | 131 }, |
133 | 132 |
134 /** | 133 /** |
135 * @param {string} categories | 134 * @param {string} categories |
136 */ | 135 */ |
137 _startRecordingWithCategories: function(categories) | 136 _startRecordingWithCategories: function(categories) |
138 { | 137 { |
| 138 this.reset(); |
139 this._tracingModel.start(categories, "", this._didStartRecordingTraceEve
nts.bind(this)); | 139 this._tracingModel.start(categories, "", this._didStartRecordingTraceEve
nts.bind(this)); |
140 }, | 140 }, |
141 | 141 |
142 _didStartRecordingTraceEvents: function() | 142 _didStartRecordingTraceEvents: function() |
143 { | 143 { |
144 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.Recordin
gStarted); | 144 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.Recordin
gStarted); |
145 }, | 145 }, |
146 | 146 |
147 _didStopRecordingTraceEvents: function() | 147 _didStopRecordingTraceEvents: function() |
148 { | 148 { |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 { | 654 { |
655 var tokens = [this.title()]; | 655 var tokens = [this.title()]; |
656 var data = this._event.args.data; | 656 var data = this._event.args.data; |
657 if (data) { | 657 if (data) { |
658 for (var key in data) | 658 for (var key in data) |
659 tokens.push(data[key]); | 659 tokens.push(data[key]); |
660 } | 660 } |
661 return regExp.test(tokens.join("|")); | 661 return regExp.test(tokens.join("|")); |
662 } | 662 } |
663 } | 663 } |
OLD | NEW |