Commit 90afee75 authored by Francois Doray's avatar Francois Doray Committed by Commit Bot

[freezing] Enable BatteryMetrics on Windows.

BatteryMetrics did not connect to a remote BatteryMonitor due to
a shutdown crash (https://crbug.com/794105). This shutdown issue was
fixed by using SequenceLocalStorageSlot to tear down the
BatteryStatusService on thread thread termination
(https://crrev.com/665919). This CL can therefore safely change the
code to connect to a remote BatteryMonitor on Windows. The immediate
impact is that Power.BatteryPercentDrop will be properly recorded on
Windows. In upcoming CLs, we plan to record more battery metrics on
all platforms.

Bug: 794105, 1026678
Change-Id: Iebd3f32beda2ae487c5b23263ec95e350390b237
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1925130Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717704}
parent ad0fa2f1
......@@ -33,13 +33,10 @@ void BatteryMetrics::StartRecording() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!battery_monitor_.is_bound());
// Don't create a long lived BatteryMonitor on windows. crbug.com/794105.
#if !defined(OS_WIN)
content::GetSystemConnector()->Connect(
service_manager::ServiceFilter::ByName(device::mojom::kServiceName),
battery_monitor_.BindNewPipeAndPassReceiver());
QueryNextStatus();
#endif // !defined(OS_WIN)
}
void BatteryMetrics::DidChange(device::mojom::BatteryStatusPtr battery_status) {
......
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