Commit 05ea6651 authored by vivek.vg@samsung.com's avatar vivek.vg@samsung.com

Power profiler should check for the capability CanProfilePower

The patch [1] removed the global capabilities set. The power profiler depends on whether
there exists a power service and it has a valid data provider. If these are met, only then
the devtools can do power profiling.

The checkbox "Power" should only be visible if the capability exists. Restoring the required
checks.

[1] https://codereview.chromium.org/388963004

Review URL: https://codereview.chromium.org/463853002

git-svn-id: svn://svn.chromium.org/blink/trunk@180058 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 81986923
...@@ -371,7 +371,8 @@ WebInspector.TimelinePanel.prototype = { ...@@ -371,7 +371,8 @@ WebInspector.TimelinePanel.prototype = {
this._captureMemorySetting, this._captureMemorySetting,
WebInspector.UIString("Capture memory information on every timeline event"))); WebInspector.UIString("Capture memory information on every timeline event")));
this._captureMemorySetting.addChangeListener(this._onModeChanged, this); this._captureMemorySetting.addChangeListener(this._onModeChanged, this);
if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled()) { if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled() &&
WebInspector.targetManager.mainTarget().hasCapability(WebInspector.Target.Capabilities.CanProfilePower)) {
this._capturePowerSetting = WebInspector.settings.createSetting("timelineCapturePower", false); this._capturePowerSetting = WebInspector.settings.createSetting("timelineCapturePower", false);
panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspector.UIString("Power"), panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspector.UIString("Power"),
this._capturePowerSetting, this._capturePowerSetting,
...@@ -612,7 +613,8 @@ WebInspector.TimelinePanel.prototype = { ...@@ -612,7 +613,8 @@ WebInspector.TimelinePanel.prototype = {
this._addModeView(new WebInspector.MemoryCountersGraph(this, this._model, this._uiUtils)); this._addModeView(new WebInspector.MemoryCountersGraph(this, this._model, this._uiUtils));
} }
if (this._capturePowerSetting && this._capturePowerSetting.get()) { if (this._capturePowerSetting && this._capturePowerSetting.get() &&
WebInspector.targetManager.mainTarget().hasCapability(WebInspector.Target.Capabilities.CanProfilePower)) {
if (!isFrameMode) // Frame mode skews time, don't render aux overviews. if (!isFrameMode) // Frame mode skews time, don't render aux overviews.
this._overviewControls.push(new WebInspector.TimelinePowerOverview(this._model)); this._overviewControls.push(new WebInspector.TimelinePowerOverview(this._model));
this._addModeView(new WebInspector.TimelinePowerGraph(this, this._model)); this._addModeView(new WebInspector.TimelinePowerGraph(this, this._model));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment