diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc index 943d90b63e..74f88779ef 100644 --- a/logging/rtc_event_log/rtc_event_log_impl.cc +++ b/logging/rtc_event_log/rtc_event_log_impl.cc @@ -10,7 +10,6 @@ #include "logging/rtc_event_log/rtc_event_log.h" -#include #include #include #include @@ -41,11 +40,6 @@ constexpr size_t kMaxEventsInHistory = 10000; // to prevent an attack via unreasonable memory use. constexpr size_t kMaxEventsInConfigHistory = 1000; -// Observe a limit on the number of concurrent logs, so as not to run into -// OS-imposed limits on open files and/or threads/task-queues. -// TODO(eladalon): Known issue - there's a race over |rtc_event_log_count|. -std::atomic rtc_event_log_count(0); - // TODO(eladalon): This class exists because C++11 doesn't allow transferring a // unique_ptr to a lambda (a copy constructor is required). We should get // rid of this when we move to C++14. @@ -160,9 +154,6 @@ RtcEventLogImpl::~RtcEventLogImpl() { // If we're logging to the output, this will stop that. Blocking function. StopLogging(); - - int count = std::atomic_fetch_sub(&rtc_event_log_count, 1) - 1; - RTC_DCHECK_GE(count, 0); } bool RtcEventLogImpl::StartLogging(std::unique_ptr output, @@ -370,17 +361,7 @@ std::unique_ptr RtcEventLog::Create( EncodingType encoding_type, std::unique_ptr task_queue) { #ifdef ENABLE_RTC_EVENT_LOG - // TODO(eladalon): Known issue - there's a race over |rtc_event_log_count|. - constexpr int kMaxLogCount = 5; - int count = 1 + std::atomic_fetch_add(&rtc_event_log_count, 1); - if (count > kMaxLogCount) { - RTC_LOG(LS_WARNING) << "Denied creation of additional WebRTC event logs. " - << count - 1 << " logs open already."; - std::atomic_fetch_sub(&rtc_event_log_count, 1); - return CreateNull(); - } - auto encoder = CreateEncoder(encoding_type); - return rtc::MakeUnique(std::move(encoder), + return rtc::MakeUnique(CreateEncoder(encoding_type), std::move(task_queue)); #else return CreateNull();