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

Unified Diff: Source/modules/mediastream/RTCPeerConnection.cpp

Issue 18548003: Rename ExceptionCode constants to use the names in the spec (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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: Source/modules/mediastream/RTCPeerConnection.cpp
diff --git a/Source/modules/mediastream/RTCPeerConnection.cpp b/Source/modules/mediastream/RTCPeerConnection.cpp
index 8d59957fa601233236590fadf7f1f2c686c7029a..275252f18c19f89de4735fdc332bc4ed97757374 100644
--- a/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -71,14 +71,14 @@ PassRefPtr<RTCConfiguration> RTCPeerConnection::parseConfiguration(const Diction
ArrayValue iceServers;
bool ok = configuration.get("iceServers", iceServers);
if (!ok || iceServers.isUndefinedOrNull()) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return 0;
}
size_t numberOfServers;
ok = iceServers.length(numberOfServers);
if (!ok) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return 0;
}
@@ -88,19 +88,19 @@ PassRefPtr<RTCConfiguration> RTCPeerConnection::parseConfiguration(const Diction
Dictionary iceServer;
ok = iceServers.get(i, iceServer);
if (!ok) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return 0;
}
String urlString, username, credential;
ok = iceServer.get("url", urlString);
if (!ok) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return 0;
}
KURL url(KURL(), urlString);
if (!url.isValid() || !(url.protocolIs("turn") || url.protocolIs("stun"))) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return 0;
}
@@ -169,12 +169,12 @@ RTCPeerConnection::~RTCPeerConnection()
void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
if (!successCallback) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
@@ -189,12 +189,12 @@ void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> su
void RTCPeerConnection::createAnswer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
if (!successCallback) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
@@ -209,13 +209,13 @@ void RTCPeerConnection::createAnswer(PassRefPtr<RTCSessionDescriptionCallback> s
void RTCPeerConnection::setLocalDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
RefPtr<RTCSessionDescription> sessionDescription = prpSessionDescription;
if (!sessionDescription) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
@@ -236,13 +236,13 @@ PassRefPtr<RTCSessionDescription> RTCPeerConnection::localDescription(ExceptionC
void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
RefPtr<RTCSessionDescription> sessionDescription = prpSessionDescription;
if (!sessionDescription) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
@@ -263,7 +263,7 @@ PassRefPtr<RTCSessionDescription> RTCPeerConnection::remoteDescription(Exception
void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
@@ -277,24 +277,24 @@ void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, const Dict
bool valid = m_peerHandler->updateIce(configuration, constraints);
if (!valid)
- ec = SYNTAX_ERR;
+ ec = SyntaxError;
}
void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
if (!iceCandidate) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
bool valid = m_peerHandler->addIceCandidate(iceCandidate->webCandidate());
if (!valid)
- ec = SYNTAX_ERR;
+ ec = SyntaxError;
}
String RTCPeerConnection::signalingState() const
@@ -359,13 +359,13 @@ String RTCPeerConnection::iceConnectionState() const
void RTCPeerConnection::addStream(PassRefPtr<MediaStream> prpStream, const Dictionary& mediaConstraints, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
RefPtr<MediaStream> stream = prpStream;
if (!stream) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
@@ -380,18 +380,18 @@ void RTCPeerConnection::addStream(PassRefPtr<MediaStream> prpStream, const Dicti
bool valid = m_peerHandler->addStream(stream->descriptor(), constraints);
if (!valid)
- ec = SYNTAX_ERR;
+ ec = SyntaxError;
}
void RTCPeerConnection::removeStream(PassRefPtr<MediaStream> prpStream, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
if (!prpStream) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
@@ -441,7 +441,7 @@ void RTCPeerConnection::getStats(PassRefPtr<RTCStatsCallback> successCallback, P
PassRefPtr<RTCDataChannel> RTCPeerConnection::createDataChannel(String label, const Dictionary& options, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return 0;
}
@@ -480,7 +480,7 @@ bool RTCPeerConnection::hasLocalStreamWithTrackId(const String& trackId)
PassRefPtr<RTCDTMFSender> RTCPeerConnection::createDTMFSender(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return 0;
}
@@ -492,7 +492,7 @@ PassRefPtr<RTCDTMFSender> RTCPeerConnection::createDTMFSender(PassRefPtr<MediaSt
RefPtr<MediaStreamTrack> track = prpTrack;
if (!hasLocalStreamWithTrackId(track->id())) {
- ec = SYNTAX_ERR;
+ ec = SyntaxError;
return 0;
}
@@ -505,7 +505,7 @@ PassRefPtr<RTCDTMFSender> RTCPeerConnection::createDTMFSender(PassRefPtr<MediaSt
void RTCPeerConnection::close(ExceptionCode& ec)
{
if (m_signalingState == SignalingStateClosed) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
« no previous file with comments | « Source/modules/mediastream/RTCIceCandidate.cpp ('k') | Source/modules/mediastream/RTCSessionDescription.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698