| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 /** | 159 /** |
| 160 * @param {?Protocol.Error} error | 160 * @param {?Protocol.Error} error |
| 161 * @param {?ProfilerAgent.CPUProfile} cpuProfile | 161 * @param {?ProfilerAgent.CPUProfile} cpuProfile |
| 162 */ | 162 */ |
| 163 _fireRecordingStopped: function(error, cpuProfile) | 163 _fireRecordingStopped: function(error, cpuProfile) |
| 164 { | 164 { |
| 165 this._collectionEnabled = false; | 165 this._collectionEnabled = false; |
| 166 if (cpuProfile) | 166 if (cpuProfile) |
| 167 WebInspector.TimelineJSProfileProcessor.mergeJSProfileIntoTimeline(t
his, cpuProfile); | 167 WebInspector.TimelineJSProfileProcessor.mergeJSProfileIntoTimeline(t
his, cpuProfile); |
| 168 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.Recordin
gStopped); | 168 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.Recordin
gStopped); |
| 169 this._currentTarget = null; |
| 169 }, | 170 }, |
| 170 | 171 |
| 171 /** | 172 /** |
| 172 * @param {!TimelineAgent.TimelineEvent} payload | 173 * @param {!TimelineAgent.TimelineEvent} payload |
| 173 */ | 174 */ |
| 174 _addRecord: function(payload) | 175 _addRecord: function(payload) |
| 175 { | 176 { |
| 176 this._internStrings(payload); | 177 this._internStrings(payload); |
| 177 this._payloads.push(payload); | 178 this._payloads.push(payload); |
| 178 | 179 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 if (!accepted) | 256 if (!accepted) |
| 256 return; | 257 return; |
| 257 var saver = new WebInspector.TimelineSaver(stream); | 258 var saver = new WebInspector.TimelineSaver(stream); |
| 258 saver.save(this._payloads, window.navigator.appVersion); | 259 saver.save(this._payloads, window.navigator.appVersion); |
| 259 } | 260 } |
| 260 stream.open(fileName, callback.bind(this)); | 261 stream.open(fileName, callback.bind(this)); |
| 261 }, | 262 }, |
| 262 | 263 |
| 263 reset: function() | 264 reset: function() |
| 264 { | 265 { |
| 265 this._currentTarget = null; | |
| 266 this._payloads = []; | 266 this._payloads = []; |
| 267 this._stringPool = {}; | 267 this._stringPool = {}; |
| 268 this._bindings._reset(); | 268 this._bindings._reset(); |
| 269 WebInspector.TimelineModel.prototype.reset.call(this); | 269 WebInspector.TimelineModel.prototype.reset.call(this); |
| 270 }, | 270 }, |
| 271 | 271 |
| 272 /** | 272 /** |
| 273 * @param {!TimelineAgent.TimelineEvent} record | 273 * @param {!TimelineAgent.TimelineEvent} record |
| 274 */ | 274 */ |
| 275 _internStrings: function(record) | 275 _internStrings: function(record) |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 break; | 727 break; |
| 728 length += itemLength; | 728 length += itemLength; |
| 729 data.push(item); | 729 data.push(item); |
| 730 ++this._recordIndex; | 730 ++this._recordIndex; |
| 731 } | 731 } |
| 732 if (this._recordIndex === this._payloads.length) | 732 if (this._recordIndex === this._payloads.length) |
| 733 data.push(data.pop() + "]"); | 733 data.push(data.pop() + "]"); |
| 734 stream.write(data.join(separator), this._writeNextChunk.bind(this)); | 734 stream.write(data.join(separator), this._writeNextChunk.bind(this)); |
| 735 } | 735 } |
| 736 } | 736 } |
| OLD | NEW |