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

Unified Diff: webrtc/api/peerconnection.cc

Issue 2564683002: Adding error enum to be used by PeerConnectionInterface methods. (Closed)
Patch Set: . Created 4 years 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
« no previous file with comments | « no previous file | webrtc/api/peerconnectioninterface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnection.cc
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc
index a47b2f2d8c55831f0ab80d4699d446d4ed3b1954..e1f19adf3eff51594d58cf510489b6c1baf28c9c 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -432,6 +432,25 @@ void SetChannelOnSendersAndReceivers(CHANNEL* channel,
namespace webrtc {
+static const char* const kRtcErrorNames[] = {
+ "NONE",
+ "UNSUPPORTED_PARAMETER",
+ "INVALID_PARAMETER",
+ "INVALID_RANGE",
+ "SYNTAX_ERROR",
+ "INVALID_STATE",
+ "INVALID_MODIFICATION",
+ "NETWORK_ERROR",
+ "INTERNAL_ERROR",
+};
+
+std::ostream& operator<<(std::ostream& stream, RtcError error) {
+ int index = static_cast<int>(error);
+ RTC_CHECK(index < static_cast<int>(sizeof(kRtcErrorNames) /
+ sizeof(kRtcErrorNames[0])));
+ return stream << kRtcErrorNames[index];
+}
+
// Generate a RTCP CNAME when a PeerConnection is created.
std::string GenerateRtcpCname() {
std::string cname;
« no previous file with comments | « no previous file | webrtc/api/peerconnectioninterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698