4afa9ce255aba717121e16425bde1bb9096708d0 - chromium/src

1,843 views
Skip to first unread message

bruce...@chromium.org

unread,
Mar 1, 2022, 7:04:01 PM3/1/22
to chromium...@chromium.org
commit 4afa9ce255aba717121e16425bde1bb9096708d0
Author: Bruce Dawson <bruce...@chromium.org>
AuthorDate: Wed Mar 02 00:02:45 2022
Commit: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
CommitDate: Wed Mar 02 00:02:45 2022

Remove inappropriate NOTIMPLEMENTED

There are six different implementations of
PowerMonitorDeviceSource::IsOnBatteryPower, depending on platform. The
one in power_monitor_device_source_stub.cc does nothing, but it is the
implementation for (as far as I can tell) both Linux and Fuchsia.
There doesn't seem to be a bug tracking plans to implement it and the
output it generates shows up as an error on many tests, like this:

...:ERROR:power_monitor_device_source_stub.cc(11)] Not implemented
reached in virtual bool
base::PowerMonitorDeviceSource::IsOnBatteryPower()

It's been doing this since around 2013 so I think it's time to call this
the implementation and reduce the misleading :ERROR: output, to avoid
wasting developer time when tracking down other issues such as
https://crbug.com/1296147

Change-Id: If18a1a1219289ed0ba9905dccbc27a8bd2aec6fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489921
Reviewed-by: danakj <dan...@chromium.org>
Commit-Queue: Bruce Dawson <bruce...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#976476}

diff --git a/base/power_monitor/power_monitor_device_source_stub.cc b/base/power_monitor/power_monitor_device_source_stub.cc
index 96a9ffd..8aeadc9 100644
--- a/base/power_monitor/power_monitor_device_source_stub.cc
+++ b/base/power_monitor/power_monitor_device_source_stub.cc
@@ -8,7 +8,6 @@
namespace base {

bool PowerMonitorDeviceSource::IsOnBatteryPower() {
- NOTIMPLEMENTED();
return false;
}

diff --git a/base/power_monitor/power_monitor_source.h b/base/power_monitor/power_monitor_source.h
index 891dcb6..40f6e5c 100644
--- a/base/power_monitor/power_monitor_source.h
+++ b/base/power_monitor/power_monitor_source.h
@@ -36,8 +36,8 @@

// Reads the initial operating system CPU speed limit, if available on the
// platform. Otherwise returns PowerThermalObserver::kSpeedLimitMax.
- // Only called on the main thead in PowerMonitor::Initialize().
- // The actual speed limit value will be updated asynchronosulsy via the
+ // Only called on the main thread in PowerMonitor::Initialize().
+ // The actual speed limit value will be updated asynchronously via the
// ProcessSpeedLimitEvent() if/when the value changes.
virtual int GetInitialSpeedLimit();

Reply all
Reply to author
Forward
0 new messages