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

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

Issue 1480953002: Drop [LegacyInterfaceTypeChecking] where trivial in WebRTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update tests Created 5 years, 1 month 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/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
index 45d8b1a5d0c21dbb42149c53829b15c1fece91e7..d762b2f78306109828be9d315d068569c5a4ce57 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -405,10 +405,7 @@ void RTCPeerConnection::setLocalDescription(RTCSessionDescription* sessionDescri
if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState))
return;
- if (!sessionDescription) {
- exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::argumentNullOrIncorrectType(1, "RTCSessionDescription"));
- return;
- }
+ ASSERT(sessionDescription);
RTCVoidRequest* request = RTCVoidRequestImpl::create(executionContext(), this, successCallback, errorCallback);
m_peerHandler->setLocalDescription(request, sessionDescription->webSessionDescription());
@@ -428,10 +425,7 @@ void RTCPeerConnection::setRemoteDescription(RTCSessionDescription* sessionDescr
if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState))
return;
- if (!sessionDescription) {
- exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::argumentNullOrIncorrectType(1, "RTCSessionDescription"));
- return;
- }
+ ASSERT(sessionDescription);
RTCVoidRequest* request = RTCVoidRequestImpl::create(executionContext(), this, successCallback, errorCallback);
m_peerHandler->setRemoteDescription(request, sessionDescription->webSessionDescription());
@@ -538,10 +532,7 @@ void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, Exception
if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState))
return;
- if (!iceCandidate) {
- exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::argumentNullOrIncorrectType(1, "RTCIceCandidate"));
- return;
- }
+ ASSERT(iceCandidate);
bool valid = m_peerHandler->addICECandidate(iceCandidate->webCandidate());
if (!valid)
@@ -553,10 +544,7 @@ void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, VoidCallb
if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState))
return;
- if (!iceCandidate) {
- exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::argumentNullOrIncorrectType(1, "RTCIceCandidate"));
- return;
- }
+ ASSERT(iceCandidate);
ASSERT(successCallback);
ASSERT(errorCallback);
@@ -749,10 +737,7 @@ RTCDTMFSender* RTCPeerConnection::createDTMFSender(MediaStreamTrack* track, Exce
if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState))
return nullptr;
- if (!track) {
- exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(1, "MediaStreamTrack"));
- return nullptr;
- }
+ ASSERT(track);
if (!hasLocalStreamWithTrackId(track->id())) {
exceptionState.throwDOMException(SyntaxError, "No local stream is available for the track provided.");

Powered by Google App Engine
This is Rietveld 408576698