| Index: Source/modules/mediastream/RTCPeerConnection.cpp
|
| diff --git a/Source/modules/mediastream/RTCPeerConnection.cpp b/Source/modules/mediastream/RTCPeerConnection.cpp
|
| index c990d23ca1cb52bb70b0dff54909d2e0bc16595a..d3585d5497c2e05f7435bc7f64f494ae7b4e35d2 100644
|
| --- a/Source/modules/mediastream/RTCPeerConnection.cpp
|
| +++ b/Source/modules/mediastream/RTCPeerConnection.cpp
|
| @@ -72,14 +72,14 @@ PassRefPtr<RTCConfiguration> RTCPeerConnection::parseConfiguration(const Diction
|
| ArrayValue iceServers;
|
| bool ok = configuration.get("iceServers", iceServers);
|
| if (!ok || iceServers.isUndefinedOrNull()) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return 0;
|
| }
|
|
|
| size_t numberOfServers;
|
| ok = iceServers.length(numberOfServers);
|
| if (!ok) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return 0;
|
| }
|
|
|
| @@ -89,19 +89,19 @@ PassRefPtr<RTCConfiguration> RTCPeerConnection::parseConfiguration(const Diction
|
| Dictionary iceServer;
|
| ok = iceServers.get(i, iceServer);
|
| if (!ok) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return 0;
|
| }
|
|
|
| String urlString, username, credential;
|
| ok = iceServer.get("url", urlString);
|
| if (!ok) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return 0;
|
| }
|
| KURL url(KURL(), urlString);
|
| if (!url.isValid() || !(url.protocolIs("turn") || url.protocolIs("turns") || url.protocolIs("stun"))) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return 0;
|
| }
|
|
|
| @@ -144,20 +144,20 @@ RTCPeerConnection::RTCPeerConnection(ScriptExecutionContext* context, PassRefPtr
|
| Document* document = toDocument(scriptExecutionContext());
|
|
|
| if (!document->frame()) {
|
| - es.throwDOMException(NotSupportedError);
|
| + es.throwUninformativeAndGenericDOMException(NotSupportedError);
|
| return;
|
| }
|
|
|
| m_peerHandler = RTCPeerConnectionHandler::create(this);
|
| if (!m_peerHandler) {
|
| - es.throwDOMException(NotSupportedError);
|
| + es.throwUninformativeAndGenericDOMException(NotSupportedError);
|
| return;
|
| }
|
|
|
| document->frame()->loader()->client()->dispatchWillStartUsingPeerConnectionHandler(m_peerHandler.get());
|
|
|
| if (!m_peerHandler->initialize(configuration, constraints)) {
|
| - es.throwDOMException(NotSupportedError);
|
| + es.throwUninformativeAndGenericDOMException(NotSupportedError);
|
| return;
|
| }
|
| }
|
| @@ -170,12 +170,12 @@ RTCPeerConnection::~RTCPeerConnection()
|
| void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
| if (!successCallback) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return;
|
| }
|
|
|
| @@ -190,12 +190,12 @@ void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> su
|
| void RTCPeerConnection::createAnswer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
| if (!successCallback) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return;
|
| }
|
|
|
| @@ -210,13 +210,13 @@ void RTCPeerConnection::createAnswer(PassRefPtr<RTCSessionDescriptionCallback> s
|
| void RTCPeerConnection::setLocalDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
| RefPtr<RTCSessionDescription> sessionDescription = prpSessionDescription;
|
| if (!sessionDescription) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return;
|
| }
|
|
|
| @@ -237,13 +237,13 @@ PassRefPtr<RTCSessionDescription> RTCPeerConnection::localDescription(ExceptionS
|
| void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
| RefPtr<RTCSessionDescription> sessionDescription = prpSessionDescription;
|
| if (!sessionDescription) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return;
|
| }
|
|
|
| @@ -264,7 +264,7 @@ PassRefPtr<RTCSessionDescription> RTCPeerConnection::remoteDescription(Exception
|
| void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
| @@ -278,35 +278,35 @@ void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, const Dict
|
|
|
| bool valid = m_peerHandler->updateIce(configuration, constraints);
|
| if (!valid)
|
| - es.throwDOMException(SyntaxError);
|
| + es.throwUninformativeAndGenericDOMException(SyntaxError);
|
| }
|
|
|
| void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
| if (!iceCandidate) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return;
|
| }
|
|
|
| bool valid = m_peerHandler->addIceCandidate(iceCandidate->webCandidate());
|
| if (!valid)
|
| - es.throwDOMException(SyntaxError);
|
| + es.throwUninformativeAndGenericDOMException(SyntaxError);
|
| }
|
|
|
| void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
| if (!iceCandidate || !successCallback || !errorCallback) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return;
|
| }
|
|
|
| @@ -314,7 +314,7 @@ void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, PassRefPt
|
|
|
| bool implemented = m_peerHandler->addIceCandidate(request.release(), iceCandidate->webCandidate());
|
| if (!implemented)
|
| - es.throwDOMException(NotSupportedError);
|
| + es.throwUninformativeAndGenericDOMException(NotSupportedError);
|
| }
|
|
|
| String RTCPeerConnection::signalingState() const
|
| @@ -379,13 +379,13 @@ String RTCPeerConnection::iceConnectionState() const
|
| void RTCPeerConnection::addStream(PassRefPtr<MediaStream> prpStream, const Dictionary& mediaConstraints, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
| RefPtr<MediaStream> stream = prpStream;
|
| if (!stream) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return;
|
| }
|
|
|
| @@ -400,18 +400,18 @@ void RTCPeerConnection::addStream(PassRefPtr<MediaStream> prpStream, const Dicti
|
|
|
| bool valid = m_peerHandler->addStream(stream->descriptor(), constraints);
|
| if (!valid)
|
| - es.throwDOMException(SyntaxError);
|
| + es.throwUninformativeAndGenericDOMException(SyntaxError);
|
| }
|
|
|
| void RTCPeerConnection::removeStream(PassRefPtr<MediaStream> prpStream, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
| if (!prpStream) {
|
| - es.throwDOMException(TypeMismatchError);
|
| + es.throwUninformativeAndGenericDOMException(TypeMismatchError);
|
| return;
|
| }
|
|
|
| @@ -461,7 +461,7 @@ void RTCPeerConnection::getStats(PassRefPtr<RTCStatsCallback> successCallback, P
|
| PassRefPtr<RTCDataChannel> RTCPeerConnection::createDataChannel(String label, const Dictionary& options, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return 0;
|
| }
|
|
|
| @@ -500,7 +500,7 @@ bool RTCPeerConnection::hasLocalStreamWithTrackId(const String& trackId)
|
| PassRefPtr<RTCDTMFSender> RTCPeerConnection::createDTMFSender(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return 0;
|
| }
|
|
|
| @@ -512,7 +512,7 @@ PassRefPtr<RTCDTMFSender> RTCPeerConnection::createDTMFSender(PassRefPtr<MediaSt
|
| RefPtr<MediaStreamTrack> track = prpTrack;
|
|
|
| if (!hasLocalStreamWithTrackId(track->id())) {
|
| - es.throwDOMException(SyntaxError);
|
| + es.throwUninformativeAndGenericDOMException(SyntaxError);
|
| return 0;
|
| }
|
|
|
| @@ -525,7 +525,7 @@ PassRefPtr<RTCDTMFSender> RTCPeerConnection::createDTMFSender(PassRefPtr<MediaSt
|
| void RTCPeerConnection::close(ExceptionState& es)
|
| {
|
| if (m_signalingState == SignalingStateClosed) {
|
| - es.throwDOMException(InvalidStateError);
|
| + es.throwUninformativeAndGenericDOMException(InvalidStateError);
|
| return;
|
| }
|
|
|
|
|