| 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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 } | 761 } |
| 762 | 762 |
| 763 main_thread_->PostTask(FROM_HERE, | 763 main_thread_->PostTask(FROM_HERE, |
| 764 base::Bind(&RTCPeerConnectionHandler::Observer::OnIceCandidateImpl, | 764 base::Bind(&RTCPeerConnectionHandler::Observer::OnIceCandidateImpl, |
| 765 this, sdp, candidate->sdp_mid(), candidate->sdp_mline_index(), | 765 this, sdp, candidate->sdp_mid(), candidate->sdp_mline_index(), |
| 766 candidate->candidate().component(), | 766 candidate->candidate().component(), |
| 767 candidate->candidate().address().family())); | 767 candidate->candidate().address().family())); |
| 768 } | 768 } |
| 769 | 769 |
| 770 void OnAddStreamImpl(scoped_ptr<RemoteMediaStreamImpl> stream) { | 770 void OnAddStreamImpl(scoped_ptr<RemoteMediaStreamImpl> stream) { |
| 771 DCHECK(stream->webkit_stream().extraData()) << "Initialization not done"; | 771 DCHECK(stream->webkit_stream().getExtraData()) << "Initialization not done"; |
| 772 if (handler_) | 772 if (handler_) |
| 773 handler_->OnAddStream(std::move(stream)); | 773 handler_->OnAddStream(std::move(stream)); |
| 774 } | 774 } |
| 775 | 775 |
| 776 void OnRemoveStreamImpl(const scoped_refptr<MediaStreamInterface>& stream) { | 776 void OnRemoveStreamImpl(const scoped_refptr<MediaStreamInterface>& stream) { |
| 777 if (handler_) | 777 if (handler_) |
| 778 handler_->OnRemoveStream(stream); | 778 handler_->OnRemoveStream(stream); |
| 779 } | 779 } |
| 780 | 780 |
| 781 void OnDataChannelImpl(scoped_ptr<RtcDataChannelHandler> handler) { | 781 void OnDataChannelImpl(scoped_ptr<RtcDataChannelHandler> handler) { |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 peer_connection_tracker_->TrackOnRenegotiationNeeded(this); | 1491 peer_connection_tracker_->TrackOnRenegotiationNeeded(this); |
| 1492 if (!is_closed_) | 1492 if (!is_closed_) |
| 1493 client_->negotiationNeeded(); | 1493 client_->negotiationNeeded(); |
| 1494 } | 1494 } |
| 1495 | 1495 |
| 1496 void RTCPeerConnectionHandler::OnAddStream( | 1496 void RTCPeerConnectionHandler::OnAddStream( |
| 1497 scoped_ptr<RemoteMediaStreamImpl> stream) { | 1497 scoped_ptr<RemoteMediaStreamImpl> stream) { |
| 1498 DCHECK(thread_checker_.CalledOnValidThread()); | 1498 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1499 DCHECK(remote_streams_.find(stream->webrtc_stream().get()) == | 1499 DCHECK(remote_streams_.find(stream->webrtc_stream().get()) == |
| 1500 remote_streams_.end()); | 1500 remote_streams_.end()); |
| 1501 DCHECK(stream->webkit_stream().extraData()) << "Initialization not done"; | 1501 DCHECK(stream->webkit_stream().getExtraData()) << "Initialization not done"; |
| 1502 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnAddStreamImpl"); | 1502 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnAddStreamImpl"); |
| 1503 | 1503 |
| 1504 // Ownership is with remote_streams_ now. | 1504 // Ownership is with remote_streams_ now. |
| 1505 RemoteMediaStreamImpl* s = stream.release(); | 1505 RemoteMediaStreamImpl* s = stream.release(); |
| 1506 remote_streams_.insert( | 1506 remote_streams_.insert( |
| 1507 std::pair<webrtc::MediaStreamInterface*, RemoteMediaStreamImpl*> ( | 1507 std::pair<webrtc::MediaStreamInterface*, RemoteMediaStreamImpl*> ( |
| 1508 s->webrtc_stream().get(), s)); | 1508 s->webrtc_stream().get(), s)); |
| 1509 | 1509 |
| 1510 if (peer_connection_tracker_) { | 1510 if (peer_connection_tracker_) { |
| 1511 peer_connection_tracker_->TrackAddStream( | 1511 peer_connection_tracker_->TrackAddStream( |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 } | 1671 } |
| 1672 | 1672 |
| 1673 void RTCPeerConnectionHandler::ResetUMAStats() { | 1673 void RTCPeerConnectionHandler::ResetUMAStats() { |
| 1674 DCHECK(thread_checker_.CalledOnValidThread()); | 1674 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1675 num_local_candidates_ipv6_ = 0; | 1675 num_local_candidates_ipv6_ = 0; |
| 1676 num_local_candidates_ipv4_ = 0; | 1676 num_local_candidates_ipv4_ = 0; |
| 1677 ice_connection_checking_start_ = base::TimeTicks(); | 1677 ice_connection_checking_start_ = base::TimeTicks(); |
| 1678 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); | 1678 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); |
| 1679 } | 1679 } |
| 1680 } // namespace content | 1680 } // namespace content |
| OLD | NEW |