Disjoint subsets of the enum values are used for Ice candidate config events and Ice candidate check events. This CL breaks out the config part to a separate enum and by extension changes the icelogger interface for config events. Bug: webrtc:9336, webrtc:8111 Change-Id: I405b5c3981905c3c504b45afdddb3649469ed141 Reviewed-on: https://webrtc-review.googlesource.com/79943 Reviewed-by: Qingsi Wang <qingsi@webrtc.org> Commit-Queue: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23464}
51 lines
1.6 KiB
C++
51 lines
1.6 KiB
C++
/*
|
|
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "logging/rtc_event_log/icelogger.h"
|
|
|
|
#include "logging/rtc_event_log/rtc_event_log.h"
|
|
#include "rtc_base/ptr_util.h"
|
|
|
|
namespace webrtc {
|
|
|
|
IceEventLog::IceEventLog() {}
|
|
IceEventLog::~IceEventLog() {}
|
|
|
|
void IceEventLog::LogCandidatePairConfig(
|
|
IceCandidatePairConfigType type,
|
|
uint32_t candidate_pair_id,
|
|
const IceCandidatePairDescription& candidate_pair_desc) {
|
|
if (event_log_ == nullptr) {
|
|
return;
|
|
}
|
|
candidate_pair_desc_by_id_[candidate_pair_id] = candidate_pair_desc;
|
|
event_log_->Log(rtc::MakeUnique<RtcEventIceCandidatePairConfig>(
|
|
type, candidate_pair_id, candidate_pair_desc));
|
|
}
|
|
|
|
void IceEventLog::LogCandidatePairEvent(IceCandidatePairEventType type,
|
|
uint32_t candidate_pair_id) {
|
|
if (event_log_ == nullptr) {
|
|
return;
|
|
}
|
|
event_log_->Log(
|
|
rtc::MakeUnique<RtcEventIceCandidatePair>(type, candidate_pair_id));
|
|
}
|
|
|
|
void IceEventLog::DumpCandidatePairDescriptionToMemoryAsConfigEvents() const {
|
|
for (const auto& desc_id_pair : candidate_pair_desc_by_id_) {
|
|
event_log_->Log(rtc::MakeUnique<RtcEventIceCandidatePairConfig>(
|
|
IceCandidatePairConfigType::kUpdated, desc_id_pair.first,
|
|
desc_id_pair.second));
|
|
}
|
|
}
|
|
|
|
} // namespace webrtc
|