Add WEB_RTC_NON_CELLULAR enum, IV

PiperOrigin-RevId: 686408097
This commit is contained in:
Edwin Wu
2024-10-16 01:16:43 -07:00
committed by Copybara-Service
parent 77a75f4389
commit e5f80e9fdc
8 changed files with 143 additions and 39 deletions
+1
View File
@@ -114,6 +114,7 @@ class FeatureFlags {
// from triggering an OutOfMemory error.
std::uint32_t connection_max_frame_length = 1048576;
std::uint32_t blocking_queue_stream_queue_capacity = 10;
bool support_web_rtc_non_cellular_medium = false;
};
static const FeatureFlags& GetInstance() {
+5 -3
View File
@@ -24,6 +24,7 @@
#include "absl/strings/string_view.h"
#include "internal/platform/byte_array.h"
#include "internal/platform/feature_flags.h"
#include "internal/platform/implementation/platform.h"
#include "internal/platform/implementation/webrtc.h"
#include "webrtc/api/peer_connection_interface.h"
@@ -87,9 +88,10 @@ class WebRtcMedium {
// |callback|.
void CreatePeerConnection(webrtc::PeerConnectionObserver* observer,
PeerConnectionCallback callback) {
// TODO(edwinwu): Add a flag to control this and add support for
// non-cellular networks.
if (non_cellular_) {
if (FeatureFlags::GetInstance()
.GetFlags()
.support_web_rtc_non_cellular_medium) {
// TODO(edwinwu): Add support for non-cellular networks.
impl_->CreatePeerConnection(std::nullopt, observer, std::move(callback));
} else {
impl_->CreatePeerConnection(observer, std::move(callback));