| 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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 scoped_refptr<webrtc::MediaStreamInterface> webrtc_stream; | 707 scoped_refptr<webrtc::MediaStreamInterface> webrtc_stream; |
| 708 for (ScopedVector<WebRtcMediaStreamAdapter>::iterator adapter_it = | 708 for (ScopedVector<WebRtcMediaStreamAdapter>::iterator adapter_it = |
| 709 local_streams_.begin(); adapter_it != local_streams_.end(); | 709 local_streams_.begin(); adapter_it != local_streams_.end(); |
| 710 ++adapter_it) { | 710 ++adapter_it) { |
| 711 if ((*adapter_it)->IsEqual(stream)) { | 711 if ((*adapter_it)->IsEqual(stream)) { |
| 712 webrtc_stream = (*adapter_it)->webrtc_media_stream(); | 712 webrtc_stream = (*adapter_it)->webrtc_media_stream(); |
| 713 local_streams_.erase(adapter_it); | 713 local_streams_.erase(adapter_it); |
| 714 break; | 714 break; |
| 715 } | 715 } |
| 716 } | 716 } |
| 717 DCHECK(webrtc_stream); | 717 DCHECK(webrtc_stream.get()); |
| 718 native_peer_connection_->RemoveStream(webrtc_stream); | 718 native_peer_connection_->RemoveStream(webrtc_stream.get()); |
| 719 | 719 |
| 720 if (peer_connection_tracker_) | 720 if (peer_connection_tracker_) |
| 721 peer_connection_tracker_->TrackRemoveStream( | 721 peer_connection_tracker_->TrackRemoveStream( |
| 722 this, stream, PeerConnectionTracker::SOURCE_LOCAL); | 722 this, stream, PeerConnectionTracker::SOURCE_LOCAL); |
| 723 PerSessionWebRTCAPIMetrics::GetInstance()->DecrementStreamCounter(); | 723 PerSessionWebRTCAPIMetrics::GetInstance()->DecrementStreamCounter(); |
| 724 track_metrics_.RemoveStream(MediaStreamTrackMetrics::SENT_STREAM, | 724 track_metrics_.RemoveStream(MediaStreamTrackMetrics::SENT_STREAM, |
| 725 webrtc_stream); | 725 webrtc_stream.get()); |
| 726 } | 726 } |
| 727 | 727 |
| 728 void RTCPeerConnectionHandler::getStats( | 728 void RTCPeerConnectionHandler::getStats( |
| 729 const blink::WebRTCStatsRequest& request) { | 729 const blink::WebRTCStatsRequest& request) { |
| 730 scoped_refptr<LocalRTCStatsRequest> inner_request( | 730 scoped_refptr<LocalRTCStatsRequest> inner_request( |
| 731 new rtc::RefCountedObject<LocalRTCStatsRequest>(request)); | 731 new rtc::RefCountedObject<LocalRTCStatsRequest>(request)); |
| 732 getStats(inner_request.get()); | 732 getStats(inner_request.get()); |
| 733 } | 733 } |
| 734 | 734 |
| 735 void RTCPeerConnectionHandler::getStats(LocalRTCStatsRequest* request) { | 735 void RTCPeerConnectionHandler::getStats(LocalRTCStatsRequest* request) { |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 webrtc::SessionDescriptionInterface* native_desc = | 1000 webrtc::SessionDescriptionInterface* native_desc = |
| 1001 dependency_factory_->CreateSessionDescription(type, sdp, error); | 1001 dependency_factory_->CreateSessionDescription(type, sdp, error); |
| 1002 | 1002 |
| 1003 LOG_IF(ERROR, !native_desc) << "Failed to create native session description." | 1003 LOG_IF(ERROR, !native_desc) << "Failed to create native session description." |
| 1004 << " Type: " << type << " SDP: " << sdp; | 1004 << " Type: " << type << " SDP: " << sdp; |
| 1005 | 1005 |
| 1006 return native_desc; | 1006 return native_desc; |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 } // namespace content | 1009 } // namespace content |
| OLD | NEW |