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

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

Issue 2631433002: Rename RTCPeerConnection.updateIce to setConfiguration and make it work. (Closed)
Patch Set: Rebase. Created 3 years, 11 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/peerconnection/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
index 4a24c286721e4ed3802f033fc81cacd90bc37285..a4fdecda6ddac91c6808ebf1aa3a4c37ea64afd5 100644
--- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -86,6 +86,7 @@
#include "public/platform/WebRTCConfiguration.h"
#include "public/platform/WebRTCDataChannelHandler.h"
#include "public/platform/WebRTCDataChannelInit.h"
+#include "public/platform/WebRTCError.h"
#include "public/platform/WebRTCICECandidate.h"
#include "public/platform/WebRTCKeyParams.h"
#include "public/platform/WebRTCOfferOptions.h"
@@ -789,10 +790,10 @@ RTCSessionDescription* RTCPeerConnection::remoteDescription() {
return RTCSessionDescription::create(webSessionDescription);
}
-void RTCPeerConnection::updateIce(ExecutionContext* context,
- const RTCConfiguration& rtcConfiguration,
- const Dictionary&,
- ExceptionState& exceptionState) {
+void RTCPeerConnection::setConfiguration(
+ ExecutionContext* context,
+ const RTCConfiguration& rtcConfiguration,
+ ExceptionState& exceptionState) {
if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState))
return;
@@ -808,11 +809,20 @@ void RTCPeerConnection::updateIce(ExecutionContext* context,
return;
}
- // TODO(deadbeef): When this changes to setConfiguration, call
- // m_peerHandler->setConfiguration.
- exceptionState.throwDOMException(
- SyntaxError,
- "Could not update the ICE Agent with the given configuration.");
+ WebRTCErrorType error = m_peerHandler->setConfiguration(configuration);
+ if (error != WebRTCErrorType::kNone) {
+ // All errors besides InvalidModification should have been detected above.
+ if (error == WebRTCErrorType::kInvalidModification) {
+ exceptionState.throwDOMException(
+ InvalidModificationError,
+ "Attempted to modify the PeerConnection's "
+ "configuration in an unsupported way.");
+ } else {
+ exceptionState.throwDOMException(
+ OperationError,
+ "Could not update the PeerConnection with the given configuration.");
+ }
+ }
}
ScriptPromise RTCPeerConnection::generateCertificate(

Powered by Google App Engine
This is Rietveld 408576698