OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 return false; | 206 return false; |
207 } | 207 } |
208 return true; | 208 return true; |
209 }, | 209 }, |
210 | 210 |
211 _filterChanged: function() | 211 _filterChanged: function() |
212 { | 212 { |
213 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.RecordFi lterChanged); | 213 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.RecordFi lterChanged); |
214 }, | 214 }, |
215 | 215 |
216 /** | 216 startRecording: function() |
217 * @param {boolean=} includeCounters | |
218 */ | |
219 startRecording: function(includeCounters) | |
220 { | 217 { |
221 this._clientInitiatedRecording = true; | 218 this._clientInitiatedRecording = true; |
222 this.reset(); | 219 this.reset(); |
223 var maxStackFrames = WebInspector.settings.timelineCaptureStacks.get() ? 30 : 0; | 220 var maxStackFrames = WebInspector.settings.timelineCaptureStacks.get() ? 30 : 0; |
224 var bufferEvents = WebInspector.experimentsSettings.timelineNoLiveUpdate .isEnabled() && !WebInspector.settings.timelineLiveUpdate.get(); | 221 this._bufferEvents = WebInspector.experimentsSettings.timelineNoLiveUpda te.isEnabled() && !WebInspector.settings.timelineLiveUpdate.get(); |
225 var includeGPUEvents = WebInspector.experimentsSettings.gpuTimeline.isEn abled(); | 222 var includeGPUEvents = WebInspector.experimentsSettings.gpuTimeline.isEn abled(); |
226 WebInspector.timelineManager.start(maxStackFrames, bufferEvents, include Counters, includeGPUEvents, this._fireRecordingStarted.bind(this)); | 223 var liveEvents = [ WebInspector.TimelineModel.RecordType.BeginFrame, |
224 WebInspector.TimelineModel.RecordType.DrawFrame, | |
caseq
2014/03/26 16:21:06
Wring indent
| |
225 WebInspector.TimelineModel.RecordType.RequestMainThre adFrame, | |
226 WebInspector.TimelineModel.RecordType.ActivateLayerTr ee ]; | |
227 var includeCounters = true; | |
228 WebInspector.timelineManager.start(maxStackFrames, this._bufferEvents, l iveEvents.join(","), includeCounters, includeGPUEvents, this._fireRecordingStart ed.bind(this)); | |
227 }, | 229 }, |
228 | 230 |
229 stopRecording: function() | 231 stopRecording: function() |
230 { | 232 { |
231 if (!this._clientInitiatedRecording) { | 233 if (!this._clientInitiatedRecording) { |
232 WebInspector.timelineManager.start(undefined, undefined, undefined, undefined, stopTimeline.bind(this)); | 234 WebInspector.timelineManager.start(undefined, undefined, undefined, undefined, undefined, stopTimeline.bind(this)); |
233 return; | 235 return; |
234 } | 236 } |
235 | 237 |
236 /** | 238 /** |
237 * Console started this one and we are just sniffing it. Initiate record ing so that we | 239 * Console started this one and we are just sniffing it. Initiate record ing so that we |
238 * could stop it. | 240 * could stop it. |
239 * @this {WebInspector.TimelineModel} | 241 * @this {WebInspector.TimelineModel} |
240 */ | 242 */ |
241 function stopTimeline() | 243 function stopTimeline() |
242 { | 244 { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 this._collectionEnabled = true; | 293 this._collectionEnabled = true; |
292 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.Recordin gStarted); | 294 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.Recordin gStarted); |
293 }, | 295 }, |
294 | 296 |
295 /** | 297 /** |
296 * @param {?Protocol.Error} error | 298 * @param {?Protocol.Error} error |
297 * @param {!Array.<!TimelineAgent.TimelineEvent>=} events | 299 * @param {!Array.<!TimelineAgent.TimelineEvent>=} events |
298 */ | 300 */ |
299 _fireRecordingStopped: function(error, events) | 301 _fireRecordingStopped: function(error, events) |
300 { | 302 { |
303 this._bufferEvents = false; | |
301 this._collectionEnabled = false; | 304 this._collectionEnabled = false; |
302 for (var i = 0; events && i < events.length; ++i) | 305 if (events && events.length) { |
303 this._addRecord(events[i]); | 306 this.reset(); |
307 for (var i = 0; i < events.length; ++i) | |
308 this._addRecord(events[i]); | |
309 } | |
304 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.Recordin gStopped); | 310 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.Recordin gStopped); |
305 }, | 311 }, |
306 | 312 |
307 /** | 313 /** |
314 * @return {boolean} | |
315 */ | |
316 bufferEvents: function() | |
317 { | |
318 return this._bufferEvents; | |
319 }, | |
320 | |
321 /** | |
308 * @param {!TimelineAgent.TimelineEvent} payload | 322 * @param {!TimelineAgent.TimelineEvent} payload |
309 */ | 323 */ |
310 _addRecord: function(payload) | 324 _addRecord: function(payload) |
311 { | 325 { |
312 this._internStrings(payload); | 326 this._internStrings(payload); |
313 this._payloads.push(payload); | 327 this._payloads.push(payload); |
314 this._updateBoundaries(payload); | 328 this._updateBoundaries(payload); |
315 | 329 |
316 var record = this._innerAddRecord(payload, null); | 330 var record = this._innerAddRecord(payload, null); |
317 this._records.push(record); | 331 this._records.push(record); |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1167 WebInspector.TimelineModel._quadFromRectData = function(data) | 1181 WebInspector.TimelineModel._quadFromRectData = function(data) |
1168 { | 1182 { |
1169 if (typeof data["x"] === "undefined" || typeof data["y"] === "undefined") | 1183 if (typeof data["x"] === "undefined" || typeof data["y"] === "undefined") |
1170 return null; | 1184 return null; |
1171 var x0 = data["x"]; | 1185 var x0 = data["x"]; |
1172 var x1 = data["x"] + data["width"]; | 1186 var x1 = data["x"] + data["width"]; |
1173 var y0 = data["y"]; | 1187 var y0 = data["y"]; |
1174 var y1 = data["y"] + data["height"]; | 1188 var y1 = data["y"] + data["height"]; |
1175 return [x0, y0, x1, y0, x1, y1, x0, y1]; | 1189 return [x0, y0, x1, y0, x1, y1, x0, y1]; |
1176 } | 1190 } |
OLD | NEW |