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

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

Issue 1417023003: Disable test and remove the reference of enable_localhost_ice_candidate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test cases with certificates Created 5 years, 2 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/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
index 5dcf61e6ea105d298fd09c0997c1561b7d54c7fb..636342bf630479f8f69059b775bc7e3351718e6a 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -143,26 +143,17 @@ RTCConfiguration* RTCPeerConnection::parseConfiguration(const Dictionary& config
}
ArrayValue iceServers;
- size_t numberOfServers = 0;
- bool createIceServerArray = true;
- if (DictionaryHelper::get(configuration, "iceServers", iceServers)) {
- if (!iceServers.length(numberOfServers)) {
- exceptionState.throwTypeError("Malformed RTCConfiguration");
- return 0;
- }
- } else {
- v8::Local<v8::Value> iceServersValue;
- // Failed to parse iceServers as ArrayValue, try it as a scalar. If
- // iceServers is not specified (get returns false) or specified as
- // "undefined", treat it as the special case which RTCIceServerArray
- // will not be created.
- bool ok = (!DictionaryHelper::get(configuration, "iceServers", iceServersValue)
- || iceServersValue->IsUndefined());
- if (!ok) {
- exceptionState.throwTypeError("Malformed RTCConfiguration");
- return 0;
- }
- createIceServerArray = false;
+ bool ok = DictionaryHelper::get(configuration, "iceServers", iceServers);
+ if (!ok || iceServers.isUndefinedOrNull()) {
+ exceptionState.throwTypeError("Malformed RTCConfiguration");
+ return 0;
+ }
+
+ size_t numberOfServers;
+ ok = iceServers.length(numberOfServers);
+ if (!ok) {
+ exceptionState.throwTypeError("Malformed RTCConfiguration");
+ return 0;
}
RTCBundlePolicy bundlePolicy = RTCBundlePolicyBalanced;
@@ -193,13 +184,10 @@ RTCConfiguration* RTCPeerConnection::parseConfiguration(const Dictionary& config
rtcConfiguration->setIceTransports(iceTransports);
rtcConfiguration->setBundlePolicy(bundlePolicy);
rtcConfiguration->setRtcpMuxPolicy(rtcpMuxPolicy);
- if (createIceServerArray) {
- rtcConfiguration->setIceServers(RTCIceServerArray::create());
- }
for (size_t i = 0; i < numberOfServers; ++i) {
Dictionary iceServer;
- bool ok = iceServers.get(i, iceServer);
+ ok = iceServers.get(i, iceServer);
if (!ok) {
exceptionState.throwTypeError("Malformed RTCIceServer");
return 0;
@@ -243,7 +231,7 @@ RTCConfiguration* RTCPeerConnection::parseConfiguration(const Dictionary& config
return 0;
}
- rtcConfiguration->iceServers()->appendServer(RTCIceServer::create(url, username, credential));
+ rtcConfiguration->appendServer(RTCIceServer::create(url, username, credential));
}
}

Powered by Google App Engine
This is Rietveld 408576698