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 #ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
6 #define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 const scoped_refptr<webrtc::MediaStreamInterface>& stream); | 197 const scoped_refptr<webrtc::MediaStreamInterface>& stream); |
198 void OnDataChannel(scoped_ptr<RtcDataChannelHandler> handler); | 198 void OnDataChannel(scoped_ptr<RtcDataChannelHandler> handler); |
199 void OnIceCandidate(const std::string& sdp, const std::string& sdp_mid, | 199 void OnIceCandidate(const std::string& sdp, const std::string& sdp_mid, |
200 int sdp_mline_index, int component, int address_family); | 200 int sdp_mline_index, int component, int address_family); |
201 | 201 |
202 private: | 202 private: |
203 webrtc::SessionDescriptionInterface* CreateNativeSessionDescription( | 203 webrtc::SessionDescriptionInterface* CreateNativeSessionDescription( |
204 const std::string& sdp, const std::string& type, | 204 const std::string& sdp, const std::string& type, |
205 webrtc::SdpParseError* error); | 205 webrtc::SdpParseError* error); |
206 | 206 |
| 207 // Report to UMA whether an IceConnectionState has occurred. It only records |
| 208 // the first occurrence of a given state. |
| 209 void ReportICEState( |
| 210 webrtc::PeerConnectionInterface::IceConnectionState new_state); |
| 211 |
| 212 // Reset UMA related members to the initial state. This is invoked at the |
| 213 // constructor as well as after Ice Restart. |
| 214 void ResetUMAStats(); |
| 215 |
207 // Virtual to allow mocks to override. | 216 // Virtual to allow mocks to override. |
208 virtual scoped_refptr<base::SingleThreadTaskRunner> signaling_thread() const; | 217 virtual scoped_refptr<base::SingleThreadTaskRunner> signaling_thread() const; |
209 | 218 |
210 void RunSynchronousClosureOnSignalingThread(const base::Closure& closure, | 219 void RunSynchronousClosureOnSignalingThread(const base::Closure& closure, |
211 const char* trace_event_name); | 220 const char* trace_event_name); |
212 | 221 |
213 base::ThreadChecker thread_checker_; | 222 base::ThreadChecker thread_checker_; |
214 | 223 |
215 // |client_| is a weak pointer, and is valid until stop() has returned. | 224 // |client_| is a weak pointer, and is valid until stop() has returned. |
216 blink::WebRTCPeerConnectionHandlerClient* client_; | 225 blink::WebRTCPeerConnectionHandlerClient* client_; |
(...skipping 22 matching lines...) Expand all Loading... |
239 scoped_refptr<Observer> peer_connection_observer_; | 248 scoped_refptr<Observer> peer_connection_observer_; |
240 | 249 |
241 // |native_peer_connection_| is the libjingle native PeerConnection object. | 250 // |native_peer_connection_| is the libjingle native PeerConnection object. |
242 scoped_refptr<webrtc::PeerConnectionInterface> native_peer_connection_; | 251 scoped_refptr<webrtc::PeerConnectionInterface> native_peer_connection_; |
243 | 252 |
244 typedef std::map<webrtc::MediaStreamInterface*, | 253 typedef std::map<webrtc::MediaStreamInterface*, |
245 content::RemoteMediaStreamImpl*> RemoteStreamMap; | 254 content::RemoteMediaStreamImpl*> RemoteStreamMap; |
246 RemoteStreamMap remote_streams_; | 255 RemoteStreamMap remote_streams_; |
247 scoped_refptr<webrtc::UMAObserver> uma_observer_; | 256 scoped_refptr<webrtc::UMAObserver> uma_observer_; |
248 base::TimeTicks ice_connection_checking_start_; | 257 base::TimeTicks ice_connection_checking_start_; |
| 258 |
| 259 // Track which ICE Connection state that this PeerConnection has gone through. |
| 260 bool ice_state_tracking_ |
| 261 [webrtc::PeerConnectionInterface::kIceConnectionStateMax]; |
| 262 |
249 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; | 263 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; |
250 | 264 |
251 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); | 265 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); |
252 }; | 266 }; |
253 | 267 |
254 } // namespace content | 268 } // namespace content |
255 | 269 |
256 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 270 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
OLD | NEW |