Chromium Code Reviews| 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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 663 | 663 |
| 664 for (var i = 0; i < this._overviewControls.length; ++i) | 664 for (var i = 0; i < this._overviewControls.length; ++i) |
| 665 this._overviewControls[i].timelineStarted(); | 665 this._overviewControls[i].timelineStarted(); |
| 666 | 666 |
| 667 if (userInitiated) | 667 if (userInitiated) |
| 668 WebInspector.userMetrics.TimelineStarted.record(); | 668 WebInspector.userMetrics.TimelineStarted.record(); |
| 669 }, | 669 }, |
| 670 | 670 |
| 671 _stopRecording: function() | 671 _stopRecording: function() |
| 672 { | 672 { |
| 673 this._stopPending = true; | |
| 674 this._updateToggleTimelineButton(false); | |
| 673 this._userInitiatedRecording = false; | 675 this._userInitiatedRecording = false; |
| 674 this._model.stopRecording(); | 676 this._model.stopRecording(); |
| 677 if (this._progressElement) | |
| 678 this._updateProgress(WebInspector.UIString("Retrieving events\u2026" )); | |
| 675 | 679 |
| 676 for (var i = 0; i < this._overviewControls.length; ++i) | 680 for (var i = 0; i < this._overviewControls.length; ++i) |
| 677 this._overviewControls[i].timelineStopped(); | 681 this._overviewControls[i].timelineStopped(); |
| 678 }, | 682 }, |
| 679 | 683 |
| 680 _onProfilingStateChanged: function() | 684 _onProfilingStateChanged: function() |
| 681 { | 685 { |
| 682 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); | 686 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); |
| 683 }, | 687 }, |
| 684 | 688 |
| 685 /** | 689 /** |
| 686 * @param {boolean} toggled | 690 * @param {boolean} toggled |
| 687 */ | 691 */ |
| 688 _updateToggleTimelineButton: function(toggled) | 692 _updateToggleTimelineButton: function(toggled) |
| 689 { | 693 { |
| 690 var enable = toggled || !this._model.target().profilingLock.isAcquired() ; | |
| 691 this.toggleTimelineButton.setEnabled(enable); | |
| 692 this.toggleTimelineButton.toggled = toggled; | 694 this.toggleTimelineButton.toggled = toggled; |
| 693 if (enable) | 695 if (toggled) { |
| 694 this.toggleTimelineButton.title = toggled ? WebInspector.UIString("S top") : WebInspector.UIString("Record"); | 696 this.toggleTimelineButton.title = WebInspector.UIString("Stop"); |
| 695 else | 697 this.toggleTimelineButton.setEnabled(true); |
| 698 } else if (this._stopPending) { | |
| 699 this.toggleTimelineButton.title = WebInspector.UIString("Stop pendin g"); | |
| 700 this.toggleTimelineButton.setEnabled(false); | |
| 701 } else if (this._model.target().profilingLock.isAcquired()) { | |
| 696 this.toggleTimelineButton.title = WebInspector.UIString("Another pro filer is already active"); | 702 this.toggleTimelineButton.title = WebInspector.UIString("Another pro filer is already active"); |
|
yurys
2014/06/16 07:18:07
Hm, why do we show this message only when toggled
| |
| 703 this.toggleTimelineButton.setEnabled(false); | |
| 704 } else { | |
| 705 this.toggleTimelineButton.title = WebInspector.UIString("Record"); | |
| 706 this.toggleTimelineButton.setEnabled(true); | |
| 707 } | |
| 697 }, | 708 }, |
| 698 | 709 |
| 699 /** | 710 /** |
| 700 * @return {boolean} | 711 * @return {boolean} |
| 701 */ | 712 */ |
| 702 _toggleTimelineButtonClicked: function() | 713 _toggleTimelineButtonClicked: function() |
| 703 { | 714 { |
| 704 if (!this.toggleTimelineButton.enabled()) | 715 if (!this.toggleTimelineButton.enabled()) |
| 705 return true; | 716 return true; |
| 706 if (this._operationInProgress) | 717 if (this._operationInProgress) |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 786 | 797 |
| 787 _hideProgressPane: function() | 798 _hideProgressPane: function() |
| 788 { | 799 { |
| 789 if (this._progressElement) | 800 if (this._progressElement) |
| 790 this._progressElement.remove(); | 801 this._progressElement.remove(); |
| 791 delete this._progressElement; | 802 delete this._progressElement; |
| 792 }, | 803 }, |
| 793 | 804 |
| 794 _onRecordingStopped: function() | 805 _onRecordingStopped: function() |
| 795 { | 806 { |
| 807 this._stopPending = false; | |
| 796 this._updateToggleTimelineButton(false); | 808 this._updateToggleTimelineButton(false); |
| 797 if (this._lazyFrameModel) { | 809 if (this._lazyFrameModel) { |
| 798 if (this._tracingTimelineModel) { | 810 if (this._tracingTimelineModel) { |
| 799 this._lazyFrameModel.reset(); | 811 this._lazyFrameModel.reset(); |
| 800 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.i nspectedTargetEvents(), this._tracingModel.sessionId()); | 812 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.i nspectedTargetEvents(), this._tracingModel.sessionId()); |
| 801 this._overviewPane.update(); | 813 this._overviewPane.update(); |
| 802 } else if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isE nabled()) { | 814 } else if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isE nabled()) { |
| 803 this._lazyFrameModel.reset(); | 815 this._lazyFrameModel.reset(); |
| 804 this._lazyFrameModel.addRecords(this._model.records()); | 816 this._lazyFrameModel.addRecords(this._model.records()); |
| 805 } | 817 } |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1440 * @param {!WebInspector.TimelineModel.Record} record | 1452 * @param {!WebInspector.TimelineModel.Record} record |
| 1441 * @return {boolean} | 1453 * @return {boolean} |
| 1442 */ | 1454 */ |
| 1443 accept: function(record) | 1455 accept: function(record) |
| 1444 { | 1456 { |
| 1445 return !this._hiddenRecords[record.type()]; | 1457 return !this._hiddenRecords[record.type()]; |
| 1446 }, | 1458 }, |
| 1447 | 1459 |
| 1448 __proto__: WebInspector.TimelineModel.Filter.prototype | 1460 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1449 } | 1461 } |
| OLD | NEW |