summaryrefslogtreecommitdiffstats
path: root/chromium/content/renderer/media/rtc_peer_connection_handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/renderer/media/rtc_peer_connection_handler.h')
-rw-r--r--chromium/content/renderer/media/rtc_peer_connection_handler.h45
1 files changed, 40 insertions, 5 deletions
diff --git a/chromium/content/renderer/media/rtc_peer_connection_handler.h b/chromium/content/renderer/media/rtc_peer_connection_handler.h
index f3de4b9e8f7..558ecbf631d 100644
--- a/chromium/content/renderer/media/rtc_peer_connection_handler.h
+++ b/chromium/content/renderer/media/rtc_peer_connection_handler.h
@@ -5,10 +5,14 @@
#ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_
#define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_
+#include <map>
+#include <string>
+
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
-#include "content/renderer/media/peer_connection_handler_base.h"
+#include "content/renderer/media/webrtc/media_stream_track_metrics.h"
#include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h"
#include "third_party/WebKit/public/platform/WebRTCStatsRequest.h"
#include "third_party/WebKit/public/platform/WebRTCStatsResponse.h"
@@ -20,7 +24,10 @@ class WebRTCDataChannelHandler;
namespace content {
+class PeerConnectionDependencyFactory;
class PeerConnectionTracker;
+class RemoteMediaStreamImpl;
+class WebRtcMediaStreamAdapter;
// Mockable wrapper for blink::WebRTCStatsResponse
class CONTENT_EXPORT LocalRTCStatsResponse
@@ -73,14 +80,17 @@ class CONTENT_EXPORT LocalRTCStatsRequest
// Callbacks to the webrtc::PeerConnectionObserver implementation also occur on
// the main render thread.
class CONTENT_EXPORT RTCPeerConnectionHandler
- : public PeerConnectionHandlerBase,
- NON_EXPORTED_BASE(public blink::WebRTCPeerConnectionHandler) {
+ : NON_EXPORTED_BASE(public blink::WebRTCPeerConnectionHandler),
+ NON_EXPORTED_BASE(public webrtc::PeerConnectionObserver) {
public:
RTCPeerConnectionHandler(
blink::WebRTCPeerConnectionHandlerClient* client,
- MediaStreamDependencyFactory* dependency_factory);
+ PeerConnectionDependencyFactory* dependency_factory);
virtual ~RTCPeerConnectionHandler();
+ // Destroy all existing RTCPeerConnectionHandler objects.
+ static void DestructAllHandlers();
+
void associateWithFrame(blink::WebFrame* frame);
// Initialize method only used for unit test.
@@ -162,10 +172,16 @@ class CONTENT_EXPORT RTCPeerConnectionHandler
// Calls GetStats on |native_peer_connection_|.
void GetStats(webrtc::StatsObserver* observer,
- webrtc::MediaStreamTrackInterface* track);
+ webrtc::MediaStreamTrackInterface* track,
+ webrtc::PeerConnectionInterface::StatsOutputLevel level);
PeerConnectionTracker* peer_connection_tracker();
+ protected:
+ webrtc::PeerConnectionInterface* native_peer_connection() {
+ return native_peer_connection_.get();
+ }
+
private:
webrtc::SessionDescriptionInterface* CreateNativeSessionDescription(
const blink::WebRTCSessionDescription& description,
@@ -174,10 +190,29 @@ class CONTENT_EXPORT RTCPeerConnectionHandler
// |client_| is a weak pointer, and is valid until stop() has returned.
blink::WebRTCPeerConnectionHandlerClient* client_;
+ // |dependency_factory_| is a raw pointer, and is valid for the lifetime of
+ // RenderThreadImpl.
+ PeerConnectionDependencyFactory* dependency_factory_;
+
blink::WebFrame* frame_;
+ ScopedVector<WebRtcMediaStreamAdapter> local_streams_;
+
PeerConnectionTracker* peer_connection_tracker_;
+ MediaStreamTrackMetrics track_metrics_;
+
+ // Counter for a UMA stat reported at destruction time.
+ int num_data_channels_created_;
+
+ // |native_peer_connection_| is the libjingle native PeerConnection object.
+ scoped_refptr<webrtc::PeerConnectionInterface> native_peer_connection_;
+
+ typedef std::map<webrtc::MediaStreamInterface*,
+ content::RemoteMediaStreamImpl*> RemoteStreamMap;
+ RemoteStreamMap remote_streams_;
+ scoped_refptr<webrtc::UMAObserver> uma_observer_;
+
DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler);
};