Using absl::string_view to stringify an RTCErrorType.

Bug: webrtc:10198
Change-Id: Ie7fdba08df219a03ebe2ee5521c2840f28571bba
Reviewed-on: https://webrtc-review.googlesource.com/c/117162
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26277}
diff --git a/api/rtc_error.h b/api/rtc_error.h
index d8db1f2..673a79a 100644
--- a/api/rtc_error.h
+++ b/api/rtc_error.h
@@ -17,6 +17,7 @@
 #include <string>
 #include <utility>  // For std::move.
 
+#include "absl/strings/string_view.h"
 #include "rtc_base/checks.h"
 #include "rtc_base/logging.h"
 
@@ -128,8 +129,9 @@
 // Outputs the error as a friendly string. Update this method when adding a new
 // error type.
 //
-// Only intended to be used for logging/disagnostics.
-std::string ToString(RTCErrorType error);
+// Only intended to be used for logging/diagnostics. The string_view points
+// to literal string that lives for the whole duration of the program.
+absl::string_view ToString(RTCErrorType error);
 
 #ifdef UNIT_TEST
 inline std::ostream& operator<<(  // no-presubmit-check TODO(webrtc:8982)