diff options
author | Elad Alon <eladalon@webrtc.org> | 2019-05-10 14:42:53 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-05-10 14:14:03 +0000 |
commit | 2a1f020dd9e60407abf55703bc1268cbb8cc530d (patch) | |
tree | d98a0620b975b4833267cdf58218fefe97c70c77 /logging | |
parent | ca362855e1f976f87fba82488a03ff8ada591f3a (diff) | |
download | webrtc-2a1f020dd9e60407abf55703bc1268cbb8cc530d.tar.gz |
Remove RtcEventLogImpl::owner_sequence_checker_
This sequence checker was necessary back when a concern existed
over calling StopLogging() twice. That is no longer a concern.
Bug: webrtc:10613
Change-Id: Ib28d876a8c1940e76d4914287043cce2a1d974b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135949
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27914}
Diffstat (limited to 'logging')
-rw-r--r-- | logging/rtc_event_log/rtc_event_log_impl.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc index 51fa74a9ec..c8c7c626ee 100644 --- a/logging/rtc_event_log/rtc_event_log_impl.cc +++ b/logging/rtc_event_log/rtc_event_log_impl.cc @@ -21,6 +21,7 @@ #include "absl/types/optional.h" #include "api/rtc_event_log_output.h" #include "api/task_queue/queued_task.h" +#include "api/task_queue/task_queue_base.h" #include "logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.h" #include "logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.h" #include "rtc_base/checks.h" @@ -111,10 +112,6 @@ class RtcEventLogImpl final : public RtcEventLog { void ScheduleOutput() RTC_RUN_ON(task_queue_); - // Make sure that the event log is "managed" - created/destroyed, as well - // as started/stopped - from the same thread/task-queue. - SequenceChecker owner_sequence_checker_; - // History containing all past configuration events. std::deque<std::unique_ptr<RtcEvent>> config_history_ RTC_GUARDED_BY(*task_queue_); @@ -157,8 +154,6 @@ RtcEventLogImpl::RtcEventLogImpl( } RtcEventLogImpl::~RtcEventLogImpl() { - RTC_DCHECK_RUN_ON(&owner_sequence_checker_); - // If we're logging to the output, this will stop that. Blocking function. StopLogging(); @@ -171,8 +166,6 @@ RtcEventLogImpl::~RtcEventLogImpl() { bool RtcEventLogImpl::StartLogging(std::unique_ptr<RtcEventLogOutput> output, int64_t output_period_ms) { - RTC_DCHECK_RUN_ON(&owner_sequence_checker_); - RTC_DCHECK(output_period_ms == kImmediateOutput || output_period_ms > 0); if (!output->IsActive()) { @@ -206,8 +199,6 @@ bool RtcEventLogImpl::StartLogging(std::unique_ptr<RtcEventLogOutput> output, } void RtcEventLogImpl::StopLogging() { - RTC_DCHECK_RUN_ON(&owner_sequence_checker_); - RTC_LOG(LS_INFO) << "Stopping WebRTC event log."; rtc::Event output_stopped; @@ -223,6 +214,11 @@ void RtcEventLogImpl::StopLogging() { output_stopped.Set(); }); + // By making sure StopLogging() is not executed on a task queue, + // we ensure it's not running on a thread that is shared with |task_queue_|, + // meaning the following Wait() will not block forever. + RTC_DCHECK(TaskQueueBase::Current() == nullptr); + output_stopped.Wait(rtc::Event::kForever); RTC_LOG(LS_INFO) << "WebRTC event log successfully stopped."; |