tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

fake_rtc_event_log.cc (1112B)


      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 <cstdint>
     14 #include <map>
     15 #include <memory>
     16 
     17 #include "api/rtc_event_log/rtc_event.h"
     18 #include "api/rtc_event_log_output.h"
     19 #include "rtc_base/synchronization/mutex.h"
     20 
     21 namespace webrtc {
     22 
     23 bool FakeRtcEventLog::StartLogging(
     24    std::unique_ptr<RtcEventLogOutput> /* output */,
     25    int64_t /* output_period_ms */) {
     26  return true;
     27 }
     28 
     29 void FakeRtcEventLog::StopLogging() {}
     30 
     31 void FakeRtcEventLog::Log(std::unique_ptr<RtcEvent> event) {
     32  MutexLock lock(&mu_);
     33  ++count_[event->GetType()];
     34 }
     35 
     36 int FakeRtcEventLog::GetEventCount(RtcEvent::Type event_type) {
     37  MutexLock lock(&mu_);
     38  return count_[event_type];
     39 }
     40 
     41 }  // namespace webrtc