Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: webrtc/logging/rtc_event_log/rtc_event_log_parser.cc

Issue 2996933003: Add logging of host lookups made by TurnPort to the RtcEventLog. (Closed)
Patch Set: review Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/logging/rtc_event_log/rtc_event_log_parser.cc
diff --git a/webrtc/logging/rtc_event_log/rtc_event_log_parser.cc b/webrtc/logging/rtc_event_log/rtc_event_log_parser.cc
index a7237ee8511507228ee026a08e7440f522138976..7b8af9a0671ad4d281196359fa7a28d2d74e0191 100644
--- a/webrtc/logging/rtc_event_log/rtc_event_log_parser.cc
+++ b/webrtc/logging/rtc_event_log/rtc_event_log_parser.cc
@@ -74,6 +74,8 @@ ParsedRtcEventLog::EventType GetRuntimeEventType(
return ParsedRtcEventLog::EventType::BWE_PROBE_CLUSTER_CREATED_EVENT;
case rtclog::Event::BWE_PROBE_RESULT_EVENT:
return ParsedRtcEventLog::EventType::BWE_PROBE_RESULT_EVENT;
+ case rtclog::Event::HOST_LOOKUP_EVENT:
+ return ParsedRtcEventLog::EventType::HOST_LOOKUP_EVENT;
}
RTC_NOTREACHED();
return ParsedRtcEventLog::EventType::UNKNOWN_EVENT;
@@ -654,4 +656,19 @@ ParsedRtcEventLog::MediaType ParsedRtcEventLog::GetMediaType(
}
return MediaType::ANY;
}
+
+void ParsedRtcEventLog::GetHostLookup(
+ size_t index,
+ int* error, int64_t* host_lookup_time_ms) const {
+ RTC_CHECK_LT(index, GetNumberOfEvents());
+ const rtclog::Event& event = events_[index];
+ RTC_CHECK(event.has_type());
+ RTC_CHECK_EQ(event.type(), rtclog::Event::HOST_LOOKUP_EVENT);
+ RTC_CHECK(event.has_host_lookup_result());
+ const rtclog::HostLookupResult& lookup_event = event.host_lookup_result();
+ RTC_CHECK(lookup_event.has_error());
+ *error = lookup_event.error();
terelius 2017/08/21 09:38:14 We have previously allowed passing in nullptr if w
+ RTC_CHECK(lookup_event.has_host_lookup_time_ms());
+ *host_lookup_time_ms = lookup_event.host_lookup_time_ms();
terelius 2017/08/21 09:38:14 Same here.
+}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698