1 /* 2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #include "logging/rtc_event_log/fake_rtc_event_log.h" 12 13 #include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h" 14 #include "rtc_base/bind.h" 15 #include "rtc_base/checks.h" 16 #include "rtc_base/logging.h" 17 18 namespace webrtc { 19 FakeRtcEventLog(rtc::Thread * thread)20FakeRtcEventLog::FakeRtcEventLog(rtc::Thread* thread) : thread_(thread) { 21 RTC_DCHECK(thread_); 22 } 23 FakeRtcEventLog::~FakeRtcEventLog() = default; 24 StartLogging(std::unique_ptr<RtcEventLogOutput> output,int64_t output_period_ms)25bool FakeRtcEventLog::StartLogging(std::unique_ptr<RtcEventLogOutput> output, 26 int64_t output_period_ms) { 27 return true; 28 } 29 StopLogging()30void FakeRtcEventLog::StopLogging() { 31 invoker_.Flush(thread_); 32 } 33 Log(std::unique_ptr<RtcEvent> event)34void FakeRtcEventLog::Log(std::unique_ptr<RtcEvent> event) { 35 RtcEvent::Type rtc_event_type = event->GetType(); 36 invoker_.AsyncInvoke<void>( 37 RTC_FROM_HERE, thread_, 38 rtc::Bind(&FakeRtcEventLog::IncrementEventCount, this, rtc_event_type)); 39 } 40 41 } // namespace webrtc 42