Remove runtime_enabled_feature.
This features is not needed anymore, with this CL it is also possible
to address two issues:
- The need to pick a default implementation.
- The need to use -Wno-global-constructors.
Bug: webrtc:9631, webrtc:9693
Change-Id: Id3daf34179fbc8db26969fc701ccbfa7182c6a9b
Reviewed-on: https://webrtc-review.googlesource.com/102543
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24904}
diff --git a/BUILD.gn b/BUILD.gn
index f3aae92..b1fc7b4 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -471,7 +471,6 @@
"rtc_base:sigslot_unittest",
"rtc_base:weak_ptr_unittests",
"rtc_base/experiments:experiments_unittests",
- "system_wrappers:runtime_enabled_features_default",
]
if (rtc_enable_protobuf) {
diff --git a/call/BUILD.gn b/call/BUILD.gn
index e359995..724c49b 100644
--- a/call/BUILD.gn
+++ b/call/BUILD.gn
@@ -385,7 +385,6 @@
"../rtc_base:rtc_base_approved",
"../system_wrappers",
"../system_wrappers:metrics",
- "../system_wrappers:runtime_enabled_features_default",
"../test:direct_transport",
"../test:fake_video_codecs",
"../test:field_trial",
diff --git a/examples/BUILD.gn b/examples/BUILD.gn
index 09a0c0b..43d1dfe 100644
--- a/examples/BUILD.gn
+++ b/examples/BUILD.gn
@@ -220,12 +220,10 @@
# iOS must use WebRTC.framework which is dynamically linked.
deps = [
"../sdk:framework_objc+link",
- "../system_wrappers:runtime_enabled_features_default",
]
} else {
deps = [
"../sdk:mac_framework_objc+link",
- "../system_wrappers:runtime_enabled_features_default",
]
}
}
@@ -494,7 +492,6 @@
"../sdk:ui_objc",
"../sdk:videocapture_objc",
"../sdk:videotoolbox_objc",
- "../system_wrappers:runtime_enabled_features_default",
"//third_party/abseil-cpp/absl/memory",
]
@@ -705,7 +702,6 @@
"../rtc_base:rtc_base",
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_json",
- "../system_wrappers:runtime_enabled_features_default",
"//third_party/libyuv",
]
}
@@ -742,7 +738,6 @@
"../pc:rtc_pc",
"../rtc_base:rtc_base",
"../rtc_base:rtc_base_approved",
- "../system_wrappers:runtime_enabled_features_default",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
@@ -759,7 +754,6 @@
"../pc:rtc_pc",
"../rtc_base:rtc_base",
"../rtc_base:rtc_base_approved",
- "../system_wrappers:runtime_enabled_features_default",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
@@ -776,7 +770,6 @@
"../pc:rtc_pc",
"../rtc_base:rtc_base",
"../rtc_base:rtc_base_approved",
- "../system_wrappers:runtime_enabled_features_default",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
@@ -827,7 +820,6 @@
"../modules/video_capture:video_capture_module",
"../pc:libjingle_peerconnection",
"../rtc_base:rtc_base",
- "../system_wrappers:runtime_enabled_features_default",
"//third_party/abseil-cpp/absl/memory",
]
if (is_android) {
diff --git a/examples/androidnativeapi/BUILD.gn b/examples/androidnativeapi/BUILD.gn
index b76b544..5568eb1 100644
--- a/examples/androidnativeapi/BUILD.gn
+++ b/examples/androidnativeapi/BUILD.gn
@@ -60,7 +60,6 @@
"//sdk/android:native_api_base",
"//sdk/android:native_api_jni",
"//sdk/android:native_api_video",
- "//system_wrappers:runtime_enabled_features_default",
"//third_party/abseil-cpp/absl/memory",
]
}
diff --git a/media/BUILD.gn b/media/BUILD.gn
index 2f01620..1ec81fc 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -592,7 +592,6 @@
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_main",
"../rtc_base:rtc_base_tests_utils",
- "../system_wrappers:runtime_enabled_features_default",
"../test:audio_codec_mocks",
"../test:test_support",
"../test:video_test_common",
diff --git a/modules/congestion_controller/BUILD.gn b/modules/congestion_controller/BUILD.gn
index ab3ca83..2fcb712 100644
--- a/modules/congestion_controller/BUILD.gn
+++ b/modules/congestion_controller/BUILD.gn
@@ -45,7 +45,6 @@
"../../rtc_base:rate_limiter",
"../../system_wrappers",
"../../system_wrappers:field_trial",
- "../../system_wrappers:runtime_enabled_features_api",
"../bitrate_controller",
"../pacing",
"../remote_bitrate_estimator",
diff --git a/modules/congestion_controller/rtp/BUILD.gn b/modules/congestion_controller/rtp/BUILD.gn
index f7447d2..134fb94 100644
--- a/modules/congestion_controller/rtp/BUILD.gn
+++ b/modules/congestion_controller/rtp/BUILD.gn
@@ -45,7 +45,6 @@
"../../../rtc_base/experiments:congestion_controller_experiment",
"../../../system_wrappers",
"../../../system_wrappers:field_trial",
- "../../../system_wrappers:runtime_enabled_features_api",
"../../pacing",
"../../remote_bitrate_estimator",
"../../rtp_rtcp:rtp_rtcp_format",
diff --git a/modules/pacing/BUILD.gn b/modules/pacing/BUILD.gn
index 5039ffa..a53086f 100644
--- a/modules/pacing/BUILD.gn
+++ b/modules/pacing/BUILD.gn
@@ -34,7 +34,6 @@
"../../rtc_base/experiments:alr_experiment",
"../../system_wrappers",
"../../system_wrappers:field_trial",
- "../../system_wrappers:runtime_enabled_features_api",
"../congestion_controller/goog_cc:alr_detector",
"../remote_bitrate_estimator",
"../rtp_rtcp",
@@ -77,7 +76,6 @@
"../../rtc_base/experiments:alr_experiment",
"../../system_wrappers",
"../../system_wrappers:field_trial",
- "../../system_wrappers:runtime_enabled_features_api",
"../../test:field_trial",
"../../test:test_support",
"../rtp_rtcp",
diff --git a/ortc/BUILD.gn b/ortc/BUILD.gn
index b9bedd0..b65165a 100644
--- a/ortc/BUILD.gn
+++ b/ortc/BUILD.gn
@@ -94,7 +94,6 @@
"../rtc_base:rtc_base_tests_main",
"../rtc_base:rtc_base_tests_utils",
"../rtc_base/system:arch",
- "../system_wrappers:runtime_enabled_features_default",
]
if (!build_with_chromium && is_clang) {
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index c5659d1..3ad3340 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -331,7 +331,6 @@
"../rtc_base:rtc_base_tests_utils",
"../rtc_base/third_party/sigslot",
"../system_wrappers:metrics",
- "../system_wrappers:runtime_enabled_features_default",
"../test:test_support",
"//third_party/abseil-cpp/absl/memory",
]
@@ -542,7 +541,6 @@
"../rtc_base:rtc_base_tests_utils",
"../rtc_base:rtc_task_queue",
"../rtc_base:safe_conversions",
- "../system_wrappers:runtime_enabled_features_default",
"../test:audio_codec_mocks",
"../test:test_support",
"//third_party/abseil-cpp/absl/types:optional",
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index 9a04322..3d624c7 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -1308,7 +1308,6 @@
":videocodec_objc",
":videotoolbox_objc",
"../rtc_base:rtc_base_approved",
- "../system_wrappers:runtime_enabled_features_default",
]
if (rtc_use_metal_rendering) {
deps += [ ":metal_objc" ]
@@ -1448,7 +1447,6 @@
":videocodec_objc",
":videotoolbox_objc",
"../rtc_base:rtc_base_approved",
- "../system_wrappers:runtime_enabled_features_default",
]
if (rtc_use_metal_rendering) {
deps += [ ":metal_objc" ]
diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn
index 23db512..76ba9a6 100644
--- a/sdk/android/BUILD.gn
+++ b/sdk/android/BUILD.gn
@@ -134,7 +134,6 @@
":peerconnection_jni",
"../../pc:peerconnection",
"../../system_wrappers:metrics",
- "../../system_wrappers:runtime_enabled_features_default",
]
}
diff --git a/system_wrappers/BUILD.gn b/system_wrappers/BUILD.gn
index a237576..ef10fc59 100644
--- a/system_wrappers/BUILD.gn
+++ b/system_wrappers/BUILD.gn
@@ -33,7 +33,6 @@
libs = []
deps = [
":cpu_features_api",
- ":runtime_enabled_features_api",
"..:webrtc_common",
"../modules:module_api_public",
"../rtc_base:checks",
@@ -108,25 +107,6 @@
}
}
-rtc_source_set("runtime_enabled_features_api") {
- visibility = [ "*" ]
- sources = [
- "include/runtime_enabled_features.h",
- ]
-}
-
-rtc_source_set("runtime_enabled_features_default") {
- visibility = [ "*" ]
- configs += [ "..:no_global_constructors" ]
- sources = [
- "source/runtime_enabled_features_default.cc",
- ]
- deps = [
- ":runtime_enabled_features_api",
- "../rtc_base:rtc_base_approved",
- ]
-}
-
rtc_source_set("metrics") {
visibility = [ "*" ]
public = [
@@ -147,7 +127,6 @@
group("system_wrappers_default") {
deps = [
- ":runtime_enabled_features_default",
":system_wrappers",
]
}
diff --git a/system_wrappers/include/runtime_enabled_features.h b/system_wrappers/include/runtime_enabled_features.h
deleted file mode 100644
index 9ccbedc..0000000
--- a/system_wrappers/include/runtime_enabled_features.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-#ifndef SYSTEM_WRAPPERS_INCLUDE_RUNTIME_ENABLED_FEATURES_H_
-#define SYSTEM_WRAPPERS_INCLUDE_RUNTIME_ENABLED_FEATURES_H_
-
-#include <string>
-
-// These functions for querying enabled runtime features must be implemented
-// by all webrtc clients (such as Chrome).
-// Default implementation is provided in:
-//
-// system_wrappers/system_wrappers:runtime_enabled_features_default
-
-// TODO(ilnik): Find a more flexible way to use Chrome features.
-// This interface requires manual translation from feature name to
-// Chrome feature class in third_party/webrtc_overrides.
-
-namespace webrtc {
-namespace runtime_enabled_features {
-
-const char kDualStreamModeFeatureName[] = "WebRtcDualStreamMode";
-
-bool IsFeatureEnabled(std::string feature_name);
-
-} // namespace runtime_enabled_features
-} // namespace webrtc
-
-#endif // SYSTEM_WRAPPERS_INCLUDE_RUNTIME_ENABLED_FEATURES_H_
diff --git a/system_wrappers/source/runtime_enabled_features_default.cc b/system_wrappers/source/runtime_enabled_features_default.cc
deleted file mode 100644
index 1d040a9..0000000
--- a/system_wrappers/source/runtime_enabled_features_default.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "system_wrappers/include/runtime_enabled_features.h"
-
-#include "rtc_base/flags.h"
-
-namespace flags {
-DEFINE_bool(enable_dual_stream_mode, false, "Enables dual video stream mode.");
-}
-
-namespace webrtc {
-namespace runtime_enabled_features {
-
-bool IsFeatureEnabled(std::string feature_name) {
- if (feature_name == kDualStreamModeFeatureName)
- return flags::FLAG_enable_dual_stream_mode;
- return false;
-}
-
-} // namespace runtime_enabled_features
-} // namespace webrtc
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 7456365..0daae3f 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -212,7 +212,6 @@
"../rtc_base:rtc_base",
"../system_wrappers:field_trial",
"../system_wrappers:metrics",
- "../system_wrappers:runtime_enabled_features_default",
"//testing/gtest",
]
}
@@ -615,7 +614,6 @@
"../rtc_base/experiments:congestion_controller_experiment",
"../system_wrappers",
"../system_wrappers:field_trial",
- "../system_wrappers:runtime_enabled_features_api",
"../video",
"//testing/gtest",
"//third_party/abseil-cpp/absl/memory",
diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn
index 634cefb..aafe2d9 100644
--- a/test/fuzzers/BUILD.gn
+++ b/test/fuzzers/BUILD.gn
@@ -16,7 +16,6 @@
]
deps = [
"../../rtc_base:rtc_base_approved",
- "../../system_wrappers:runtime_enabled_features_default",
"//testing/libfuzzer:libfuzzer_main",
]
diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn
index ef98b71..3703aa8 100644
--- a/test/scenario/BUILD.gn
+++ b/test/scenario/BUILD.gn
@@ -86,7 +86,6 @@
"../../rtc_base:stringutils",
"../../system_wrappers",
"../../system_wrappers:field_trial",
- "../../system_wrappers:runtime_enabled_features_api",
"../../video",
"//third_party/abseil-cpp/absl/types:optional",
]
diff --git a/video/BUILD.gn b/video/BUILD.gn
index 6dd596c..ecce1ec 100644
--- a/video/BUILD.gn
+++ b/video/BUILD.gn
@@ -284,7 +284,6 @@
"../rtc_base:logging",
"../rtc_base:rtc_base_approved",
"../system_wrappers:field_trial",
- "../system_wrappers:runtime_enabled_features_default",
"../test:field_trial",
"../test:run_test",
"../test:run_test_interface",
@@ -310,7 +309,6 @@
"../rtc_base:logging",
"../rtc_base:rtc_base_approved",
"../system_wrappers:field_trial",
- "../system_wrappers:runtime_enabled_features_default",
"../test:field_trial",
"../test:run_test",
"../test:run_test_interface",
@@ -335,7 +333,6 @@
"../rtc_base:logging",
"../rtc_base:rtc_base_approved",
"../system_wrappers:field_trial",
- "../system_wrappers:runtime_enabled_features_default",
"../test:field_trial",
"../test:run_test",
"../test:run_test_interface",
@@ -367,7 +364,6 @@
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_json",
"../system_wrappers",
- "../system_wrappers:runtime_enabled_features_default",
"../test:fake_video_codecs",
"../test:rtp_test_utils",
"../test:run_test",
diff --git a/webrtc.gni b/webrtc.gni
index dc0c7b5..6ecf859 100644
--- a/webrtc.gni
+++ b/webrtc.gni
@@ -54,22 +54,6 @@
# provided.
rtc_exclude_metrics_default = build_with_chromium
- # WARNING: This argument doesn't have any effect on the WebRTC build until
- # https://webrtc-review.googlesource.com/c/src/+/100640 will land.
- # Setting this to true will define
- # WEBRTC_EXCLUDE_RUNTIME_ENABLED_FEATURES_DEFAULT which will tell the
- # pre-processor to remove the default definition of symbols needed to use
- # runtime_enabled_features. In that case a new implementation needs to be
- # provided.
- if (build_with_chromium) {
- # When WebRTC is built as part of Chromium it should exclude the default
- # implementation of runtime_enabled_features unless it is building for NACL or
- # Chromecast.
- rtc_exclude_runtime_enabled_features_default = !is_nacl && !is_chromecast
- } else {
- rtc_exclude_runtime_enabled_features_default = false
- }
-
# Setting this to false will require the API user to pass in their own
# SSLCertificateVerifier to verify the certificates presented from a
# TLS-TURN server. In return disabling this saves around 100kb in the binary.