Skip to content

Commit

Permalink
Remove inappropriate NOTIMPLEMENTED
Browse files Browse the repository at this point in the history
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 <danakj@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#976476}
  • Loading branch information
randomascii authored and Chromium LUCI CQ committed Mar 2, 2022
1 parent 7c22988 commit 4afa9ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion base/power_monitor/power_monitor_device_source_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
namespace base {

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

Expand Down
4 changes: 2 additions & 2 deletions base/power_monitor/power_monitor_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class BASE_EXPORT PowerMonitorSource {

// 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();

Expand Down

0 comments on commit 4afa9ce

Please sign in to comment.