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 28 matching lines...) Expand all Loading... |
39 : impl_(impl) { | 39 : impl_(impl) { |
40 } | 40 } |
41 | 41 |
42 virtual blink::WebRTCStatsResponse webKitStatsResponse() const; | 42 virtual blink::WebRTCStatsResponse webKitStatsResponse() const; |
43 virtual size_t addReport(blink::WebString type, blink::WebString id, | 43 virtual size_t addReport(blink::WebString type, blink::WebString id, |
44 double timestamp); | 44 double timestamp); |
45 virtual void addStatistic(size_t report, | 45 virtual void addStatistic(size_t report, |
46 blink::WebString name, blink::WebString value); | 46 blink::WebString name, blink::WebString value); |
47 | 47 |
48 protected: | 48 protected: |
49 virtual ~LocalRTCStatsResponse() {} | 49 ~LocalRTCStatsResponse() override {} |
50 // Constructor for creating mocks. | 50 // Constructor for creating mocks. |
51 LocalRTCStatsResponse() {} | 51 LocalRTCStatsResponse() {} |
52 | 52 |
53 private: | 53 private: |
54 blink::WebRTCStatsResponse impl_; | 54 blink::WebRTCStatsResponse impl_; |
55 }; | 55 }; |
56 | 56 |
57 // Mockable wrapper for blink::WebRTCStatsRequest | 57 // Mockable wrapper for blink::WebRTCStatsRequest |
58 class CONTENT_EXPORT LocalRTCStatsRequest | 58 class CONTENT_EXPORT LocalRTCStatsRequest |
59 : public NON_EXPORTED_BASE(rtc::RefCountInterface) { | 59 : public NON_EXPORTED_BASE(rtc::RefCountInterface) { |
60 public: | 60 public: |
61 explicit LocalRTCStatsRequest(blink::WebRTCStatsRequest impl); | 61 explicit LocalRTCStatsRequest(blink::WebRTCStatsRequest impl); |
62 // Constructor for testing. | 62 // Constructor for testing. |
63 LocalRTCStatsRequest(); | 63 LocalRTCStatsRequest(); |
64 | 64 |
65 virtual bool hasSelector() const; | 65 virtual bool hasSelector() const; |
66 virtual blink::WebMediaStreamTrack component() const; | 66 virtual blink::WebMediaStreamTrack component() const; |
67 virtual void requestSucceeded(const LocalRTCStatsResponse* response); | 67 virtual void requestSucceeded(const LocalRTCStatsResponse* response); |
68 virtual scoped_refptr<LocalRTCStatsResponse> createResponse(); | 68 virtual scoped_refptr<LocalRTCStatsResponse> createResponse(); |
69 | 69 |
70 protected: | 70 protected: |
71 virtual ~LocalRTCStatsRequest(); | 71 ~LocalRTCStatsRequest() override; |
72 | 72 |
73 private: | 73 private: |
74 blink::WebRTCStatsRequest impl_; | 74 blink::WebRTCStatsRequest impl_; |
75 rtc::scoped_refptr<LocalRTCStatsResponse> response_; | 75 rtc::scoped_refptr<LocalRTCStatsResponse> response_; |
76 }; | 76 }; |
77 | 77 |
78 // RTCPeerConnectionHandler is a delegate for the RTC PeerConnection API | 78 // RTCPeerConnectionHandler is a delegate for the RTC PeerConnection API |
79 // messages going between WebKit and native PeerConnection in libjingle. It's | 79 // messages going between WebKit and native PeerConnection in libjingle. It's |
80 // owned by WebKit. | 80 // owned by WebKit. |
81 // WebKit calls all of these methods on the main render thread. | 81 // WebKit calls all of these methods on the main render thread. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 virtual void getStats( | 152 virtual void getStats( |
153 const blink::WebRTCStatsRequest& request) override; | 153 const blink::WebRTCStatsRequest& request) override; |
154 virtual blink::WebRTCDataChannelHandler* createDataChannel( | 154 virtual blink::WebRTCDataChannelHandler* createDataChannel( |
155 const blink::WebString& label, | 155 const blink::WebString& label, |
156 const blink::WebRTCDataChannelInit& init) override; | 156 const blink::WebRTCDataChannelInit& init) override; |
157 virtual blink::WebRTCDTMFSenderHandler* createDTMFSender( | 157 virtual blink::WebRTCDTMFSenderHandler* createDTMFSender( |
158 const blink::WebMediaStreamTrack& track) override; | 158 const blink::WebMediaStreamTrack& track) override; |
159 virtual void stop() override; | 159 virtual void stop() override; |
160 | 160 |
161 // webrtc::PeerConnectionObserver implementation | 161 // webrtc::PeerConnectionObserver implementation |
162 virtual void OnError() override; | 162 void OnError() override; |
163 // Triggered when the SignalingState changed. | 163 // Triggered when the SignalingState changed. |
164 virtual void OnSignalingChange( | 164 void OnSignalingChange( |
165 webrtc::PeerConnectionInterface::SignalingState new_state) override; | 165 webrtc::PeerConnectionInterface::SignalingState new_state) override; |
166 virtual void OnAddStream(webrtc::MediaStreamInterface* stream) override; | 166 void OnAddStream(webrtc::MediaStreamInterface* stream) override; |
167 virtual void OnRemoveStream(webrtc::MediaStreamInterface* stream) override; | 167 void OnRemoveStream(webrtc::MediaStreamInterface* stream) override; |
168 virtual void OnIceCandidate( | 168 void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override; |
169 const webrtc::IceCandidateInterface* candidate) override; | 169 void OnIceConnectionChange( |
170 virtual void OnIceConnectionChange( | |
171 webrtc::PeerConnectionInterface::IceConnectionState new_state) override; | 170 webrtc::PeerConnectionInterface::IceConnectionState new_state) override; |
172 virtual void OnIceGatheringChange( | 171 void OnIceGatheringChange( |
173 webrtc::PeerConnectionInterface::IceGatheringState new_state) override; | 172 webrtc::PeerConnectionInterface::IceGatheringState new_state) override; |
174 | 173 |
175 virtual void OnDataChannel( | 174 void OnDataChannel(webrtc::DataChannelInterface* data_channel) override; |
176 webrtc::DataChannelInterface* data_channel) override; | 175 void OnRenegotiationNeeded() override; |
177 virtual void OnRenegotiationNeeded() override; | |
178 | 176 |
179 // Delegate functions to allow for mocking of WebKit interfaces. | 177 // Delegate functions to allow for mocking of WebKit interfaces. |
180 // getStats takes ownership of request parameter. | 178 // getStats takes ownership of request parameter. |
181 virtual void getStats(LocalRTCStatsRequest* request); | 179 virtual void getStats(LocalRTCStatsRequest* request); |
182 | 180 |
183 // Calls GetStats on |native_peer_connection_|. | 181 // Calls GetStats on |native_peer_connection_|. |
184 void GetStats(webrtc::StatsObserver* observer, | 182 void GetStats(webrtc::StatsObserver* observer, |
185 webrtc::MediaStreamTrackInterface* track, | 183 webrtc::MediaStreamTrackInterface* track, |
186 webrtc::PeerConnectionInterface::StatsOutputLevel level); | 184 webrtc::PeerConnectionInterface::StatsOutputLevel level); |
187 | 185 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 RemoteStreamMap remote_streams_; | 228 RemoteStreamMap remote_streams_; |
231 scoped_refptr<webrtc::UMAObserver> uma_observer_; | 229 scoped_refptr<webrtc::UMAObserver> uma_observer_; |
232 base::TimeTicks ice_connection_checking_start_; | 230 base::TimeTicks ice_connection_checking_start_; |
233 | 231 |
234 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); | 232 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); |
235 }; | 233 }; |
236 | 234 |
237 } // namespace content | 235 } // namespace content |
238 | 236 |
239 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 237 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
OLD | NEW |