Index: third_party/WebKit/public/platform/WebRTCError.h |
diff --git a/third_party/WebKit/public/platform/WebRTCError.h b/third_party/WebKit/public/platform/WebRTCError.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0a9767a1ec973cc44204b396722ff9898cf20ed4 |
--- /dev/null |
+++ b/third_party/WebKit/public/platform/WebRTCError.h |
@@ -0,0 +1,40 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef WebRTCError_h |
+#define WebRTCError_h |
+ |
+// This header provides a Blink equivalent of webrtc::RTCError from |
+// third_party/webrtc. It's used to communicate errors between Blink and the |
+// WebRTCPeerConnectionHandler implementation. |
+ |
+namespace blink { |
+ |
+enum class WebRTCErrorType { |
+ kNone, |
+ kUnsupportedParameter, |
+ kInvalidParameter, |
+ kInvalidRange, |
+ kSyntaxError, |
+ kInvalidState, |
+ kInvalidModification, |
+ kNetworkError, |
+ kInternalError, |
+}; |
+ |
+class BLINK_PLATFORM_EXPORT WebRTCError { |
+ public: |
+ WebRTCError() : m_type(WebRTCErrorType::kNone) {} |
+ explicit WebRTCError(WebRTCErrorType type) : m_type(type) {} |
+ |
+ WebRTCErrorType type() const { return m_type; } |
+ void setType(WebRTCErrorType type) { m_type = type; } |
+ |
+ private: |
+ WebRTCErrorType m_type; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // WebRTCError_h |