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}
This commit is contained in:
parent
ba5eaee9a2
commit
e0d455b409
1
BUILD.gn
1
BUILD.gn
@ -471,7 +471,6 @@ if (rtc_include_tests) {
|
||||
"rtc_base:sigslot_unittest",
|
||||
"rtc_base:weak_ptr_unittests",
|
||||
"rtc_base/experiments:experiments_unittests",
|
||||
"system_wrappers:runtime_enabled_features_default",
|
||||
]
|
||||
|
||||
if (rtc_enable_protobuf) {
|
||||
|
||||
@ -385,7 +385,6 @@ if (rtc_include_tests) {
|
||||
"../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",
|
||||
|
||||
@ -220,12 +220,10 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
|
||||
# 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 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
|
||||
"../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 @@ if (is_linux || is_win) {
|
||||
"../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 @@ if (is_linux || is_win) {
|
||||
"../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 @@ if (is_linux || is_win) {
|
||||
"../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 @@ if (is_linux || is_win) {
|
||||
"../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 @@ if (is_win || is_android) {
|
||||
"../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) {
|
||||
|
||||
@ -60,7 +60,6 @@ if (is_android) {
|
||||
"//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",
|
||||
]
|
||||
}
|
||||
|
||||
@ -592,7 +592,6 @@ if (rtc_include_tests) {
|
||||
"../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",
|
||||
|
||||
@ -45,7 +45,6 @@ rtc_static_library("congestion_controller") {
|
||||
"../../rtc_base:rate_limiter",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:field_trial",
|
||||
"../../system_wrappers:runtime_enabled_features_api",
|
||||
"../bitrate_controller",
|
||||
"../pacing",
|
||||
"../remote_bitrate_estimator",
|
||||
|
||||
@ -45,7 +45,6 @@ rtc_static_library("congestion_controller") {
|
||||
"../../../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",
|
||||
|
||||
@ -34,7 +34,6 @@ rtc_static_library("pacing") {
|
||||
"../../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 @@ if (rtc_include_tests) {
|
||||
"../../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",
|
||||
|
||||
@ -94,7 +94,6 @@ if (rtc_include_tests) {
|
||||
"../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) {
|
||||
|
||||
@ -331,7 +331,6 @@ if (rtc_include_tests) {
|
||||
"../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 @@ if (rtc_include_tests) {
|
||||
"../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",
|
||||
|
||||
@ -1308,7 +1308,6 @@ if (is_ios || is_mac) {
|
||||
":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 @@ if (is_ios || is_mac) {
|
||||
":videocodec_objc",
|
||||
":videotoolbox_objc",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../system_wrappers:runtime_enabled_features_default",
|
||||
]
|
||||
if (rtc_use_metal_rendering) {
|
||||
deps += [ ":metal_objc" ]
|
||||
|
||||
@ -134,7 +134,6 @@ if (is_android) {
|
||||
":peerconnection_jni",
|
||||
"../../pc:peerconnection",
|
||||
"../../system_wrappers:metrics",
|
||||
"../../system_wrappers:runtime_enabled_features_default",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,6 @@ rtc_static_library("system_wrappers") {
|
||||
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("field_trial") {
|
||||
}
|
||||
}
|
||||
|
||||
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 @@ rtc_source_set("metrics") {
|
||||
|
||||
group("system_wrappers_default") {
|
||||
deps = [
|
||||
":runtime_enabled_features_default",
|
||||
":system_wrappers",
|
||||
]
|
||||
}
|
||||
|
||||
@ -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_
|
||||
@ -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
|
||||
@ -212,7 +212,6 @@ if (rtc_include_tests) {
|
||||
"../rtc_base:rtc_base",
|
||||
"../system_wrappers:field_trial",
|
||||
"../system_wrappers:metrics",
|
||||
"../system_wrappers:runtime_enabled_features_default",
|
||||
"//testing/gtest",
|
||||
]
|
||||
}
|
||||
@ -615,7 +614,6 @@ rtc_source_set("test_common") {
|
||||
"../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",
|
||||
|
||||
@ -16,7 +16,6 @@ rtc_static_library("webrtc_fuzzer_main") {
|
||||
]
|
||||
deps = [
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../system_wrappers:runtime_enabled_features_default",
|
||||
"//testing/libfuzzer:libfuzzer_main",
|
||||
]
|
||||
|
||||
|
||||
@ -86,7 +86,6 @@ if (rtc_include_tests) {
|
||||
"../../rtc_base:stringutils",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:field_trial",
|
||||
"../../system_wrappers:runtime_enabled_features_api",
|
||||
"../../video",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
||||
@ -284,7 +284,6 @@ if (rtc_include_tests) {
|
||||
"../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 @@ if (rtc_include_tests) {
|
||||
"../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 @@ if (rtc_include_tests) {
|
||||
"../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 @@ if (rtc_include_tests) {
|
||||
"../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",
|
||||
|
||||
16
webrtc.gni
16
webrtc.gni
@ -54,22 +54,6 @@ declare_args() {
|
||||
# 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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user