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 11 matching lines...) Expand all Loading... |
22 #include "content/common/content_export.h" | 22 #include "content/common/content_export.h" |
23 #include "content/renderer/media/webrtc/media_stream_track_metrics.h" | 23 #include "content/renderer/media/webrtc/media_stream_track_metrics.h" |
24 #include "content/renderer/media/webrtc/webrtc_media_stream_track_adapter_map.h" | 24 #include "content/renderer/media/webrtc/webrtc_media_stream_track_adapter_map.h" |
25 #include "ipc/ipc_platform_file.h" | 25 #include "ipc/ipc_platform_file.h" |
26 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 26 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
27 #include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h" | 27 #include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h" |
28 #include "third_party/WebKit/public/platform/WebRTCStatsRequest.h" | 28 #include "third_party/WebKit/public/platform/WebRTCStatsRequest.h" |
29 #include "third_party/WebKit/public/platform/WebRTCStatsResponse.h" | 29 #include "third_party/WebKit/public/platform/WebRTCStatsResponse.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 class WebFrame; | 32 class WebLocalFrame; |
33 class WebRTCAnswerOptions; | 33 class WebRTCAnswerOptions; |
34 class WebRTCDataChannelHandler; | 34 class WebRTCDataChannelHandler; |
35 class WebRTCLegacyStats; | 35 class WebRTCLegacyStats; |
36 class WebRTCOfferOptions; | 36 class WebRTCOfferOptions; |
37 class WebRTCPeerConnectionHandlerClient; | 37 class WebRTCPeerConnectionHandlerClient; |
38 } | 38 } |
39 | 39 |
40 namespace content { | 40 namespace content { |
41 | 41 |
42 class PeerConnectionDependencyFactory; | 42 class PeerConnectionDependencyFactory; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 : NON_EXPORTED_BASE(public blink::WebRTCPeerConnectionHandler) { | 95 : NON_EXPORTED_BASE(public blink::WebRTCPeerConnectionHandler) { |
96 public: | 96 public: |
97 RTCPeerConnectionHandler( | 97 RTCPeerConnectionHandler( |
98 blink::WebRTCPeerConnectionHandlerClient* client, | 98 blink::WebRTCPeerConnectionHandlerClient* client, |
99 PeerConnectionDependencyFactory* dependency_factory); | 99 PeerConnectionDependencyFactory* dependency_factory); |
100 ~RTCPeerConnectionHandler() override; | 100 ~RTCPeerConnectionHandler() override; |
101 | 101 |
102 // Destroy all existing RTCPeerConnectionHandler objects. | 102 // Destroy all existing RTCPeerConnectionHandler objects. |
103 static void DestructAllHandlers(); | 103 static void DestructAllHandlers(); |
104 | 104 |
105 void associateWithFrame(blink::WebFrame* frame); | 105 void associateWithFrame(blink::WebLocalFrame* frame); |
106 | 106 |
107 // Initialize method only used for unit test. | 107 // Initialize method only used for unit test. |
108 bool InitializeForTest( | 108 bool InitializeForTest( |
109 const blink::WebRTCConfiguration& server_configuration, | 109 const blink::WebRTCConfiguration& server_configuration, |
110 const blink::WebMediaConstraints& options, | 110 const blink::WebMediaConstraints& options, |
111 const base::WeakPtr<PeerConnectionTracker>& peer_connection_tracker); | 111 const base::WeakPtr<PeerConnectionTracker>& peer_connection_tracker); |
112 | 112 |
113 // blink::WebRTCPeerConnectionHandler implementation | 113 // blink::WebRTCPeerConnectionHandler implementation |
114 bool Initialize(const blink::WebRTCConfiguration& server_configuration, | 114 bool Initialize(const blink::WebRTCConfiguration& server_configuration, |
115 const blink::WebMediaConstraints& options) override; | 115 const blink::WebMediaConstraints& options) override; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 blink::WebRTCPeerConnectionHandlerClient* const client_; | 245 blink::WebRTCPeerConnectionHandlerClient* const client_; |
246 // True if this PeerConnection has been closed. | 246 // True if this PeerConnection has been closed. |
247 // After the PeerConnection has been closed, this object may no longer | 247 // After the PeerConnection has been closed, this object may no longer |
248 // forward callbacks to blink. | 248 // forward callbacks to blink. |
249 bool is_closed_; | 249 bool is_closed_; |
250 | 250 |
251 // |dependency_factory_| is a raw pointer, and is valid for the lifetime of | 251 // |dependency_factory_| is a raw pointer, and is valid for the lifetime of |
252 // RenderThreadImpl. | 252 // RenderThreadImpl. |
253 PeerConnectionDependencyFactory* const dependency_factory_; | 253 PeerConnectionDependencyFactory* const dependency_factory_; |
254 | 254 |
255 blink::WebFrame* frame_ = nullptr; | 255 blink::WebLocalFrame* frame_ = nullptr; |
256 | 256 |
257 // Map and owners of track adapters. Every track that is in use by the peer | 257 // Map and owners of track adapters. Every track that is in use by the peer |
258 // connection has an associated blink and webrtc layer representation of it. | 258 // connection has an associated blink and webrtc layer representation of it. |
259 // The map keeps track of the relationship between | 259 // The map keeps track of the relationship between |
260 // |blink::WebMediaStreamTrack|s and |webrtc::MediaStreamTrackInterface|s. | 260 // |blink::WebMediaStreamTrack|s and |webrtc::MediaStreamTrackInterface|s. |
261 // Track adapters are created on the fly when a component (such as a stream) | 261 // Track adapters are created on the fly when a component (such as a stream) |
262 // needs to reference it, and automatically disposed when there are no longer | 262 // needs to reference it, and automatically disposed when there are no longer |
263 // any components referencing it. | 263 // any components referencing it. |
264 scoped_refptr<WebRtcMediaStreamTrackAdapterMap> track_adapter_map_; | 264 scoped_refptr<WebRtcMediaStreamTrackAdapterMap> track_adapter_map_; |
265 // Local stream adapters. Every stream that is in use by the peer connection | 265 // Local stream adapters. Every stream that is in use by the peer connection |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; | 309 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; |
310 | 310 |
311 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; | 311 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; |
312 | 312 |
313 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); | 313 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); |
314 }; | 314 }; |
315 | 315 |
316 } // namespace content | 316 } // namespace content |
317 | 317 |
318 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 318 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
OLD | NEW |