Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: content/renderer/media/rtc_peer_connection_handler.h

Issue 2953513003: RTCPeerConnectionHandler using WebRtcMediaStreamAdapterMap. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/media/rtc_peer_connection_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_adapter_map.h"
24 #include "content/renderer/media/webrtc/webrtc_media_stream_track_adapter_map.h" 25 #include "content/renderer/media/webrtc/webrtc_media_stream_track_adapter_map.h"
25 #include "ipc/ipc_platform_file.h" 26 #include "ipc/ipc_platform_file.h"
26 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" 27 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
27 #include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h" 28 #include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h"
28 #include "third_party/WebKit/public/platform/WebRTCStatsRequest.h" 29 #include "third_party/WebKit/public/platform/WebRTCStatsRequest.h"
29 #include "third_party/WebKit/public/platform/WebRTCStatsResponse.h" 30 #include "third_party/WebKit/public/platform/WebRTCStatsResponse.h"
30 31
31 namespace blink { 32 namespace blink {
32 class WebFrame; 33 class WebFrame;
33 class WebRTCAnswerOptions; 34 class WebRTCAnswerOptions;
34 class WebRTCDataChannelHandler; 35 class WebRTCDataChannelHandler;
35 class WebRTCLegacyStats; 36 class WebRTCLegacyStats;
36 class WebRTCOfferOptions; 37 class WebRTCOfferOptions;
37 class WebRTCPeerConnectionHandlerClient; 38 class WebRTCPeerConnectionHandlerClient;
38 } 39 }
39 40
40 namespace content { 41 namespace content {
41 42
42 class PeerConnectionDependencyFactory; 43 class PeerConnectionDependencyFactory;
43 class PeerConnectionTracker; 44 class PeerConnectionTracker;
44 class RemoteMediaStreamImpl; 45 class RemoteMediaStreamImpl;
45 class RtcDataChannelHandler; 46 class RtcDataChannelHandler;
46 class WebRtcMediaStreamAdapter;
47 47
48 // Mockable wrapper for blink::WebRTCStatsResponse 48 // Mockable wrapper for blink::WebRTCStatsResponse
49 class CONTENT_EXPORT LocalRTCStatsResponse 49 class CONTENT_EXPORT LocalRTCStatsResponse
50 : public NON_EXPORTED_BASE(rtc::RefCountInterface) { 50 : public NON_EXPORTED_BASE(rtc::RefCountInterface) {
51 public: 51 public:
52 explicit LocalRTCStatsResponse(const blink::WebRTCStatsResponse& impl) 52 explicit LocalRTCStatsResponse(const blink::WebRTCStatsResponse& impl)
53 : impl_(impl) { 53 : impl_(impl) {
54 } 54 }
55 55
56 virtual blink::WebRTCStatsResponse webKitStatsResponse() const; 56 virtual blink::WebRTCStatsResponse webKitStatsResponse() const;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 blink::WebFrame* frame_ = nullptr; 255 blink::WebFrame* 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 // Map and owners of stream adapters. Every stream that is in use by the peer
266 // connection has an associated blink and webrtc layer representation of it.
267 // The map keeps track of the relationship between |blink::WebMediaStream|s
268 // and |webrtc::MediaStreamInterface|s. Stream adapters are created on the fly
269 // when a component (such as |local_streams_| or a sender) needs to reference
270 // it, and automatically disposed when there are no longer any components
271 // referencing it.
272 // TODO(hbos): Update and use the map for the |remote_streams_| case too.
273 // crbug.com/705901
274 scoped_refptr<WebRtcMediaStreamAdapterMap> stream_adapter_map_;
265 // Local stream adapters. Every stream that is in use by the peer connection 275 // Local stream adapters. Every stream that is in use by the peer connection
266 // has an associated blink and webrtc layer representation of it. This vector 276 // has an associated blink and webrtc layer representation of it. This vector
267 // keeps track of the relationship between |blink::WebMediaStream|s and 277 // keeps track of the relationship between |blink::WebMediaStream|s and
268 // |webrtc::MediaStreamInterface|s. Streams are added and removed from the 278 // |webrtc::MediaStreamInterface|s. Streams are added and removed from the
269 // peer connection using |AddStream| and |RemoveStream|. 279 // peer connection using |AddStream| and |RemoveStream|.
270 std::vector<std::unique_ptr<WebRtcMediaStreamAdapter>> local_streams_; 280 std::vector<std::unique_ptr<WebRtcMediaStreamAdapterMap::AdapterRef>>
281 local_streams_;
271 282
272 base::WeakPtr<PeerConnectionTracker> peer_connection_tracker_; 283 base::WeakPtr<PeerConnectionTracker> peer_connection_tracker_;
273 284
274 MediaStreamTrackMetrics track_metrics_; 285 MediaStreamTrackMetrics track_metrics_;
275 286
276 // Counter for a UMA stat reported at destruction time. 287 // Counter for a UMA stat reported at destruction time.
277 int num_data_channels_created_ = 0; 288 int num_data_channels_created_ = 0;
278 289
279 // Counter for number of IPv4 and IPv6 local candidates. 290 // Counter for number of IPv4 and IPv6 local candidates.
280 int num_local_candidates_ipv4_ = 0; 291 int num_local_candidates_ipv4_ = 0;
(...skipping 28 matching lines...) Expand all
309 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; 320 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {};
310 321
311 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; 322 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_;
312 323
313 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); 324 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler);
314 }; 325 };
315 326
316 } // namespace content 327 } // namespace content
317 328
318 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ 329 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/rtc_peer_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698