| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 }, | 244 }, |
| 245 | 245 |
| 246 /** | 246 /** |
| 247 * @return {!WebInspector.TimelineFrameModel} | 247 * @return {!WebInspector.TimelineFrameModel} |
| 248 */ | 248 */ |
| 249 _frameModel: function() | 249 _frameModel: function() |
| 250 { | 250 { |
| 251 if (!this._lazyFrameModel) { | 251 if (!this._lazyFrameModel) { |
| 252 this._lazyFrameModel = new WebInspector.TimelineFrameModel(this._mod
el); | 252 this._lazyFrameModel = new WebInspector.TimelineFrameModel(this._mod
el); |
| 253 if (this._lazyTracingModel) | 253 if (this._lazyTracingModel) |
| 254 this._lazyFrameModel.addTraceEvents(this._lazyTracingModel.inspe
ctedTargetEvents(), this._lazyTracingModel.sessionId()); | 254 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.i
nspectedTargetEvents(), this._lazyTracingModel.sessionId()); |
| 255 | 255 |
| 256 } | 256 } |
| 257 return this._lazyFrameModel; | 257 return this._lazyFrameModel; |
| 258 }, | 258 }, |
| 259 | 259 |
| 260 /** | 260 /** |
| 261 * @return {!WebInspector.TracingModel} | 261 * @return {!WebInspector.TracingModel} |
| 262 */ | 262 */ |
| 263 _tracingModel: function() | 263 _tracingModel: function() |
| 264 { | 264 { |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 */ | 656 */ |
| 657 _startRecording: function(userInitiated) | 657 _startRecording: function(userInitiated) |
| 658 { | 658 { |
| 659 this._userInitiatedRecording = userInitiated; | 659 this._userInitiatedRecording = userInitiated; |
| 660 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ | 660 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ |
| 661 var categories = ["disabled-by-default-devtools.timeline", "devtools
"]; | 661 var categories = ["disabled-by-default-devtools.timeline", "devtools
"]; |
| 662 if (this._captureStacksSetting.get()) | 662 if (this._captureStacksSetting.get()) |
| 663 categories.push("disabled-by-default-devtools.timeline.stack"); | 663 categories.push("disabled-by-default-devtools.timeline.stack"); |
| 664 this._model.willStartRecordingTraceEvents(); | 664 this._model.willStartRecordingTraceEvents(); |
| 665 this._tracingModel().start(categories.join(","), ""); | 665 this._tracingModel().start(categories.join(","), ""); |
| 666 this._tracingTimelineModel.willStartRecordingTraceEvents(); |
| 666 } else { | 667 } else { |
| 667 this._model.startRecording(this._captureStacksSetting.get(), this._c
aptureMemorySetting.get()); | 668 this._model.startRecording(this._captureStacksSetting.get(), this._c
aptureMemorySetting.get()); |
| 668 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()
) | 669 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()
) { |
| 669 this._tracingModel().start(WebInspector.TimelinePanel.defaultTra
cingCategoryFilter, ""); | 670 this._tracingModel().start(WebInspector.TimelinePanel.defaultTra
cingCategoryFilter, ""); |
| 671 this._tracingTimelineModel.willStartRecordingTraceEvents(); |
| 672 } |
| 670 } | 673 } |
| 671 for (var i = 0; i < this._overviewControls.length; ++i) | 674 for (var i = 0; i < this._overviewControls.length; ++i) |
| 672 this._overviewControls[i].timelineStarted(); | 675 this._overviewControls[i].timelineStarted(); |
| 673 | 676 |
| 674 if (userInitiated) | 677 if (userInitiated) |
| 675 WebInspector.userMetrics.TimelineStarted.record(); | 678 WebInspector.userMetrics.TimelineStarted.record(); |
| 676 }, | 679 }, |
| 677 | 680 |
| 678 _stopRecording: function() | 681 _stopRecording: function() |
| 679 { | 682 { |
| 680 this._userInitiatedRecording = false; | 683 this._userInitiatedRecording = false; |
| 681 this._model.stopRecording(); | 684 this._model.stopRecording(); |
| 682 if (this._lazyTracingModel) | 685 if (this._lazyTracingModel) |
| 683 this._lazyTracingModel.stop(this._onTracingComplete.bind(this)); | 686 this._lazyTracingModel.stop(this._onTracingComplete.bind(this)); |
| 684 | 687 |
| 685 for (var i = 0; i < this._overviewControls.length; ++i) | 688 for (var i = 0; i < this._overviewControls.length; ++i) |
| 686 this._overviewControls[i].timelineStopped(); | 689 this._overviewControls[i].timelineStopped(); |
| 687 }, | 690 }, |
| 688 | 691 |
| 689 _onTracingComplete: function() | 692 _onTracingComplete: function() |
| 690 { | 693 { |
| 694 this._tracingTimelineModel.didStopRecordingTraceEvents(); |
| 691 if (this._lazyFrameModel) { | 695 if (this._lazyFrameModel) { |
| 692 this._lazyFrameModel.reset(); | 696 this._lazyFrameModel.reset(); |
| 693 this._lazyFrameModel.addTraceEvents(this._lazyTracingModel.inspected
TargetEvents(), this._lazyTracingModel.sessionId()); | 697 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.inspe
ctedTargetEvents(), this._lazyTracingModel.sessionId()); |
| 694 this._overviewPane.update(); | 698 this._overviewPane.update(); |
| 695 } | 699 } |
| 696 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ | 700 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) |
| 697 this._tracingTimelineModel.didStopRecordingTraceEvents(); | |
| 698 this._model.didStopRecordingTraceEvents(this._tracingTimelineModel.m
ainThreadEvents()); | 701 this._model.didStopRecordingTraceEvents(this._tracingTimelineModel.m
ainThreadEvents()); |
| 699 } | |
| 700 this._refreshViews(); | 702 this._refreshViews(); |
| 701 }, | 703 }, |
| 702 | 704 |
| 703 _onProfilingStateChanged: function() | 705 _onProfilingStateChanged: function() |
| 704 { | 706 { |
| 705 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); | 707 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); |
| 706 }, | 708 }, |
| 707 | 709 |
| 708 /** | 710 /** |
| 709 * @param {boolean} toggled | 711 * @param {boolean} toggled |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 * @param {!WebInspector.TimelineModel.Record} record | 1439 * @param {!WebInspector.TimelineModel.Record} record |
| 1438 * @return {boolean} | 1440 * @return {boolean} |
| 1439 */ | 1441 */ |
| 1440 accept: function(record) | 1442 accept: function(record) |
| 1441 { | 1443 { |
| 1442 return !this._hiddenRecords[record.type()]; | 1444 return !this._hiddenRecords[record.type()]; |
| 1443 }, | 1445 }, |
| 1444 | 1446 |
| 1445 __proto__: WebInspector.TimelineModel.Filter.prototype | 1447 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1446 } | 1448 } |
| OLD | NEW |