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

Unified Diff: content/renderer/media/rtc_peer_connection_handler.cc

Issue 1321543002: Enable generation of local host candidate when RTCConfiguration is null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_peer_connection_handler.cc
diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc
index 06953b591538f555283f61c717b6146b75ee14f5..181838af564e9d0086921219e6c6eebed4a4e011 100644
--- a/content/renderer/media/rtc_peer_connection_handler.cc
+++ b/content/renderer/media/rtc_peer_connection_handler.cc
@@ -185,18 +185,31 @@ void GetSdpAndTypeFromSessionDescription(
void GetNativeRtcConfiguration(
const blink::WebRTCConfiguration& blink_config,
webrtc::PeerConnectionInterface::RTCConfiguration* webrtc_config) {
- if (blink_config.isNull() || !webrtc_config)
+ DCHECK_EQ(webrtc_config->enable_localhost_ice_candidate, false);
+
+ // When we don't have WebRTCConfiguration, treat it as a special case where we
+ // should generate local host candidate. This will only be honored if
+ // enable_multiple_routes is disabled.
+ if (blink_config.isNull()) {
+ webrtc_config->enable_localhost_ice_candidate = true;
return;
- for (size_t i = 0; i < blink_config.numberOfServers(); ++i) {
- webrtc::PeerConnectionInterface::IceServer server;
- const blink::WebRTCICEServer& webkit_server =
- blink_config.server(i);
- server.username =
- base::UTF16ToUTF8(base::StringPiece16(webkit_server.username()));
- server.password =
- base::UTF16ToUTF8(base::StringPiece16(webkit_server.credential()));
- server.uri = webkit_server.uri().spec();
- webrtc_config->servers.push_back(server);
+ }
+
+ if (blink_config.iceServers().isNull()) {
+ // Same as when iceServers is undefined or unspecified.
+ webrtc_config->enable_localhost_ice_candidate = true;
+ } else {
+ for (size_t i = 0; i < blink_config.iceServers().numberOfServers(); ++i) {
+ webrtc::PeerConnectionInterface::IceServer server;
+ const blink::WebRTCICEServer& webkit_server =
+ blink_config.iceServers().server(i);
+ server.username =
+ base::UTF16ToUTF8(base::StringPiece16(webkit_server.username()));
+ server.password =
+ base::UTF16ToUTF8(base::StringPiece16(webkit_server.credential()));
+ server.uri = webkit_server.uri().spec();
+ webrtc_config->servers.push_back(server);
+ }
}
switch (blink_config.iceTransports()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698