OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/rtc_peer_connection_handler.h" | 5 #include "content/renderer/media/rtc_peer_connection_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 description->ToString(sdp); | 178 description->ToString(sdp); |
179 *type = description->type(); | 179 *type = description->type(); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 // Converter functions from WebKit types to WebRTC types. | 183 // Converter functions from WebKit types to WebRTC types. |
184 | 184 |
185 void GetNativeRtcConfiguration( | 185 void GetNativeRtcConfiguration( |
186 const blink::WebRTCConfiguration& blink_config, | 186 const blink::WebRTCConfiguration& blink_config, |
187 webrtc::PeerConnectionInterface::RTCConfiguration* webrtc_config) { | 187 webrtc::PeerConnectionInterface::RTCConfiguration* webrtc_config) { |
188 if (blink_config.isNull() || !webrtc_config) | 188 if (!webrtc_config) |
189 return; | 189 return; |
190 | |
191 // When we don't have WebRTCConfiguration, treat it as a special case where we | |
192 // should generate local host candidate. This will only be honored if | |
193 // enable_multiple_routes is disabled. | |
194 if (blink_config.isNull()) { | |
195 webrtc_config->enable_localhost_ice_candidate = true; | |
juberti1
2015/08/26 22:49:45
I think we might also want this when iceServers is
| |
196 return; | |
197 } | |
198 | |
190 for (size_t i = 0; i < blink_config.numberOfServers(); ++i) { | 199 for (size_t i = 0; i < blink_config.numberOfServers(); ++i) { |
191 webrtc::PeerConnectionInterface::IceServer server; | 200 webrtc::PeerConnectionInterface::IceServer server; |
192 const blink::WebRTCICEServer& webkit_server = | 201 const blink::WebRTCICEServer& webkit_server = |
193 blink_config.server(i); | 202 blink_config.server(i); |
194 server.username = | 203 server.username = |
195 base::UTF16ToUTF8(base::StringPiece16(webkit_server.username())); | 204 base::UTF16ToUTF8(base::StringPiece16(webkit_server.username())); |
196 server.password = | 205 server.password = |
197 base::UTF16ToUTF8(base::StringPiece16(webkit_server.credential())); | 206 base::UTF16ToUTF8(base::StringPiece16(webkit_server.credential())); |
198 server.uri = webkit_server.uri().spec(); | 207 server.uri = webkit_server.uri().spec(); |
199 webrtc_config->servers.push_back(server); | 208 webrtc_config->servers.push_back(server); |
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1611 } | 1620 } |
1612 | 1621 |
1613 void RTCPeerConnectionHandler::ResetUMAStats() { | 1622 void RTCPeerConnectionHandler::ResetUMAStats() { |
1614 DCHECK(thread_checker_.CalledOnValidThread()); | 1623 DCHECK(thread_checker_.CalledOnValidThread()); |
1615 num_local_candidates_ipv6_ = 0; | 1624 num_local_candidates_ipv6_ = 0; |
1616 num_local_candidates_ipv4_ = 0; | 1625 num_local_candidates_ipv4_ = 0; |
1617 ice_connection_checking_start_ = base::TimeTicks(); | 1626 ice_connection_checking_start_ = base::TimeTicks(); |
1618 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); | 1627 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); |
1619 } | 1628 } |
1620 } // namespace content | 1629 } // namespace content |
OLD | NEW |