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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 flameChartToggleButton.addEventListener("click", this._flameChartEna
bledChanged.bind(this, flameChartToggleButton)); | 344 flameChartToggleButton.addEventListener("click", this._flameChartEna
bledChanged.bind(this, flameChartToggleButton)); |
345 this._statusBarButtons.push(flameChartToggleButton); | 345 this._statusBarButtons.push(flameChartToggleButton); |
346 panelStatusBarElement.appendChild(flameChartToggleButton.element); | 346 panelStatusBarElement.appendChild(flameChartToggleButton.element); |
347 } | 347 } |
348 | 348 |
349 this._captureCausesSetting = WebInspector.settings.createSetting("timeli
neCaptureCauses", true); | 349 this._captureCausesSetting = WebInspector.settings.createSetting("timeli
neCaptureCauses", true); |
350 this._captureCausesSetting.addChangeListener(this._refreshViews, this); | 350 this._captureCausesSetting.addChangeListener(this._refreshViews, this); |
351 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect
or.UIString("Causes"), | 351 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect
or.UIString("Causes"), |
352 this._capt
ureCausesSetting, | 352 this._capt
ureCausesSetting, |
353 WebInspect
or.UIString("Capture causes for timeline events (e.g., stack traces)"))); | 353 WebInspect
or.UIString("Capture causes for timeline events (e.g., stack traces)"))); |
| 354 if (Runtime.experiments.isEnabled("timelineJSCPUProfile")) { |
| 355 this._enableJSSamplingSettingSetting = WebInspector.settings.createS
etting("timelineEnableJSSampling", false); |
| 356 this._enableJSSamplingSettingSetting.addChangeListener(this._refresh
Views, this); |
| 357 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns
pector.UIString("Sampling"), |
| 358 this._
enableJSSamplingSettingSetting, |
| 359 WebIns
pector.UIString("Enable JavaScript sampling profiler"))); |
| 360 } |
354 this._captureMemorySetting = WebInspector.settings.createSetting("timeli
neCaptureMemory", false); | 361 this._captureMemorySetting = WebInspector.settings.createSetting("timeli
neCaptureMemory", false); |
355 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect
or.UIString("Memory"), | 362 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect
or.UIString("Memory"), |
356 this._capt
ureMemorySetting, | 363 this._capt
ureMemorySetting, |
357 WebInspect
or.UIString("Capture memory information on every timeline event"))); | 364 WebInspect
or.UIString("Capture memory information on every timeline event"))); |
358 this._captureMemorySetting.addChangeListener(this._onModeChanged, this); | 365 this._captureMemorySetting.addChangeListener(this._onModeChanged, this); |
359 if (Runtime.experiments.isEnabled("timelinePowerProfiler") && | 366 if (Runtime.experiments.isEnabled("timelinePowerProfiler") && |
360 WebInspector.targetManager.mainTarget().hasCapability(WebInspector.T
arget.Capabilities.CanProfilePower)) { | 367 WebInspector.targetManager.mainTarget().hasCapability(WebInspector.T
arget.Capabilities.CanProfilePower)) { |
361 this._capturePowerSetting = WebInspector.settings.createSetting("tim
elineCapturePower", false); | 368 this._capturePowerSetting = WebInspector.settings.createSetting("tim
elineCapturePower", false); |
362 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns
pector.UIString("Power"), | 369 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns
pector.UIString("Power"), |
363 this._
capturePowerSetting, | 370 this._
capturePowerSetting, |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 this._recordingOptionUIControls.forEach(handler); | 638 this._recordingOptionUIControls.forEach(handler); |
632 WebInspector.inspectorView.setCurrentPanelLocked(!enabled); | 639 WebInspector.inspectorView.setCurrentPanelLocked(!enabled); |
633 }, | 640 }, |
634 | 641 |
635 /** | 642 /** |
636 * @param {boolean} userInitiated | 643 * @param {boolean} userInitiated |
637 */ | 644 */ |
638 _startRecording: function(userInitiated) | 645 _startRecording: function(userInitiated) |
639 { | 646 { |
640 this._userInitiatedRecording = userInitiated; | 647 this._userInitiatedRecording = userInitiated; |
641 this._model.startRecording(this._captureCausesSetting.get(), this._captu
reMemorySetting.get(), this._captureLayersAndPicturesSetting && this._captureLay
ersAndPicturesSetting.get()); | 648 var enableJSSampling = this._enableJSSamplingSettingSetting && this._ena
bleJSSamplingSettingSetting.get(); |
| 649 this._model.startRecording(this._captureCausesSetting.get(), enableJSSam
pling, this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting &
& this._captureLayersAndPicturesSetting.get()); |
642 if (this._lazyFrameModel) | 650 if (this._lazyFrameModel) |
643 this._lazyFrameModel.setMergeRecords(false); | 651 this._lazyFrameModel.setMergeRecords(false); |
644 | 652 |
645 for (var i = 0; i < this._overviewControls.length; ++i) | 653 for (var i = 0; i < this._overviewControls.length; ++i) |
646 this._overviewControls[i].timelineStarted(); | 654 this._overviewControls[i].timelineStarted(); |
647 | 655 |
648 if (userInitiated) | 656 if (userInitiated) |
649 WebInspector.userMetrics.TimelineStarted.record(); | 657 WebInspector.userMetrics.TimelineStarted.record(); |
650 this._setUIControlsEnabled(false); | 658 this._setUIControlsEnabled(false); |
651 }, | 659 }, |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 | 1463 |
1456 WebInspector.TimelinePanelFactory.prototype = { | 1464 WebInspector.TimelinePanelFactory.prototype = { |
1457 /** | 1465 /** |
1458 * @return {!WebInspector.Panel} | 1466 * @return {!WebInspector.Panel} |
1459 */ | 1467 */ |
1460 createPanel: function() | 1468 createPanel: function() |
1461 { | 1469 { |
1462 return WebInspector.TimelinePanel._instance(); | 1470 return WebInspector.TimelinePanel._instance(); |
1463 } | 1471 } |
1464 } | 1472 } |
OLD | NEW |