| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 20 #include "base/threading/thread.h" | 20 #include "base/threading/thread.h" |
| 21 #include "base/threading/thread_checker.h" | 21 #include "base/threading/thread_checker.h" |
| 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 "ipc/ipc_platform_file.h" | 25 #include "ipc/ipc_platform_file.h" |
| 25 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 26 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 26 #include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h" | 27 #include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h" |
| 27 #include "third_party/WebKit/public/platform/WebRTCStatsRequest.h" | 28 #include "third_party/WebKit/public/platform/WebRTCStatsRequest.h" |
| 28 #include "third_party/WebKit/public/platform/WebRTCStatsResponse.h" | 29 #include "third_party/WebKit/public/platform/WebRTCStatsResponse.h" |
| 29 | 30 |
| 30 namespace blink { | 31 namespace blink { |
| 31 class WebFrame; | 32 class WebFrame; |
| 32 class WebRTCAnswerOptions; | 33 class WebRTCAnswerOptions; |
| 33 class WebRTCDataChannelHandler; | 34 class WebRTCDataChannelHandler; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 // After the PeerConnection has been closed, this object may no longer | 254 // After the PeerConnection has been closed, this object may no longer |
| 254 // forward callbacks to blink. | 255 // forward callbacks to blink. |
| 255 bool is_closed_; | 256 bool is_closed_; |
| 256 | 257 |
| 257 // |dependency_factory_| is a raw pointer, and is valid for the lifetime of | 258 // |dependency_factory_| is a raw pointer, and is valid for the lifetime of |
| 258 // RenderThreadImpl. | 259 // RenderThreadImpl. |
| 259 PeerConnectionDependencyFactory* const dependency_factory_; | 260 PeerConnectionDependencyFactory* const dependency_factory_; |
| 260 | 261 |
| 261 blink::WebFrame* frame_ = nullptr; | 262 blink::WebFrame* frame_ = nullptr; |
| 262 | 263 |
| 264 // Map and owners of track adapters. Every track that is in use by the peer |
| 265 // connection has an associated blink and webrtc layer representation of it. |
| 266 // The map keeps track of the relationship between |
| 267 // |blink::WebMediaStreamTrack|s and |webrtc::MediaStreamTrackInterface|s. |
| 268 // Track adapters are created on the fly when a component (such as a stream) |
| 269 // needs to reference it, and automatically disposed when there are no longer |
| 270 // any components referencing it. |
| 271 scoped_refptr<WebRtcMediaStreamTrackAdapterMap> track_adapter_map_; |
| 272 // Local stream adapters. Every stream that is in use by the peer connection |
| 273 // has an associated blink and webrtc layer representation of it. This vector |
| 274 // keeps track of the relationship between |blink::WebMediaStream|s and |
| 275 // |webrtc::MediaStreamInterface|s. Streams are added and removed from the |
| 276 // peer connection using |AddStream| and |RemoveStream|. |
| 263 std::vector<std::unique_ptr<WebRtcMediaStreamAdapter>> local_streams_; | 277 std::vector<std::unique_ptr<WebRtcMediaStreamAdapter>> local_streams_; |
| 264 | 278 |
| 265 base::WeakPtr<PeerConnectionTracker> peer_connection_tracker_; | 279 base::WeakPtr<PeerConnectionTracker> peer_connection_tracker_; |
| 266 | 280 |
| 267 MediaStreamTrackMetrics track_metrics_; | 281 MediaStreamTrackMetrics track_metrics_; |
| 268 | 282 |
| 269 // Counter for a UMA stat reported at destruction time. | 283 // Counter for a UMA stat reported at destruction time. |
| 270 int num_data_channels_created_ = 0; | 284 int num_data_channels_created_ = 0; |
| 271 | 285 |
| 272 // Counter for number of IPv4 and IPv6 local candidates. | 286 // Counter for number of IPv4 and IPv6 local candidates. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 302 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; | 316 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; |
| 303 | 317 |
| 304 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; | 318 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; |
| 305 | 319 |
| 306 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); | 320 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); |
| 307 }; | 321 }; |
| 308 | 322 |
| 309 } // namespace content | 323 } // namespace content |
| 310 | 324 |
| 311 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 325 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
| OLD | NEW |