Split IceCandidatePairEventType enum.

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}
This commit is contained in:
Bjorn Terelius
2018-05-30 17:14:08 +02:00
committed by Commit Bot
parent f0b83c5e87
commit 59b4e3ea8c
14 changed files with 69 additions and 73 deletions

View File

@ -18,25 +18,21 @@ namespace webrtc {
IceEventLog::IceEventLog() {}
IceEventLog::~IceEventLog() {}
bool IceEventLog::IsIceCandidatePairConfigEvent(
IceCandidatePairEventType type) {
return (type == IceCandidatePairEventType::kAdded) ||
(type == IceCandidatePairEventType::kUpdated) ||
(type == IceCandidatePairEventType::kDestroyed) ||
(type == IceCandidatePairEventType::kSelected);
}
void IceEventLog::LogCandidatePairEvent(
IceCandidatePairEventType type,
void IceEventLog::LogCandidatePairConfig(
IceCandidatePairConfigType type,
uint32_t candidate_pair_id,
const IceCandidatePairDescription& candidate_pair_desc) {
if (event_log_ == nullptr) {
return;
}
if (IsIceCandidatePairConfigEvent(type)) {
candidate_pair_desc_by_id_[candidate_pair_id] = candidate_pair_desc;
event_log_->Log(rtc::MakeUnique<RtcEventIceCandidatePairConfig>(
type, candidate_pair_id, candidate_pair_desc));
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(
@ -46,7 +42,7 @@ void IceEventLog::LogCandidatePairEvent(
void IceEventLog::DumpCandidatePairDescriptionToMemoryAsConfigEvents() const {
for (const auto& desc_id_pair : candidate_pair_desc_by_id_) {
event_log_->Log(rtc::MakeUnique<RtcEventIceCandidatePairConfig>(
IceCandidatePairEventType::kUpdated, desc_id_pair.first,
IceCandidatePairConfigType::kUpdated, desc_id_pair.first,
desc_id_pair.second));
}
}