[Adaptation] Implement ThermalResource.
The ThermalResource reports kOveruse or kUnderuse every 10 seconds while it has a registered listener and the DeviceThermalMeasurement is known. Because OnThermalMeasurement() only happens when the thermal state changes, repeated kOveruse is needed to adapt multiple steps. Based on [1] and manual observations, we do not want to adapt if thermals are kNominal or kFair so we map these to kUnderuse. But if thermals are kSerious or kCritical this is a strong signal from the OS that "corrective action" or "immediate corrective action" is needed. It can easily take a minute before the thermal state changes after load distribution has changed, so the effects of ThermalResource is likely to result in either maximally adapted or not adapted at all. The repeated interval of 10 seconds was somewhat arbitrarily chosen but was chosen as a tradeoff between giving the OS time to measure the new load and not making the resource too spammy. This CL implements and tests the resource, but does not wire it up to the webrtc::PeerConnection or RTCPeerConnectionHandler::OnThermalMeasurement(). This will be done in a separate CL. [1] https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html Bug: chromium:1094844 Change-Id: I7dee0842ba786babbacb7e9d19acb58a1c9daa05 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247769Reviewed-by:Kinuko Yasuda <kinuko@chromium.org> Reviewed-by:
Guido Urdaneta <guidou@chromium.org> Reviewed-by:
Mirko Bonadei <mbonadei@chromium.org> Commit-Queue: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#780189}
Showing
Please register or sign in to comment