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

Unified Diff: content/renderer/media/peer_connection_handler.h

Issue 10038009: Revert 131949 (multiple memory leaks) - Adding JSEP PeerConnection glue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/peer_connection_handler.h
===================================================================
--- content/renderer/media/peer_connection_handler.h (revision 131960)
+++ content/renderer/media/peer_connection_handler.h (working copy)
@@ -5,21 +5,28 @@
#ifndef CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_H_
#define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_H_
+#include <map>
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/message_loop_proxy.h"
#include "content/common/content_export.h"
-#include "content/renderer/media/peer_connection_handler_base.h"
+#include "third_party/libjingle/source/talk/app/webrtc/mediastream.h"
+#include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConnectionHandler.h"
-// PeerConnectionHandler is a delegate for the ROAP PeerConnection API messages
-// going between WebKit and native PeerConnection in libjingle. It's owned by
-// WebKit. ROAP PeerConnection will be removed soon.
+class MediaStreamDependencyFactory;
+class MediaStreamImpl;
+
+// PeerConnectionHandler is a delegate for the PeerConnection API messages going
+// between WebKit and native PeerConnection in libjingle. It's owned by
+// WebKit.
class CONTENT_EXPORT PeerConnectionHandler
- : public PeerConnectionHandlerBase,
- NON_EXPORTED_BASE(public WebKit::WebPeerConnectionHandler) {
+ : NON_EXPORTED_BASE(public WebKit::WebPeerConnectionHandler),
+ NON_EXPORTED_BASE(public webrtc::PeerConnectionObserver) {
public:
PeerConnectionHandler(
WebKit::WebPeerConnectionHandlerClient* client,
@@ -27,6 +34,11 @@
MediaStreamDependencyFactory* dependency_factory);
virtual ~PeerConnectionHandler();
+ // Set the video renderer for the specified stream.
+ virtual void SetVideoRenderer(
+ const std::string& stream_label,
+ webrtc::VideoRendererWrapperInterface* renderer);
+
// WebKit::WebPeerConnectionHandler implementation
virtual void initialize(
const WebKit::WebString& server_configuration,
@@ -59,12 +71,37 @@
private:
FRIEND_TEST_ALL_PREFIXES(PeerConnectionHandlerTest, Basic);
+ void AddStreams(
+ const WebKit::WebVector<WebKit::WebMediaStreamDescriptor>& streams);
+ void RemoveStreams(
+ const WebKit::WebVector<WebKit::WebMediaStreamDescriptor>& streams);
void OnAddStreamCallback(webrtc::MediaStreamInterface* stream);
void OnRemoveStreamCallback(webrtc::MediaStreamInterface* stream);
+ WebKit::WebMediaStreamDescriptor CreateWebKitStreamDescriptor(
+ webrtc::MediaStreamInterface* stream);
// client_ is a weak pointer, and is valid until stop() has returned.
WebKit::WebPeerConnectionHandlerClient* client_;
+ // media_stream_impl_ is a weak pointer, and is valid for the lifetime of this
+ // class. Calls to it must be done on the render thread.
+ MediaStreamImpl* media_stream_impl_;
+
+ // dependency_factory_ is a weak pointer, and is valid for the lifetime of
+ // MediaStreamImpl.
+ MediaStreamDependencyFactory* dependency_factory_;
+
+ // native_peer_connection_ is the native PeerConnection object,
+ // it handles the ICE processing and media engine.
+ talk_base::scoped_refptr<webrtc::PeerConnectionInterface>
+ native_peer_connection_;
+
+ typedef std::map<webrtc::MediaStreamInterface*,
+ WebKit::WebMediaStreamDescriptor> RemoteStreamMap;
+ RemoteStreamMap remote_streams_;
+
+ scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
+
DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandler);
};

Powered by Google App Engine
This is Rietveld 408576698