| 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 * @extends {WebInspector.TimelineModel} | 7 * @extends {WebInspector.TimelineModel} |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 */ | 9 */ |
| 10 WebInspector.TimelineModelImpl = function() | 10 WebInspector.TimelineModelImpl = function() |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 /** | 35 /** |
| 36 * @param {!WebInspector.Target} target | 36 * @param {!WebInspector.Target} target |
| 37 */ | 37 */ |
| 38 targetRemoved: function(target) | 38 targetRemoved: function(target) |
| 39 { | 39 { |
| 40 if (this._currentTarget === target) | 40 if (this._currentTarget === target) |
| 41 this._currentTarget = null; | 41 this._currentTarget = null; |
| 42 }, | 42 }, |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * @param {boolean} captureStacks | 45 * @param {boolean} captureCauses |
| 46 * @param {boolean} captureMemory | 46 * @param {boolean} captureMemory |
| 47 * @param {boolean} capturePictures | 47 * @param {boolean} capturePictures |
| 48 */ | 48 */ |
| 49 startRecording: function(captureStacks, captureMemory, capturePictures) | 49 startRecording: function(captureCauses, captureMemory, capturePictures) |
| 50 { | 50 { |
| 51 console.assert(!capturePictures, "Legacy timeline does not support captu
ring pictures"); | 51 console.assert(!capturePictures, "Legacy timeline does not support captu
ring pictures"); |
| 52 this.reset(); | 52 this.reset(); |
| 53 this._currentTarget = WebInspector.context.flavor(WebInspector.Target); | 53 this._currentTarget = WebInspector.context.flavor(WebInspector.Target); |
| 54 console.assert(this._currentTarget); | 54 console.assert(this._currentTarget); |
| 55 | 55 |
| 56 this._clientInitiatedRecording = true; | 56 this._clientInitiatedRecording = true; |
| 57 var maxStackFrames = captureStacks ? 30 : 0; | 57 var maxStackFrames = captureCauses ? 30 : 0; |
| 58 var includeGPUEvents = Runtime.experiments.isEnabled("gpuTimeline"); | 58 var includeGPUEvents = Runtime.experiments.isEnabled("gpuTimeline"); |
| 59 var liveEvents = [ WebInspector.TimelineModel.RecordType.BeginFrame, | 59 var liveEvents = [ WebInspector.TimelineModel.RecordType.BeginFrame, |
| 60 WebInspector.TimelineModel.RecordType.DrawFrame, | 60 WebInspector.TimelineModel.RecordType.DrawFrame, |
| 61 WebInspector.TimelineModel.RecordType.RequestMainThre
adFrame, | 61 WebInspector.TimelineModel.RecordType.RequestMainThre
adFrame, |
| 62 WebInspector.TimelineModel.RecordType.ActivateLayerTr
ee ]; | 62 WebInspector.TimelineModel.RecordType.ActivateLayerTr
ee ]; |
| 63 this._currentTarget.timelineManager.start(maxStackFrames, liveEvents.joi
n(","), captureMemory, includeGPUEvents, this._fireRecordingStarted.bind(this)); | 63 this._currentTarget.timelineManager.start(maxStackFrames, liveEvents.joi
n(","), captureMemory, includeGPUEvents, this._fireRecordingStarted.bind(this)); |
| 64 }, | 64 }, |
| 65 | 65 |
| 66 stopRecording: function() | 66 stopRecording: function() |
| 67 { | 67 { |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 break; | 659 break; |
| 660 length += itemLength; | 660 length += itemLength; |
| 661 data.push(item); | 661 data.push(item); |
| 662 ++this._recordIndex; | 662 ++this._recordIndex; |
| 663 } | 663 } |
| 664 if (this._recordIndex === this._payloads.length) | 664 if (this._recordIndex === this._payloads.length) |
| 665 data.push(data.pop() + "]"); | 665 data.push(data.pop() + "]"); |
| 666 stream.write(data.join(separator), this._writeNextChunk.bind(this)); | 666 stream.write(data.join(separator), this._writeNextChunk.bind(this)); |
| 667 } | 667 } |
| 668 } | 668 } |
| OLD | NEW |