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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 } | 323 } |
| 324 this._currentViews = []; | 324 this._currentViews = []; |
| 325 this._stackView.detachChildViews(); | 325 this._stackView.detachChildViews(); |
| 326 }, | 326 }, |
| 327 | 327 |
| 328 _createRecordingOptions: function() | 328 _createRecordingOptions: function() |
| 329 { | 329 { |
| 330 var topPaneSidebarElement = this._topPane.sidebarElement(); | 330 var topPaneSidebarElement = this._topPane.sidebarElement(); |
| 331 | 331 |
| 332 this._captureStacksSetting = WebInspector.settings.createSetting("timeli neCaptureStacks", true); | 332 this._captureStacksSetting = WebInspector.settings.createSetting("timeli neCaptureStacks", true); |
| 333 this._captureStacksCheckbox = document.createElement("input"); | |
|
aandrey
2014/07/03 08:00:49
I'd create an array this._uiControlsCheckboxes, pu
| |
| 333 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSettingC heckbox(WebInspector.UIString("Capture stacks"), | 334 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSettingC heckbox(WebInspector.UIString("Capture stacks"), |
| 334 this._captureStacksSetting, true, unde fined, | 335 this._captureStacksSetting, true, this ._captureStacksCheckbox, |
| 335 WebInspector.UIString("Capture JavaScr ipt stack on every timeline event"))); | 336 WebInspector.UIString("Capture JavaScr ipt stack on every timeline event"))); |
| 336 | 337 |
| 337 this._captureMemorySetting = WebInspector.settings.createSetting("timeli neCaptureMemory", false); | 338 this._captureMemorySetting = WebInspector.settings.createSetting("timeli neCaptureMemory", false); |
| 339 this._captureMemoryCheckbox = document.createElement("input"); | |
| 338 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSettingC heckbox(WebInspector.UIString("Capture memory"), | 340 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSettingC heckbox(WebInspector.UIString("Capture memory"), |
| 339 this._captureMemorySetting, true, unde fined, | 341 this._captureMemorySetting, true, this ._captureMemoryCheckbox, |
| 340 WebInspector.UIString("Capture memory information on every timeline event"))); | 342 WebInspector.UIString("Capture memory information on every timeline event"))); |
| 341 this._captureMemorySetting.addChangeListener(this._onModeChanged, this); | 343 this._captureMemorySetting.addChangeListener(this._onModeChanged, this); |
| 342 | 344 |
| 343 if (Capabilities.canProfilePower) { | 345 if (Capabilities.canProfilePower) { |
| 344 this._capturePowerSetting = WebInspector.settings.createSetting("tim elineCapturePower", false); | 346 this._capturePowerSetting = WebInspector.settings.createSetting("tim elineCapturePower", false); |
| 347 this._capturePowerCheckbox = document.createElement("input"); | |
| 345 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSett ingCheckbox(WebInspector.UIString("Capture power"), | 348 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSett ingCheckbox(WebInspector.UIString("Capture power"), |
| 346 this._capturePowerSetting, true, u ndefined, | 349 this._capturePowerSetting, true, t his._capturePowerCheckbox, |
| 347 WebInspector.UIString("Capture pow er information"))); | 350 WebInspector.UIString("Capture pow er information"))); |
| 348 this._capturePowerSetting.addChangeListener(this._onModeChanged, thi s); | 351 this._capturePowerSetting.addChangeListener(this._onModeChanged, thi s); |
| 349 } | 352 } |
| 350 | 353 |
| 351 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()) { | 354 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()) { |
| 352 this._captureTracingSetting = WebInspector.settings.createSetting("t imelineCaptureTracing", false); | 355 this._captureTracingSetting = WebInspector.settings.createSetting("t imelineCaptureTracing", false); |
| 356 this._captureTracingCheckbox = document.createElement("input"); | |
| 353 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSett ingCheckbox(WebInspector.UIString("Capture tracing"), | 357 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSett ingCheckbox(WebInspector.UIString("Capture tracing"), |
| 354 this._captureTracingSetting, true, undefined, | 358 this._captureTracingSetting, true, this._captureTracingCheckbox, |
| 355 WebInspector.UIString("Capture tra cing information"))); | 359 WebInspector.UIString("Capture tra cing information"))); |
| 356 this._captureTracingSetting.addChangeListener(this._onModeChanged, t his); | 360 this._captureTracingSetting.addChangeListener(this._onModeChanged, t his); |
| 357 } else if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnab led()) { | 361 } else if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnab led()) { |
| 358 this._captureLayersAndPicturesSetting = WebInspector.settings.create Setting("timelineCaptureLayersAndPictures", false); | 362 this._captureLayersAndPicturesSetting = WebInspector.settings.create Setting("timelineCaptureLayersAndPictures", false); |
| 363 this._captureLayersAndPicturesCheckbox = document.createElement("inp ut"); | |
| 359 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSett ingCheckbox(WebInspector.UIString("Capture pictures"), | 364 topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSett ingCheckbox(WebInspector.UIString("Capture pictures"), |
| 360 this._captureLayersAndPicturesSett ing, true, undefined, | 365 this._captureLayersAndPicturesSett ing, true, this._captureLayersAndPicturesCheckbox, |
| 361 WebInspector.UIString("Capture gra phics layer positions and painted pictures"))); | 366 WebInspector.UIString("Capture gra phics layer positions and painted pictures"))); |
| 362 } | 367 } |
| 363 }, | 368 }, |
| 364 | 369 |
| 365 _createStatusBarItems: function() | 370 _createStatusBarItems: function() |
| 366 { | 371 { |
| 367 var panelStatusBarElement = this.element.createChild("div", "panel-statu s-bar"); | 372 var panelStatusBarElement = this.element.createChild("div", "panel-statu s-bar"); |
| 368 this._statusBarButtons = /** @type {!Array.<!WebInspector.StatusBarItem> } */ ([]); | 373 this._statusBarButtons = /** @type {!Array.<!WebInspector.StatusBarItem> } */ ([]); |
| 369 | 374 |
| 370 this.toggleTimelineButton = new WebInspector.StatusBarButton("", "record -profile-status-bar-item"); | 375 this.toggleTimelineButton = new WebInspector.StatusBarButton("", "record -profile-status-bar-item"); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 658 | 663 |
| 659 this._timelineView().setFrameModel(isFrameMode ? this._frameModel() : nu ll); | 664 this._timelineView().setFrameModel(isFrameMode ? this._frameModel() : nu ll); |
| 660 this._overviewPane.setOverviewControls(this._overviewControls); | 665 this._overviewPane.setOverviewControls(this._overviewControls); |
| 661 this.doResize(); | 666 this.doResize(); |
| 662 this._updateSelectedRangeStats(); | 667 this._updateSelectedRangeStats(); |
| 663 | 668 |
| 664 this._stackView.show(this._searchableView.element); | 669 this._stackView.show(this._searchableView.element); |
| 665 }, | 670 }, |
| 666 | 671 |
| 667 /** | 672 /** |
| 673 * @param {boolean} disabled | |
| 674 */ | |
| 675 _disableUIControls: function(disabled) { | |
| 676 this._captureStacksCheckbox.disabled = disabled; | |
| 677 this._captureMemoryCheckbox.disabled = disabled; | |
| 678 if (Capabilities.canProfilePower) | |
| 679 this._capturePowerCheckbox.disabled = disabled; | |
| 680 | |
| 681 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()) { | |
| 682 this._captureTracingCheckbox.disabled = disabled; | |
| 683 } else if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnab led()) { | |
| 684 this._captureLayersAndPicturesCheckbox.disabled = disabled; | |
| 685 } | |
| 686 WebInspector.inspectorView.setCurrentPanelLocked(disabled); | |
| 687 }, | |
| 688 | |
| 689 /** | |
| 668 * @param {boolean} userInitiated | 690 * @param {boolean} userInitiated |
| 669 */ | 691 */ |
| 670 _startRecording: function(userInitiated) | 692 _startRecording: function(userInitiated) |
| 671 { | 693 { |
| 672 this._userInitiatedRecording = userInitiated; | 694 this._userInitiatedRecording = userInitiated; |
| 673 this._model.startRecording(this._captureStacksSetting.get(), this._captu reMemorySetting.get(), this._captureLayersAndPicturesSetting && this._captureLay ersAndPicturesSetting.get()); | 695 this._model.startRecording(this._captureStacksSetting.get(), this._captu reMemorySetting.get(), this._captureLayersAndPicturesSetting && this._captureLay ersAndPicturesSetting.get()); |
| 674 if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled() && this._lazyFrameModel) | 696 if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled() && this._lazyFrameModel) |
| 675 this._lazyFrameModel.setMergeRecords(false); | 697 this._lazyFrameModel.setMergeRecords(false); |
| 676 | 698 |
| 677 for (var i = 0; i < this._overviewControls.length; ++i) | 699 for (var i = 0; i < this._overviewControls.length; ++i) |
| 678 this._overviewControls[i].timelineStarted(); | 700 this._overviewControls[i].timelineStarted(); |
| 679 | 701 |
| 680 if (userInitiated) | 702 if (userInitiated) |
| 681 WebInspector.userMetrics.TimelineStarted.record(); | 703 WebInspector.userMetrics.TimelineStarted.record(); |
| 682 WebInspector.inspectorView.setCurrentPanelLocked(true); | 704 this._disableUIControls(true); |
| 683 }, | 705 }, |
| 684 | 706 |
| 685 _stopRecording: function() | 707 _stopRecording: function() |
| 686 { | 708 { |
| 687 this._stopPending = true; | 709 this._stopPending = true; |
| 688 this._updateToggleTimelineButton(false); | 710 this._updateToggleTimelineButton(false); |
| 689 this._userInitiatedRecording = false; | 711 this._userInitiatedRecording = false; |
| 690 this._model.stopRecording(); | 712 this._model.stopRecording(); |
| 691 if (this._progressElement) | 713 if (this._progressElement) |
| 692 this._updateProgress(WebInspector.UIString("Retrieving events\u2026" )); | 714 this._updateProgress(WebInspector.UIString("Retrieving events\u2026" )); |
| 693 | 715 |
| 694 for (var i = 0; i < this._overviewControls.length; ++i) | 716 for (var i = 0; i < this._overviewControls.length; ++i) |
| 695 this._overviewControls[i].timelineStopped(); | 717 this._overviewControls[i].timelineStopped(); |
| 696 WebInspector.inspectorView.setCurrentPanelLocked(false); | 718 this._disableUIControls(false); |
| 697 }, | 719 }, |
| 698 | 720 |
| 699 _onProfilingStateChanged: function() | 721 _onProfilingStateChanged: function() |
| 700 { | 722 { |
| 701 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); | 723 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); |
| 702 }, | 724 }, |
| 703 | 725 |
| 704 /** | 726 /** |
| 705 * @param {boolean} toggled | 727 * @param {boolean} toggled |
| 706 */ | 728 */ |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1445 * @param {!WebInspector.TimelineModel.Record} record | 1467 * @param {!WebInspector.TimelineModel.Record} record |
| 1446 * @return {boolean} | 1468 * @return {boolean} |
| 1447 */ | 1469 */ |
| 1448 accept: function(record) | 1470 accept: function(record) |
| 1449 { | 1471 { |
| 1450 return !this._regex || this._uiUtils.testContentMatching(record, this._r egex); | 1472 return !this._regex || this._uiUtils.testContentMatching(record, this._r egex); |
| 1451 }, | 1473 }, |
| 1452 | 1474 |
| 1453 __proto__: WebInspector.TimelineModel.Filter.prototype | 1475 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1454 } | 1476 } |
| OLD | NEW |