Fix no_global_constructors in remote_bitrate_estimator.
Bug: webrtc:9693
Change-Id: Ibd8f0e89a7b37ad26d4cb3e73c395f77ed988ac9
Reviewed-on: https://webrtc-review.googlesource.com/98584
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24682}
diff --git a/modules/remote_bitrate_estimator/BUILD.gn b/modules/remote_bitrate_estimator/BUILD.gn
index 0758b0a..63564a6 100644
--- a/modules/remote_bitrate_estimator/BUILD.gn
+++ b/modules/remote_bitrate_estimator/BUILD.gn
@@ -33,10 +33,8 @@
if (rtc_enable_bwe_test_logging) {
defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1" ]
- configs += [
- "../..:no_exit_time_destructors",
- "../..:no_global_constructors",
- ]
+
+ configs += [ "../..:no_exit_time_destructors" ]
sources += [ "test/bwe_test_logging.cc" ]
} else {
defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.cc b/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
index 1b4cae2..0778040 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
+++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
@@ -26,8 +26,6 @@
namespace testing {
namespace bwe {
-Logging Logging::g_Logging;
-
static std::string ToString(uint32_t v) {
rtc::StringBuilder ss;
ss << v;
@@ -58,7 +56,8 @@
}
Logging* Logging::GetInstance() {
- return &g_Logging;
+ static Logging* logging = new Logging();
+ return logging;
}
void Logging::SetGlobalContext(uint32_t name) {
diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.h b/modules/remote_bitrate_estimator/test/bwe_test_logging.h
index 20a29cc..6e0f66a 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test_logging.h
+++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.h
@@ -346,7 +346,6 @@
bool enabled);
void PopState();
- static Logging g_Logging;
rtc::CriticalSection crit_sect_;
ThreadMap thread_map_;