From cf83ae094a1f0da1795297aa70ce94147085342e Mon Sep 17 00:00:00 2001 From: Bjorn Terelius Date: Mon, 26 Feb 2018 22:31:28 +0100 Subject: [PATCH] Add extra RTC_CHECKs in RtcEventLog. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: I8a7c5c1735f04c44f0ea99ae12cc984e9eb7a6ee Reviewed-on: https://webrtc-review.googlesource.com/57960 Reviewed-by: Elad Alon Reviewed-by: Björn Terelius Commit-Queue: Björn Terelius Cr-Commit-Position: refs/heads/master@{#22202} --- logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc | 1 + logging/rtc_event_log/rtc_event_log_impl.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc b/logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc index 9ebdcbc985..b1497d3713 100644 --- a/logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc +++ b/logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc @@ -244,6 +244,7 @@ std::string RtcEventLogEncoderLegacy::EncodeBatch( for (auto it = begin; it != end; ++it) { // TODO(terelius): Can we avoid the slight inefficiency of reallocating the // string? + RTC_CHECK(it->get() != nullptr); encoded_output += Encode(**it); } return encoded_output; diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc index 735c9b34a6..f1582e820a 100644 --- a/logging/rtc_event_log/rtc_event_log_impl.cc +++ b/logging/rtc_event_log/rtc_event_log_impl.cc @@ -216,7 +216,7 @@ void RtcEventLogImpl::StopLogging() { } void RtcEventLogImpl::Log(std::unique_ptr event) { - RTC_DCHECK(event); + RTC_CHECK(event); // Binding to |this| is safe because |this| outlives the |task_queue_|. auto event_handler = [this](std::unique_ptr unencoded_event) {