Commit 6fe15aee authored by Henrik Boström's avatar Henrik Boström Committed by Commit Bot

[WebRTC] Make ThermalResource ENABLED_BY_DEFAULT.

This feature has now rolled out to stable, so we change the default of
the feature to enabled, allowing us to remove the .gcl file when M87 is
promoted to Stable.

Because serious/critical thermal signals are so rare (<1% of macOS
population) and the impact of this resource is little-to-none, an
alternative would be to simply delete the ThermalResource.

However, by keeping the code, if the macOS signal is improved in a
future release or if the thermal resource becomes available on more
platforms (there are WIP CLs on Android and ChromeOS) then having the
ThermalResource will automatically make use of these signals. And by
having the base::Feature still in here, if changes to OS signals were
to cause any regressions, we can use it as a kill-switch.

// TBR in place of Evan's +1 (he's not a committer yet).
TBR=guidou@chromium.org

Bug: chromium:1100336
Change-Id: I03a2a765bd4b8cbbca5a9b618c71d7214b830ce6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2418335Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Commit-Queue: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808843}
parent 956382b6
...@@ -1286,11 +1286,24 @@ TEST_F(RTCPeerConnectionHandlerTest, CheckInsertableStreamsConfig) { ...@@ -1286,11 +1286,24 @@ TEST_F(RTCPeerConnectionHandlerTest, CheckInsertableStreamsConfig) {
} }
} }
TEST_F(RTCPeerConnectionHandlerTest, ThermalResourceIsDisabledByDefault) { TEST_F(RTCPeerConnectionHandlerTest, ThermalResourceIsEnabledByDefault) {
EXPECT_TRUE(mock_peer_connection_->adaptation_resources().IsEmpty()); EXPECT_TRUE(mock_peer_connection_->adaptation_resources().IsEmpty());
pc_handler_->OnThermalStateChange( pc_handler_->OnThermalStateChange(
base::PowerObserver::DeviceThermalState::kCritical); base::PowerObserver::DeviceThermalState::kCritical);
// A ThermalResource is not created despite the thermal signal. // A ThermalResource is created in response to the thermal signal.
EXPECT_FALSE(mock_peer_connection_->adaptation_resources().IsEmpty());
}
TEST_F(RTCPeerConnectionHandlerTest,
ThermalStateChangeDoesNothingIfThermalResourceIsDisabled) {
// Overwrite base::Feature kWebRtcThermalResource's default to DISABLED.
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(kWebRtcThermalResource);
EXPECT_TRUE(mock_peer_connection_->adaptation_resources().IsEmpty());
pc_handler_->OnThermalStateChange(
base::PowerObserver::DeviceThermalState::kCritical);
// A ThermalResource is created in response to the thermal signal.
EXPECT_TRUE(mock_peer_connection_->adaptation_resources().IsEmpty()); EXPECT_TRUE(mock_peer_connection_->adaptation_resources().IsEmpty());
} }
......
...@@ -15,7 +15,7 @@ const int kReportIntervalSeconds = 10; ...@@ -15,7 +15,7 @@ const int kReportIntervalSeconds = 10;
} // namespace } // namespace
const base::Feature kWebRtcThermalResource{"WebRtcThermalResource", const base::Feature kWebRtcThermalResource{"WebRtcThermalResource",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// static // static
scoped_refptr<ThermalResource> ThermalResource::Create( scoped_refptr<ThermalResource> ThermalResource::Create(
......
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