From e1c893530d554d9f64e6c0415a39d2758e1f06af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Fri, 22 Jul 2022 15:31:02 -0700 Subject: [PATCH] Add WriteFatalLog declarations to checks.h header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds a file,line version of this function (not yet committed) as Chromium logging uses LogMessage(file, line, severity) and needs this information to give better logs. The two versions of this method will be implemented in webrtc_overrides/ and then committed to Chromium. At this point checks.cc will move its anonymous-namespace version of this function (and be renamed) to match this definition, but only define it when not building with Chromium. At this point WriteFatalLog will be using LogMessage(LOG_FATAL) to crash in Chromium allowing us to upload better crash dumps and stacks to crash reporting. Bug: chromium:1216177 Change-Id: I3fd6a84cdfbb2552a5e628d46257bd7a00c9e6dc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269288 Reviewed-by: Mirko Bonadei Commit-Queue: Peter Boström Cr-Commit-Position: refs/heads/main@{#37646} --- rtc_base/checks.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rtc_base/checks.h b/rtc_base/checks.h index 6ffa30da59..459c6a5ebb 100644 --- a/rtc_base/checks.h +++ b/rtc_base/checks.h @@ -122,6 +122,13 @@ enum class CheckArgType : int8_t { kCheckOp, }; +// These two functions are public so they can be overridden from +// webrtc_overrides in chromium. +RTC_NORETURN void WriteFatalLog(const char* file, + int line, + absl::string_view output); +RTC_NORETURN void WriteFatalLog(absl::string_view output); + #if RTC_CHECK_MSG_ENABLED RTC_NORETURN RTC_EXPORT void FatalLog(const char* file, int line,