Commit 1256f171 authored by Henrik Boström's avatar Henrik Boström Committed by Commit Bot

[PeerConnection] ThermalResource disabled by default on non-mac.

Prior to this CL, the kWebRtcThermalResource feature was enabled by
default on all platform, after having been successfully rolled out with
.gcl. However, only on macOS did the thermal resource actually receive
any signal from the OS about thermal states, so on non-mac injecting a
thermal resource into webrtc did not have any observable affects on
adaptation.

In order to support platform-specific rollout of this feature, this CL
changes the default to DISABLED on all platforms except the one we are
confident in: macOS.

We want to do this because in M88, thermal states was implemented on
ChromeOS, and we want to begin a rollout where the default values of
the feature is off.

TBR=guidou@chromium.org

Bug: chromium:1144734
Change-Id: Id1f746013f8a279f5cc4f6b9cd7e48d9a069f70d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2516940Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823541}
parent bf60342a
......@@ -24,6 +24,7 @@
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "build/build_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream_track.h"
......@@ -1285,12 +1286,18 @@ TEST_F(RTCPeerConnectionHandlerTest, CheckInsertableStreamsConfig) {
}
}
TEST_F(RTCPeerConnectionHandlerTest, ThermalResourceIsEnabledByDefault) {
TEST_F(RTCPeerConnectionHandlerTest, ThermalResourceDefaultValue) {
EXPECT_TRUE(mock_peer_connection_->adaptation_resources().IsEmpty());
pc_handler_->OnThermalStateChange(
base::PowerObserver::DeviceThermalState::kCritical);
#if defined(OS_MAC)
bool expect_disabled = false;
#else
bool expect_disabled = true;
#endif
// A ThermalResource is created in response to the thermal signal.
EXPECT_FALSE(mock_peer_connection_->adaptation_resources().IsEmpty());
EXPECT_EQ(mock_peer_connection_->adaptation_resources().IsEmpty(),
expect_disabled);
}
TEST_F(RTCPeerConnectionHandlerTest,
......
......@@ -4,6 +4,7 @@
#include "third_party/blink/renderer/modules/peerconnection/thermal_resource.h"
#include "build/build_config.h"
#include "third_party/webrtc/rtc_base/ref_counted_object.h"
namespace blink {
......@@ -14,8 +15,14 @@ const int kReportIntervalSeconds = 10;
} // namespace
const base::Feature kWebRtcThermalResource{"WebRtcThermalResource",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kWebRtcThermalResource {
"WebRtcThermalResource",
#if defined(OS_MAC)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
// static
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