| 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.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 return WebRTCPeerConnectionHandlerClient::SignalingStateClosed; | 131 return WebRTCPeerConnectionHandlerClient::SignalingStateClosed; |
| 132 default: | 132 default: |
| 133 NOTREACHED(); | 133 NOTREACHED(); |
| 134 return WebRTCPeerConnectionHandlerClient::SignalingStateClosed; | 134 return WebRTCPeerConnectionHandlerClient::SignalingStateClosed; |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 blink::WebRTCSessionDescription CreateWebKitSessionDescription( | 138 blink::WebRTCSessionDescription CreateWebKitSessionDescription( |
| 139 const std::string& sdp, const std::string& type) { | 139 const std::string& sdp, const std::string& type) { |
| 140 blink::WebRTCSessionDescription description; | 140 blink::WebRTCSessionDescription description; |
| 141 description.initialize(base::UTF8ToUTF16(type), base::UTF8ToUTF16(sdp)); | 141 description.initialize(blink::WebString::fromUTF8(type), |
| 142 blink::WebString::fromUTF8(sdp)); |
| 142 return description; | 143 return description; |
| 143 } | 144 } |
| 144 | 145 |
| 145 blink::WebRTCSessionDescription | 146 blink::WebRTCSessionDescription |
| 146 CreateWebKitSessionDescription( | 147 CreateWebKitSessionDescription( |
| 147 const webrtc::SessionDescriptionInterface* native_desc) { | 148 const webrtc::SessionDescriptionInterface* native_desc) { |
| 148 if (!native_desc) { | 149 if (!native_desc) { |
| 149 LOG(ERROR) << "Native session description is null."; | 150 LOG(ERROR) << "Native session description is null."; |
| 150 return blink::WebRTCSessionDescription(); | 151 return blink::WebRTCSessionDescription(); |
| 151 } | 152 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 190 |
| 190 // Converter functions from Blink types to WebRTC types. | 191 // Converter functions from Blink types to WebRTC types. |
| 191 | 192 |
| 192 void GetNativeRtcConfiguration( | 193 void GetNativeRtcConfiguration( |
| 193 const blink::WebRTCConfiguration& blink_config, | 194 const blink::WebRTCConfiguration& blink_config, |
| 194 webrtc::PeerConnectionInterface::RTCConfiguration* webrtc_config) { | 195 webrtc::PeerConnectionInterface::RTCConfiguration* webrtc_config) { |
| 195 DCHECK(webrtc_config); | 196 DCHECK(webrtc_config); |
| 196 | 197 |
| 197 for (const blink::WebRTCIceServer& blink_server : blink_config.iceServers) { | 198 for (const blink::WebRTCIceServer& blink_server : blink_config.iceServers) { |
| 198 webrtc::PeerConnectionInterface::IceServer server; | 199 webrtc::PeerConnectionInterface::IceServer server; |
| 199 server.username = | 200 server.username = blink_server.username.utf8(); |
| 200 base::UTF16ToUTF8(base::StringPiece16(blink_server.username)); | 201 server.password = blink_server.credential.utf8(); |
| 201 server.password = | |
| 202 base::UTF16ToUTF8(base::StringPiece16(blink_server.credential)); | |
| 203 server.uri = blink_server.url.string().utf8(); | 202 server.uri = blink_server.url.string().utf8(); |
| 204 webrtc_config->servers.push_back(server); | 203 webrtc_config->servers.push_back(server); |
| 205 } | 204 } |
| 206 | 205 |
| 207 switch (blink_config.iceTransportPolicy) { | 206 switch (blink_config.iceTransportPolicy) { |
| 208 case blink::WebRTCIceTransportPolicy::kNone: | 207 case blink::WebRTCIceTransportPolicy::kNone: |
| 209 webrtc_config->type = webrtc::PeerConnectionInterface::kNone; | 208 webrtc_config->type = webrtc::PeerConnectionInterface::kNone; |
| 210 break; | 209 break; |
| 211 case blink::WebRTCIceTransportPolicy::kRelay: | 210 case blink::WebRTCIceTransportPolicy::kRelay: |
| 212 webrtc_config->type = webrtc::PeerConnectionInterface::kRelay; | 211 webrtc_config->type = webrtc::PeerConnectionInterface::kRelay; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 delete desc; | 376 delete desc; |
| 378 } | 377 } |
| 379 void OnFailure(const std::string& error) override { | 378 void OnFailure(const std::string& error) override { |
| 380 if (!main_thread_->BelongsToCurrentThread()) { | 379 if (!main_thread_->BelongsToCurrentThread()) { |
| 381 main_thread_->PostTask(FROM_HERE, | 380 main_thread_->PostTask(FROM_HERE, |
| 382 base::Bind(&CreateSessionDescriptionRequest::OnFailure, this, error)); | 381 base::Bind(&CreateSessionDescriptionRequest::OnFailure, this, error)); |
| 383 return; | 382 return; |
| 384 } | 383 } |
| 385 | 384 |
| 386 tracker_.TrackOnFailure(error); | 385 tracker_.TrackOnFailure(error); |
| 387 webkit_request_.requestFailed(base::UTF8ToUTF16(error)); | 386 webkit_request_.requestFailed(blink::WebString::fromUTF8(error)); |
| 388 webkit_request_.reset(); | 387 webkit_request_.reset(); |
| 389 } | 388 } |
| 390 | 389 |
| 391 protected: | 390 protected: |
| 392 ~CreateSessionDescriptionRequest() override { | 391 ~CreateSessionDescriptionRequest() override { |
| 393 // This object is reference counted and its callback methods |OnSuccess| and | 392 // This object is reference counted and its callback methods |OnSuccess| and |
| 394 // |OnFailure| will be invoked on libjingle's signaling thread and posted to | 393 // |OnFailure| will be invoked on libjingle's signaling thread and posted to |
| 395 // the main thread. Since the main thread may complete before the signaling | 394 // the main thread. Since the main thread may complete before the signaling |
| 396 // thread has deferenced this object there is no guarantee that this object | 395 // thread has deferenced this object there is no guarantee that this object |
| 397 // is destructed on the main thread. | 396 // is destructed on the main thread. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 webkit_request_.requestSucceeded(); | 429 webkit_request_.requestSucceeded(); |
| 431 webkit_request_.reset(); | 430 webkit_request_.reset(); |
| 432 } | 431 } |
| 433 void OnFailure(const std::string& error) override { | 432 void OnFailure(const std::string& error) override { |
| 434 if (!main_thread_->BelongsToCurrentThread()) { | 433 if (!main_thread_->BelongsToCurrentThread()) { |
| 435 main_thread_->PostTask(FROM_HERE, | 434 main_thread_->PostTask(FROM_HERE, |
| 436 base::Bind(&SetSessionDescriptionRequest::OnFailure, this, error)); | 435 base::Bind(&SetSessionDescriptionRequest::OnFailure, this, error)); |
| 437 return; | 436 return; |
| 438 } | 437 } |
| 439 tracker_.TrackOnFailure(error); | 438 tracker_.TrackOnFailure(error); |
| 440 webkit_request_.requestFailed(base::UTF8ToUTF16(error)); | 439 webkit_request_.requestFailed(blink::WebString::fromUTF8(error)); |
| 441 webkit_request_.reset(); | 440 webkit_request_.reset(); |
| 442 } | 441 } |
| 443 | 442 |
| 444 protected: | 443 protected: |
| 445 ~SetSessionDescriptionRequest() override { | 444 ~SetSessionDescriptionRequest() override { |
| 446 // This object is reference counted and its callback methods |OnSuccess| and | 445 // This object is reference counted and its callback methods |OnSuccess| and |
| 447 // |OnFailure| will be invoked on libjingle's signaling thread and posted to | 446 // |OnFailure| will be invoked on libjingle's signaling thread and posted to |
| 448 // the main thread. Since the main thread may complete before the signaling | 447 // the main thread. Since the main thread may complete before the signaling |
| 449 // thread has deferenced this object there is no guarantee that this object | 448 // thread has deferenced this object there is no guarantee that this object |
| 450 // is destructed on the main thread. | 449 // is destructed on the main thread. |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 DCHECK(native_desc); | 1232 DCHECK(native_desc); |
| 1234 return native_desc->type() == "offer" || native_desc->type() == "answer"; | 1233 return native_desc->type() == "offer" || native_desc->type() == "answer"; |
| 1235 } | 1234 } |
| 1236 | 1235 |
| 1237 void RTCPeerConnectionHandler::setLocalDescription( | 1236 void RTCPeerConnectionHandler::setLocalDescription( |
| 1238 const blink::WebRTCVoidRequest& request, | 1237 const blink::WebRTCVoidRequest& request, |
| 1239 const blink::WebRTCSessionDescription& description) { | 1238 const blink::WebRTCSessionDescription& description) { |
| 1240 DCHECK(thread_checker_.CalledOnValidThread()); | 1239 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1241 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::setLocalDescription"); | 1240 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::setLocalDescription"); |
| 1242 | 1241 |
| 1243 std::string sdp = base::UTF16ToUTF8(base::StringPiece16(description.sdp())); | 1242 std::string sdp = description.sdp().utf8(); |
| 1244 std::string type = | 1243 std::string type = description.type().utf8(); |
| 1245 base::UTF16ToUTF8(base::StringPiece16(description.type())); | |
| 1246 | 1244 |
| 1247 webrtc::SdpParseError error; | 1245 webrtc::SdpParseError error; |
| 1248 // Since CreateNativeSessionDescription uses the dependency factory, we need | 1246 // Since CreateNativeSessionDescription uses the dependency factory, we need |
| 1249 // to make this call on the current thread to be safe. | 1247 // to make this call on the current thread to be safe. |
| 1250 webrtc::SessionDescriptionInterface* native_desc = | 1248 webrtc::SessionDescriptionInterface* native_desc = |
| 1251 CreateNativeSessionDescription(sdp, type, &error); | 1249 CreateNativeSessionDescription(sdp, type, &error); |
| 1252 if (!native_desc) { | 1250 if (!native_desc) { |
| 1253 std::string reason_str = "Failed to parse SessionDescription. "; | 1251 std::string reason_str = "Failed to parse SessionDescription. "; |
| 1254 reason_str.append(error.line); | 1252 reason_str.append(error.line); |
| 1255 reason_str.append(" "); | 1253 reason_str.append(" "); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 native_peer_connection_, base::RetainedRef(set_request), | 1285 native_peer_connection_, base::RetainedRef(set_request), |
| 1288 base::Unretained(native_desc)), | 1286 base::Unretained(native_desc)), |
| 1289 "SetLocalDescription")); | 1287 "SetLocalDescription")); |
| 1290 } | 1288 } |
| 1291 | 1289 |
| 1292 void RTCPeerConnectionHandler::setRemoteDescription( | 1290 void RTCPeerConnectionHandler::setRemoteDescription( |
| 1293 const blink::WebRTCVoidRequest& request, | 1291 const blink::WebRTCVoidRequest& request, |
| 1294 const blink::WebRTCSessionDescription& description) { | 1292 const blink::WebRTCSessionDescription& description) { |
| 1295 DCHECK(thread_checker_.CalledOnValidThread()); | 1293 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1296 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::setRemoteDescription"); | 1294 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::setRemoteDescription"); |
| 1297 std::string sdp = base::UTF16ToUTF8(base::StringPiece16(description.sdp())); | 1295 std::string sdp = description.sdp().utf8(); |
| 1298 std::string type = | 1296 std::string type = description.type().utf8(); |
| 1299 base::UTF16ToUTF8(base::StringPiece16(description.type())); | |
| 1300 | 1297 |
| 1301 webrtc::SdpParseError error; | 1298 webrtc::SdpParseError error; |
| 1302 // Since CreateNativeSessionDescription uses the dependency factory, we need | 1299 // Since CreateNativeSessionDescription uses the dependency factory, we need |
| 1303 // to make this call on the current thread to be safe. | 1300 // to make this call on the current thread to be safe. |
| 1304 webrtc::SessionDescriptionInterface* native_desc = | 1301 webrtc::SessionDescriptionInterface* native_desc = |
| 1305 CreateNativeSessionDescription(sdp, type, &error); | 1302 CreateNativeSessionDescription(sdp, type, &error); |
| 1306 if (!native_desc) { | 1303 if (!native_desc) { |
| 1307 std::string reason_str = "Failed to parse SessionDescription. "; | 1304 std::string reason_str = "Failed to parse SessionDescription. "; |
| 1308 reason_str.append(error.line); | 1305 reason_str.append(error.line); |
| 1309 reason_str.append(" "); | 1306 reason_str.append(" "); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 weak_factory_.GetWeakPtr(), request, result)); | 1415 weak_factory_.GetWeakPtr(), request, result)); |
| 1419 // On failure callback will be triggered. | 1416 // On failure callback will be triggered. |
| 1420 return true; | 1417 return true; |
| 1421 } | 1418 } |
| 1422 | 1419 |
| 1423 bool RTCPeerConnectionHandler::addICECandidate( | 1420 bool RTCPeerConnectionHandler::addICECandidate( |
| 1424 const blink::WebRTCICECandidate& candidate) { | 1421 const blink::WebRTCICECandidate& candidate) { |
| 1425 DCHECK(thread_checker_.CalledOnValidThread()); | 1422 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1426 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::addICECandidate"); | 1423 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::addICECandidate"); |
| 1427 std::unique_ptr<webrtc::IceCandidateInterface> native_candidate( | 1424 std::unique_ptr<webrtc::IceCandidateInterface> native_candidate( |
| 1428 dependency_factory_->CreateIceCandidate( | 1425 dependency_factory_->CreateIceCandidate(candidate.sdpMid().utf8(), |
| 1429 base::UTF16ToUTF8(base::StringPiece16(candidate.sdpMid())), | 1426 candidate.sdpMLineIndex(), |
| 1430 candidate.sdpMLineIndex(), | 1427 candidate.candidate().utf8())); |
| 1431 base::UTF16ToUTF8(base::StringPiece16(candidate.candidate())))); | |
| 1432 bool return_value = false; | 1428 bool return_value = false; |
| 1433 | 1429 |
| 1434 if (native_candidate) { | 1430 if (native_candidate) { |
| 1435 return_value = | 1431 return_value = |
| 1436 native_peer_connection_->AddIceCandidate(native_candidate.get()); | 1432 native_peer_connection_->AddIceCandidate(native_candidate.get()); |
| 1437 LOG_IF(ERROR, !return_value) << "Error processing ICE candidate."; | 1433 LOG_IF(ERROR, !return_value) << "Error processing ICE candidate."; |
| 1438 } else { | 1434 } else { |
| 1439 LOG(ERROR) << "Could not create native ICE candidate."; | 1435 LOG(ERROR) << "Could not create native ICE candidate."; |
| 1440 } | 1436 } |
| 1441 | 1437 |
| 1442 if (peer_connection_tracker_) { | 1438 if (peer_connection_tracker_) { |
| 1443 peer_connection_tracker_->TrackAddIceCandidate( | 1439 peer_connection_tracker_->TrackAddIceCandidate( |
| 1444 this, candidate, PeerConnectionTracker::SOURCE_REMOTE, return_value); | 1440 this, candidate, PeerConnectionTracker::SOURCE_REMOTE, return_value); |
| 1445 } | 1441 } |
| 1446 return return_value; | 1442 return return_value; |
| 1447 } | 1443 } |
| 1448 | 1444 |
| 1449 void RTCPeerConnectionHandler::OnaddICECandidateResult( | 1445 void RTCPeerConnectionHandler::OnaddICECandidateResult( |
| 1450 const blink::WebRTCVoidRequest& webkit_request, bool result) { | 1446 const blink::WebRTCVoidRequest& webkit_request, bool result) { |
| 1451 DCHECK(thread_checker_.CalledOnValidThread()); | 1447 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1452 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnaddICECandidateResult"); | 1448 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnaddICECandidateResult"); |
| 1453 if (!result) { | 1449 if (!result) { |
| 1454 // We don't have the actual error code from the libjingle, so for now | 1450 // We don't have the actual error code from the libjingle, so for now |
| 1455 // using a generic error string. | 1451 // using a generic error string. |
| 1456 return webkit_request.requestFailed( | 1452 return webkit_request.requestFailed( |
| 1457 base::UTF8ToUTF16("Error processing ICE candidate")); | 1453 blink::WebString::fromUTF8("Error processing ICE candidate")); |
| 1458 } | 1454 } |
| 1459 | 1455 |
| 1460 return webkit_request.requestSucceeded(); | 1456 return webkit_request.requestSucceeded(); |
| 1461 } | 1457 } |
| 1462 | 1458 |
| 1463 bool RTCPeerConnectionHandler::addStream( | 1459 bool RTCPeerConnectionHandler::addStream( |
| 1464 const blink::WebMediaStream& stream, | 1460 const blink::WebMediaStream& stream, |
| 1465 const blink::WebMediaConstraints& options) { | 1461 const blink::WebMediaConstraints& options) { |
| 1466 DCHECK(thread_checker_.CalledOnValidThread()); | 1462 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1467 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::addStream"); | 1463 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::addStream"); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 | 1595 |
| 1600 void RTCPeerConnectionHandler::StopEventLog() { | 1596 void RTCPeerConnectionHandler::StopEventLog() { |
| 1601 DCHECK(thread_checker_.CalledOnValidThread()); | 1597 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1602 native_peer_connection_->StopRtcEventLog(); | 1598 native_peer_connection_->StopRtcEventLog(); |
| 1603 } | 1599 } |
| 1604 | 1600 |
| 1605 blink::WebRTCDataChannelHandler* RTCPeerConnectionHandler::createDataChannel( | 1601 blink::WebRTCDataChannelHandler* RTCPeerConnectionHandler::createDataChannel( |
| 1606 const blink::WebString& label, const blink::WebRTCDataChannelInit& init) { | 1602 const blink::WebString& label, const blink::WebRTCDataChannelInit& init) { |
| 1607 DCHECK(thread_checker_.CalledOnValidThread()); | 1603 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1608 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::createDataChannel"); | 1604 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::createDataChannel"); |
| 1609 DVLOG(1) << "createDataChannel label " | 1605 DVLOG(1) << "createDataChannel label " << label.utf8(); |
| 1610 << base::UTF16ToUTF8(base::StringPiece16(label)); | |
| 1611 | 1606 |
| 1612 webrtc::DataChannelInit config; | 1607 webrtc::DataChannelInit config; |
| 1613 // TODO(jiayl): remove the deprecated reliable field once Libjingle is updated | 1608 // TODO(jiayl): remove the deprecated reliable field once Libjingle is updated |
| 1614 // to handle that. | 1609 // to handle that. |
| 1615 config.reliable = false; | 1610 config.reliable = false; |
| 1616 config.id = init.id; | 1611 config.id = init.id; |
| 1617 config.ordered = init.ordered; | 1612 config.ordered = init.ordered; |
| 1618 config.negotiated = init.negotiated; | 1613 config.negotiated = init.negotiated; |
| 1619 config.maxRetransmits = init.maxRetransmits; | 1614 config.maxRetransmits = init.maxRetransmits; |
| 1620 config.maxRetransmitTime = init.maxRetransmitTime; | 1615 config.maxRetransmitTime = init.maxRetransmitTime; |
| 1621 config.protocol = base::UTF16ToUTF8(base::StringPiece16(init.protocol)); | 1616 config.protocol = init.protocol.utf8(); |
| 1622 | 1617 |
| 1623 rtc::scoped_refptr<webrtc::DataChannelInterface> webrtc_channel( | 1618 rtc::scoped_refptr<webrtc::DataChannelInterface> webrtc_channel( |
| 1624 native_peer_connection_->CreateDataChannel( | 1619 native_peer_connection_->CreateDataChannel(label.utf8(), &config)); |
| 1625 base::UTF16ToUTF8(base::StringPiece16(label)), &config)); | |
| 1626 if (!webrtc_channel) { | 1620 if (!webrtc_channel) { |
| 1627 DLOG(ERROR) << "Could not create native data channel."; | 1621 DLOG(ERROR) << "Could not create native data channel."; |
| 1628 return NULL; | 1622 return NULL; |
| 1629 } | 1623 } |
| 1630 if (peer_connection_tracker_) { | 1624 if (peer_connection_tracker_) { |
| 1631 peer_connection_tracker_->TrackCreateDataChannel( | 1625 peer_connection_tracker_->TrackCreateDataChannel( |
| 1632 this, webrtc_channel.get(), PeerConnectionTracker::SOURCE_LOCAL); | 1626 this, webrtc_channel.get(), PeerConnectionTracker::SOURCE_LOCAL); |
| 1633 } | 1627 } |
| 1634 | 1628 |
| 1635 ++num_data_channels_created_; | 1629 ++num_data_channels_created_; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 if (!is_closed_) | 1838 if (!is_closed_) |
| 1845 client_->didAddRemoteDataChannel(handler.release()); | 1839 client_->didAddRemoteDataChannel(handler.release()); |
| 1846 } | 1840 } |
| 1847 | 1841 |
| 1848 void RTCPeerConnectionHandler::OnIceCandidate( | 1842 void RTCPeerConnectionHandler::OnIceCandidate( |
| 1849 const std::string& sdp, const std::string& sdp_mid, int sdp_mline_index, | 1843 const std::string& sdp, const std::string& sdp_mid, int sdp_mline_index, |
| 1850 int component, int address_family) { | 1844 int component, int address_family) { |
| 1851 DCHECK(thread_checker_.CalledOnValidThread()); | 1845 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1852 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnIceCandidateImpl"); | 1846 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnIceCandidateImpl"); |
| 1853 blink::WebRTCICECandidate web_candidate; | 1847 blink::WebRTCICECandidate web_candidate; |
| 1854 web_candidate.initialize(base::UTF8ToUTF16(sdp), | 1848 web_candidate.initialize(blink::WebString::fromUTF8(sdp), |
| 1855 base::UTF8ToUTF16(sdp_mid), | 1849 blink::WebString::fromUTF8(sdp_mid), |
| 1856 sdp_mline_index); | 1850 sdp_mline_index); |
| 1857 if (peer_connection_tracker_) { | 1851 if (peer_connection_tracker_) { |
| 1858 peer_connection_tracker_->TrackAddIceCandidate( | 1852 peer_connection_tracker_->TrackAddIceCandidate( |
| 1859 this, web_candidate, PeerConnectionTracker::SOURCE_LOCAL, true); | 1853 this, web_candidate, PeerConnectionTracker::SOURCE_LOCAL, true); |
| 1860 } | 1854 } |
| 1861 | 1855 |
| 1862 // Only the first m line's first component is tracked to avoid | 1856 // Only the first m line's first component is tracked to avoid |
| 1863 // miscounting when doing BUNDLE or rtcp mux. | 1857 // miscounting when doing BUNDLE or rtcp mux. |
| 1864 if (sdp_mline_index == 0 && component == 1) { | 1858 if (sdp_mline_index == 0 && component == 1) { |
| 1865 if (address_family == AF_INET) { | 1859 if (address_family == AF_INET) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1955 } | 1949 } |
| 1956 | 1950 |
| 1957 void RTCPeerConnectionHandler::ResetUMAStats() { | 1951 void RTCPeerConnectionHandler::ResetUMAStats() { |
| 1958 DCHECK(thread_checker_.CalledOnValidThread()); | 1952 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1959 num_local_candidates_ipv6_ = 0; | 1953 num_local_candidates_ipv6_ = 0; |
| 1960 num_local_candidates_ipv4_ = 0; | 1954 num_local_candidates_ipv4_ = 0; |
| 1961 ice_connection_checking_start_ = base::TimeTicks(); | 1955 ice_connection_checking_start_ = base::TimeTicks(); |
| 1962 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); | 1956 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); |
| 1963 } | 1957 } |
| 1964 } // namespace content | 1958 } // namespace content |
| OLD | NEW |