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

Unified Diff: third_party/WebKit/Source/modules/mediastream/MediaErrorState.cpp

Issue 1661493002: Add promise-based addIceCandidate, setLocalDescription and setRemoteDescription to RTCPeerConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: yhirano's comments Created 4 years, 10 months 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
Index: third_party/WebKit/Source/modules/mediastream/MediaErrorState.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaErrorState.cpp b/third_party/WebKit/Source/modules/mediastream/MediaErrorState.cpp
index e52cb024b24b232a91e2dc1463b408fd14639a1d..e3f895d14665b87ad91a652c6d617af45c52dbc1 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaErrorState.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/MediaErrorState.cpp
@@ -99,6 +99,27 @@ void MediaErrorState::raiseException(ExceptionState& target)
}
}
+String MediaErrorState::getErrorMessage()
+{
+ switch (m_errorType) {
+ case NoError:
+ ASSERT_NOT_REACHED();
+ break;
+ case TypeError:
+ case DOMError:
philipj_slow 2016/02/15 10:22:21 Also s/DOMError/DOMException/ here?
Guido Urdaneta 2016/02/15 16:56:51 Done.
+ return m_message;
+ case ConstraintError:
+ // This is for the cases where we can't pass back a
+ // NavigatorUserMediaError.
+ // So far, we have this in the constructor of RTCPeerConnection,
+ // which is due to be deprecated.
+ // TODO(hta): Remove this code. https://crbug.com/576581
+ return "Unsatisfiable constraint " + m_constraint;
haraken 2016/02/13 15:07:18 Shall we add: default: ASSERT_NOT_REACHED()
Guido Urdaneta 2016/02/15 16:56:51 Done.
+ }
+
+ return String();
+}
+
NavigatorUserMediaError* MediaErrorState::createError()
{
ASSERT(m_errorType == ConstraintError);

Powered by Google App Engine
This is Rietveld 408576698