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 * @constructor | 6 * @constructor |
7 * @param {!WebInspector.TracingManager} tracingManager | 7 * @param {!WebInspector.TracingManager} tracingManager |
8 * @param {!WebInspector.TracingModel} tracingModel | 8 * @param {!WebInspector.TracingModel} tracingModel |
9 * @param {!WebInspector.TimelineModel.Filter} recordFilter | 9 * @param {!WebInspector.TimelineModel.Filter} recordFilter |
10 * @extends {WebInspector.TimelineModel} | 10 * @extends {WebInspector.TimelineModel} |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 this.name = name; | 115 this.name = name; |
116 /** @type {!Array.<!WebInspector.TracingModel.Event>} */ | 116 /** @type {!Array.<!WebInspector.TracingModel.Event>} */ |
117 this.events = []; | 117 this.events = []; |
118 /** @type {!Array.<!Array.<!WebInspector.TracingModel.Event>>} */ | 118 /** @type {!Array.<!Array.<!WebInspector.TracingModel.Event>>} */ |
119 this.asyncEvents = []; | 119 this.asyncEvents = []; |
120 } | 120 } |
121 | 121 |
122 WebInspector.TracingTimelineModel.prototype = { | 122 WebInspector.TracingTimelineModel.prototype = { |
123 /** | 123 /** |
124 * @param {boolean} captureCauses | 124 * @param {boolean} captureCauses |
| 125 * @param {boolean} enableJSSampling |
125 * @param {boolean} captureMemory | 126 * @param {boolean} captureMemory |
126 * @param {boolean} capturePictures | 127 * @param {boolean} capturePictures |
127 */ | 128 */ |
128 startRecording: function(captureCauses, captureMemory, capturePictures) | 129 startRecording: function(captureCauses, enableJSSampling, captureMemory, cap
turePictures) |
129 { | 130 { |
130 function disabledByDefault(category) | 131 function disabledByDefault(category) |
131 { | 132 { |
132 return "disabled-by-default-" + category; | 133 return "disabled-by-default-" + category; |
133 } | 134 } |
134 var categoriesArray = [ | 135 var categoriesArray = [ |
135 "-*", | 136 "-*", |
136 disabledByDefault("devtools.timeline"), | 137 disabledByDefault("devtools.timeline"), |
137 disabledByDefault("devtools.timeline.frame"), | 138 disabledByDefault("devtools.timeline.frame"), |
138 WebInspector.TracingModel.ConsoleEventCategory | 139 WebInspector.TracingModel.ConsoleEventCategory |
139 ]; | 140 ]; |
140 if (captureCauses) { | 141 if (captureCauses || enableJSSampling) |
141 categoriesArray.push(disabledByDefault("devtools.timeline.stack")); | 142 categoriesArray.push(disabledByDefault("devtools.timeline.stack")); |
142 if (Runtime.experiments.isEnabled("timelineJSCPUProfile")) { | 143 if (enableJSSampling) { |
143 this._jsProfilerStarted = true; | 144 this._jsProfilerStarted = true; |
144 this._currentTarget = WebInspector.context.flavor(WebInspector.T
arget); | 145 this._currentTarget = WebInspector.context.flavor(WebInspector.Targe
t); |
145 this._configureCpuProfilerSamplingInterval(); | 146 this._configureCpuProfilerSamplingInterval(); |
146 this._currentTarget.profilerAgent().start(); | 147 this._currentTarget.profilerAgent().start(); |
147 } | |
148 } | 148 } |
| 149 |
149 if (capturePictures) { | 150 if (capturePictures) { |
150 categoriesArray = categoriesArray.concat([ | 151 categoriesArray = categoriesArray.concat([ |
151 disabledByDefault("devtools.timeline.layers"), | 152 disabledByDefault("devtools.timeline.layers"), |
152 disabledByDefault("devtools.timeline.picture"), | 153 disabledByDefault("devtools.timeline.picture"), |
153 disabledByDefault("blink.graphics_context_annotations")]); | 154 disabledByDefault("blink.graphics_context_annotations")]); |
154 } | 155 } |
155 var categories = categoriesArray.join(","); | 156 var categories = categoriesArray.join(","); |
156 this._startRecordingWithCategories(categories); | 157 this._startRecordingWithCategories(categories); |
157 }, | 158 }, |
158 | 159 |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 * @param {!WebInspector.ChunkedReader} reader | 1097 * @param {!WebInspector.ChunkedReader} reader |
1097 */ | 1098 */ |
1098 onChunkTransferred: function(reader) { }, | 1099 onChunkTransferred: function(reader) { }, |
1099 | 1100 |
1100 /** | 1101 /** |
1101 * @param {!WebInspector.ChunkedReader} reader | 1102 * @param {!WebInspector.ChunkedReader} reader |
1102 * @param {!Event} event | 1103 * @param {!Event} event |
1103 */ | 1104 */ |
1104 onError: function(reader, event) { }, | 1105 onError: function(reader, event) { }, |
1105 } | 1106 } |
OLD | NEW |