Chromium Code Reviews| Index: webrtc/call/rtc_event_log.cc |
| diff --git a/webrtc/call/rtc_event_log.cc b/webrtc/call/rtc_event_log.cc |
| index 361db81c068ccc99b480918ad55c05cbd1be1656..81e953e69c2ced1f6d8fc3dbb3b812549fe502a6 100644 |
| --- a/webrtc/call/rtc_event_log.cc |
| +++ b/webrtc/call/rtc_event_log.cc |
| @@ -16,6 +16,7 @@ |
| #include "webrtc/base/checks.h" |
| #include "webrtc/base/criticalsection.h" |
| #include "webrtc/base/thread_annotations.h" |
| +#include "webrtc/base/thread_checker.h" |
| #include "webrtc/call.h" |
| #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
| @@ -41,7 +42,10 @@ class RtcEventLogImpl final : public RtcEventLog { |
| public: |
| void SetBufferDuration(int64_t buffer_duration_us) override {} |
| void StartLogging(const std::string& file_name, int duration_ms) override {} |
| - bool StartLogging(rtc::PlatformFile log_file) override { return false; } |
| + bool StartLogging(rtc::PlatformFile log_file, |
| + int64_t max_size_bytes) override { |
| + return false; |
| + } |
| void StopLogging(void) override {} |
| void LogVideoReceiveStreamConfig( |
| const VideoReceiveStream::Config& config) override {} |
| @@ -66,10 +70,12 @@ class RtcEventLogImpl final : public RtcEventLog { |
| class RtcEventLogImpl final : public RtcEventLog { |
| public: |
| RtcEventLogImpl(); |
| + ~RtcEventLogImpl(); |
| void SetBufferDuration(int64_t buffer_duration_us) override; |
| void StartLogging(const std::string& file_name, int duration_ms) override; |
| - bool StartLogging(rtc::PlatformFile log_file) override; |
| + bool StartLogging(rtc::PlatformFile log_file, |
| + int64_t max_size_bytes) override; |
| void StopLogging() override; |
| void LogVideoReceiveStreamConfig( |
| const VideoReceiveStream::Config& config) override; |
| @@ -104,6 +110,7 @@ class RtcEventLogImpl final : public RtcEventLog { |
| void AddRecentEvent(const rtclog::Event& event) |
| EXCLUSIVE_LOCKS_REQUIRED(crit_); |
| + rtc::ThreadChecker thread_checker_; |
| rtc::CriticalSection crit_; |
| rtc::scoped_ptr<FileWrapper> file_ GUARDED_BY(crit_) = |
| rtc::scoped_ptr<FileWrapper>(FileWrapper::Create()); |
| @@ -180,6 +187,11 @@ RtcEventLogImpl::RtcEventLogImpl() |
| start_time_us_(0), |
| duration_us_(0), |
| clock_(Clock::GetRealTimeClock()) { |
| + RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| +} |
| + |
| +RtcEventLogImpl::~RtcEventLogImpl() { |
| + RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| } |
| void RtcEventLogImpl::SetBufferDuration(int64_t buffer_duration_us) { |
| @@ -201,7 +213,8 @@ void RtcEventLogImpl::StartLogging(const std::string& file_name, |
| StartLoggingLocked(); |
| } |
| -bool RtcEventLogImpl::StartLogging(rtc::PlatformFile log_file) { |
| +bool RtcEventLogImpl::StartLogging(rtc::PlatformFile log_file, |
| + int64_t max_size_bytes) { |
|
stefan-webrtc
2016/03/11 10:11:53
Can we break this change out to a separate CL, or
terelius
2016/03/11 12:30:44
I think the total amount of work will decrease by
ivoc
2016/03/16 17:00:32
The max size and moving to call are pretty indepen
stefan-webrtc
2016/03/21 13:25:47
Thanks.
|
| rtc::CritScope lock(&crit_); |
| if (currently_logging_) { |