| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class WebRTCOfferOptions; | 30 class WebRTCOfferOptions; |
| 31 class WebRTCPeerConnectionHandlerClient; | 31 class WebRTCPeerConnectionHandlerClient; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace content { | 34 namespace content { |
| 35 | 35 |
| 36 class PeerConnectionDependencyFactory; | 36 class PeerConnectionDependencyFactory; |
| 37 class PeerConnectionTracker; | 37 class PeerConnectionTracker; |
| 38 class RemoteMediaStreamImpl; | 38 class RemoteMediaStreamImpl; |
| 39 class RtcDataChannelHandler; | 39 class RtcDataChannelHandler; |
| 40 class RTCMediaConstraints; | |
| 41 class WebRtcMediaStreamAdapter; | 40 class WebRtcMediaStreamAdapter; |
| 42 | 41 |
| 43 // Mockable wrapper for blink::WebRTCStatsResponse | 42 // Mockable wrapper for blink::WebRTCStatsResponse |
| 44 class CONTENT_EXPORT LocalRTCStatsResponse | 43 class CONTENT_EXPORT LocalRTCStatsResponse |
| 45 : public NON_EXPORTED_BASE(rtc::RefCountInterface) { | 44 : public NON_EXPORTED_BASE(rtc::RefCountInterface) { |
| 46 public: | 45 public: |
| 47 explicit LocalRTCStatsResponse(const blink::WebRTCStatsResponse& impl) | 46 explicit LocalRTCStatsResponse(const blink::WebRTCStatsResponse& impl) |
| 48 : impl_(impl) { | 47 : impl_(impl) { |
| 49 } | 48 } |
| 50 | 49 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 : NON_EXPORTED_BASE(public blink::WebRTCPeerConnectionHandler) { | 92 : NON_EXPORTED_BASE(public blink::WebRTCPeerConnectionHandler) { |
| 94 public: | 93 public: |
| 95 RTCPeerConnectionHandler( | 94 RTCPeerConnectionHandler( |
| 96 blink::WebRTCPeerConnectionHandlerClient* client, | 95 blink::WebRTCPeerConnectionHandlerClient* client, |
| 97 PeerConnectionDependencyFactory* dependency_factory); | 96 PeerConnectionDependencyFactory* dependency_factory); |
| 98 ~RTCPeerConnectionHandler() override; | 97 ~RTCPeerConnectionHandler() override; |
| 99 | 98 |
| 100 // Destroy all existing RTCPeerConnectionHandler objects. | 99 // Destroy all existing RTCPeerConnectionHandler objects. |
| 101 static void DestructAllHandlers(); | 100 static void DestructAllHandlers(); |
| 102 | 101 |
| 103 static void ConvertOfferOptionsToConstraints( | |
| 104 const blink::WebRTCOfferOptions& options, | |
| 105 RTCMediaConstraints* output); | |
| 106 | |
| 107 void associateWithFrame(blink::WebFrame* frame); | 102 void associateWithFrame(blink::WebFrame* frame); |
| 108 | 103 |
| 109 // Initialize method only used for unit test. | 104 // Initialize method only used for unit test. |
| 110 bool InitializeForTest( | 105 bool InitializeForTest( |
| 111 const blink::WebRTCConfiguration& server_configuration, | 106 const blink::WebRTCConfiguration& server_configuration, |
| 112 const blink::WebMediaConstraints& options, | 107 const blink::WebMediaConstraints& options, |
| 113 const base::WeakPtr<PeerConnectionTracker>& peer_connection_tracker); | 108 const base::WeakPtr<PeerConnectionTracker>& peer_connection_tracker); |
| 114 | 109 |
| 115 // blink::WebRTCPeerConnectionHandler implementation | 110 // blink::WebRTCPeerConnectionHandler implementation |
| 116 bool initialize(const blink::WebRTCConfiguration& server_configuration, | 111 bool initialize(const blink::WebRTCConfiguration& server_configuration, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 127 void setLocalDescription( | 122 void setLocalDescription( |
| 128 const blink::WebRTCVoidRequest& request, | 123 const blink::WebRTCVoidRequest& request, |
| 129 const blink::WebRTCSessionDescription& description) override; | 124 const blink::WebRTCSessionDescription& description) override; |
| 130 void setRemoteDescription( | 125 void setRemoteDescription( |
| 131 const blink::WebRTCVoidRequest& request, | 126 const blink::WebRTCVoidRequest& request, |
| 132 const blink::WebRTCSessionDescription& description) override; | 127 const blink::WebRTCSessionDescription& description) override; |
| 133 | 128 |
| 134 blink::WebRTCSessionDescription localDescription() override; | 129 blink::WebRTCSessionDescription localDescription() override; |
| 135 blink::WebRTCSessionDescription remoteDescription() override; | 130 blink::WebRTCSessionDescription remoteDescription() override; |
| 136 | 131 |
| 137 bool updateICE(const blink::WebRTCConfiguration& server_configuration, | 132 bool updateICE( |
| 138 const blink::WebMediaConstraints& options) override; | 133 const blink::WebRTCConfiguration& server_configuration) override; |
| 139 bool addICECandidate(const blink::WebRTCICECandidate& candidate) override; | 134 bool addICECandidate(const blink::WebRTCICECandidate& candidate) override; |
| 140 bool addICECandidate(const blink::WebRTCVoidRequest& request, | 135 bool addICECandidate(const blink::WebRTCVoidRequest& request, |
| 141 const blink::WebRTCICECandidate& candidate) override; | 136 const blink::WebRTCICECandidate& candidate) override; |
| 142 virtual void OnaddICECandidateResult(const blink::WebRTCVoidRequest& request, | 137 virtual void OnaddICECandidateResult(const blink::WebRTCVoidRequest& request, |
| 143 bool result); | 138 bool result); |
| 144 | 139 |
| 145 bool addStream(const blink::WebMediaStream& stream, | 140 bool addStream(const blink::WebMediaStream& stream, |
| 146 const blink::WebMediaConstraints& options) override; | 141 const blink::WebMediaConstraints& options) override; |
| 147 void removeStream(const blink::WebMediaStream& stream) override; | 142 void removeStream(const blink::WebMediaStream& stream) override; |
| 148 void getStats(const blink::WebRTCStatsRequest& request) override; | 143 void getStats(const blink::WebRTCStatsRequest& request) override; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 void ReportFirstSessionDescriptions( | 213 void ReportFirstSessionDescriptions( |
| 219 const FirstSessionDescription& local, | 214 const FirstSessionDescription& local, |
| 220 const FirstSessionDescription& remote); | 215 const FirstSessionDescription& remote); |
| 221 | 216 |
| 222 // Virtual to allow mocks to override. | 217 // Virtual to allow mocks to override. |
| 223 virtual scoped_refptr<base::SingleThreadTaskRunner> signaling_thread() const; | 218 virtual scoped_refptr<base::SingleThreadTaskRunner> signaling_thread() const; |
| 224 | 219 |
| 225 void RunSynchronousClosureOnSignalingThread(const base::Closure& closure, | 220 void RunSynchronousClosureOnSignalingThread(const base::Closure& closure, |
| 226 const char* trace_event_name); | 221 const char* trace_event_name); |
| 227 | 222 |
| 223 // Not sure why these statics are class members at all. |
| 224 static void ConvertOfferOptionsToWebrtcOfferOptions( |
| 225 const blink::WebRTCOfferOptions& options, |
| 226 webrtc::PeerConnectionInterface::RTCOfferAnswerOptions* output); |
| 227 |
| 228 static void ConvertConstraintsToWebrtcOfferOptions( |
| 229 const blink::WebMediaConstraints& options, |
| 230 webrtc::PeerConnectionInterface::RTCOfferAnswerOptions* output); |
| 231 |
| 228 base::ThreadChecker thread_checker_; | 232 base::ThreadChecker thread_checker_; |
| 229 | 233 |
| 230 // |client_| is a weak pointer to the blink object (blink::RTCPeerConnection) | 234 // |client_| is a weak pointer to the blink object (blink::RTCPeerConnection) |
| 231 // that owns this object. | 235 // that owns this object. |
| 232 // It is valid for the lifetime of this object. | 236 // It is valid for the lifetime of this object. |
| 233 blink::WebRTCPeerConnectionHandlerClient* const client_; | 237 blink::WebRTCPeerConnectionHandlerClient* const client_; |
| 234 // True if this PeerConnection has been closed. | 238 // True if this PeerConnection has been closed. |
| 235 // After the PeerConnection has been closed, this object may no longer | 239 // After the PeerConnection has been closed, this object may no longer |
| 236 // forward callbacks to blink. | 240 // forward callbacks to blink. |
| 237 bool is_closed_; | 241 bool is_closed_; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; | 283 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; |
| 280 | 284 |
| 281 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; | 285 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; |
| 282 | 286 |
| 283 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); | 287 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); |
| 284 }; | 288 }; |
| 285 | 289 |
| 286 } // namespace content | 290 } // namespace content |
| 287 | 291 |
| 288 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 292 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
| OLD | NEW |