| Index: webrtc/call/rtc_event_log.cc
|
| diff --git a/webrtc/call/rtc_event_log.cc b/webrtc/call/rtc_event_log.cc
|
| index ce4d6ef39f4b4e3fb86173d055ee526f9da8933d..61b54f85a7df819d8170705771e51d2243313185 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,14 @@ class RtcEventLogImpl final : public RtcEventLog {
|
| class RtcEventLogImpl final : public RtcEventLog {
|
| public:
|
| RtcEventLogImpl();
|
| + ~RtcEventLogImpl() override;
|
|
|
| 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 {
|
| + return StartLogging(log_file);
|
| + }
|
| void StopLogging() override;
|
| void LogVideoReceiveStreamConfig(
|
| const VideoReceiveStream::Config& config) override;
|
| @@ -88,6 +96,7 @@ class RtcEventLogImpl final : public RtcEventLog {
|
| int32_t total_packets) override;
|
|
|
| private:
|
| + bool StartLogging(rtc::PlatformFile log_file);
|
| // Starts logging. This function assumes the file_ has been opened succesfully
|
| // and that the start_time_us_ and _duration_us_ have been set.
|
| void StartLoggingLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_);
|
| @@ -104,6 +113,7 @@ class RtcEventLogImpl final : public RtcEventLog {
|
| void AddRecentEvent(const rtclog::Event& event)
|
| EXCLUSIVE_LOCKS_REQUIRED(crit_);
|
|
|
| + rtc::ThreadChecker thread_checker_;
|
| rtc::CriticalSection crit_;
|
| std::unique_ptr<FileWrapper> file_ GUARDED_BY(crit_) =
|
| std::unique_ptr<FileWrapper>(FileWrapper::Create());
|
| @@ -180,6 +190,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) {
|
|
|