Simplify FakeRtcEventLog, delete rtc::Bind usage

Bug: webrtc:11339
Change-Id: I2a250934daf0a9114ef8c03464034b1efd8c4c35
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201722
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32990}
This commit is contained in:
Niels Möller 2021-01-14 09:50:26 +01:00 committed by Commit Bot
parent f9ee0e08ec
commit d76dcbd963
2 changed files with 3 additions and 5 deletions

View File

@ -11,7 +11,6 @@
#include "logging/rtc_event_log/fake_rtc_event_log.h"
#include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h"
#include "rtc_base/bind.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
@ -33,9 +32,9 @@ void FakeRtcEventLog::StopLogging() {
void FakeRtcEventLog::Log(std::unique_ptr<RtcEvent> event) {
RtcEvent::Type rtc_event_type = event->GetType();
invoker_.AsyncInvoke<void>(
RTC_FROM_HERE, thread_,
rtc::Bind(&FakeRtcEventLog::IncrementEventCount, this, rtc_event_type));
invoker_.AsyncInvoke<void>(RTC_FROM_HERE, thread_, [this, rtc_event_type] {
++count_[rtc_event_type];
});
}
} // namespace webrtc

View File

@ -32,7 +32,6 @@ class FakeRtcEventLog : public RtcEventLog {
int GetEventCount(RtcEvent::Type event_type) { return count_[event_type]; }
private:
void IncrementEventCount(RtcEvent::Type event_type) { ++count_[event_type]; }
std::map<RtcEvent::Type, int> count_;
rtc::Thread* thread_;
rtc::AsyncInvoker invoker_;