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

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

Issue 10919122: Move creation of PeerConnection from the RenderView to the RenderThreadImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding missing files content/renderer/media/webrtc_uma_histograms.h Created 8 years, 3 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/media_stream_impl.h
diff --git a/content/renderer/media/media_stream_impl.h b/content/renderer/media/media_stream_impl.h
index 374f6efb60756b09b4770dd18b2f74f0dd2c28c6..a3a34d260a23c90d0640bff4182ed60a6311ce7b 100644
--- a/content/renderer/media/media_stream_impl.h
+++ b/content/renderer/media/media_stream_impl.h
@@ -5,69 +5,38 @@
#ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_
#define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_
-#include <list>
#include <map>
#include <string>
-#include <utility>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "base/message_loop_proxy.h"
#include "base/threading/non_thread_safe.h"
-#include "base/threading/thread.h"
#include "content/common/content_export.h"
#include "content/public/renderer/render_view_observer.h"
-#include "content/renderer/media/media_stream_extra_data.h"
#include "content/renderer/media/media_stream_dispatcher_eventhandler.h"
-#include "content/renderer/media/rtc_video_decoder.h"
-#include "content/renderer/p2p/socket_dispatcher.h"
#include "third_party/libjingle/source/talk/app/webrtc/mediastream.h"
#include "third_party/libjingle/source/talk/base/scoped_ref_ptr.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebUserMediaClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebUserMediaRequest.h"
#include "webkit/media/media_stream_client.h"
-namespace base {
-class WaitableEvent;
-}
-
-namespace content {
-class IpcNetworkManager;
-class IpcPacketSocketFactory;
-}
-
-namespace talk_base {
-class Thread;
-}
-
namespace WebKit {
-class WebFrame;
-class WebMediaStreamComponent;
class WebMediaStreamDescriptor;
-class WebPeerConnection00Handler;
-class WebPeerConnection00HandlerClient;
-class WebPeerConnectionHandler;
-class WebPeerConnectionHandlerClient;
}
class MediaStreamDispatcher;
class MediaStreamDependencyFactory;
-class PeerConnectionHandlerBase;
class VideoCaptureImplManager;
-class RTCVideoDecoder;
// MediaStreamImpl is a delegate for the Media Stream API messages used by
// WebKit. It ties together WebKit, native PeerConnection in libjingle and
// MediaStreamManager (via MediaStreamDispatcher and MediaStreamDispatcherHost)
// in the browser process. It must be created, called and destroyed on the
// render thread.
-// MediaStreamImpl have weak pointers to a P2PSocketDispatcher and a
-// MediaStreamDispatcher. These objects are also RenderViewObservers.
-// MediaStreamImpl must be deleted before the P2PSocketDispatcher.
+// MediaStreamImpl have weak pointers to a MediaStreamDispatcher.
class CONTENT_EXPORT MediaStreamImpl
: public content::RenderViewObserver,
NON_EXPORTED_BASE(public WebKit::WebUserMediaClient),
@@ -79,21 +48,14 @@ class CONTENT_EXPORT MediaStreamImpl
MediaStreamImpl(
content::RenderView* render_view,
MediaStreamDispatcher* media_stream_dispatcher,
- content::P2PSocketDispatcher* p2p_socket_dispatcher,
VideoCaptureImplManager* vc_manager,
MediaStreamDependencyFactory* dependency_factory);
virtual ~MediaStreamImpl();
- virtual WebKit::WebPeerConnection00Handler* CreatePeerConnectionHandlerJsep(
- WebKit::WebPeerConnection00HandlerClient* client);
// Stops a local MediaStream by notifying the MediaStreamDispatcher that the
// stream no longer may be used.
virtual void StopLocalMediaStream(
const WebKit::WebMediaStreamDescriptor& stream);
- // A new MediaStream have been created based on existing tracks.
- virtual void CreateMediaStream(
- WebKit::WebFrame* frame,
- WebKit::WebMediaStreamDescriptor* stream);
// WebKit::WebUserMediaClient implementation
virtual void requestUserMedia(
@@ -165,47 +127,26 @@ class CONTENT_EXPORT MediaStreamImpl
typedef talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface>
LocalNativeStreamPtr;
- void InitializeWorkerThread(talk_base::Thread** thread,
- base::WaitableEvent* event);
-
- void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event);
- void DeleteIpcNetworkManager();
-
- bool EnsurePeerConnectionFactory();
- void CleanupPeerConnectionFactory();
-
scoped_refptr<media::VideoDecoder> CreateLocalVideoDecoder(
webrtc::MediaStreamInterface* stream,
media::MessageLoopFactory* message_loop_factory);
scoped_refptr<media::VideoDecoder> CreateRemoteVideoDecoder(
webrtc::MediaStreamInterface* stream,
media::MessageLoopFactory* message_loop_factory);
- bool CreateNativeLocalMediaStream(
- WebKit::WebMediaStreamDescriptor* description);
- scoped_ptr<MediaStreamDependencyFactory> dependency_factory_;
+ // Weak ref to a MediaStreamDependencyFactory, owned by the RenderThread.
+ // It's valid for the lifetime of RenderThread.
+ MediaStreamDependencyFactory* dependency_factory_;
// media_stream_dispatcher_ is a weak reference, owned by RenderView. It's
// valid for the lifetime of RenderView.
MediaStreamDispatcher* media_stream_dispatcher_;
- scoped_refptr<content::P2PSocketDispatcher> p2p_socket_dispatcher_;
-
- // We own network_manager_, must be deleted on the worker thread.
- // The network manager uses |p2p_socket_dispatcher_|.
- content::IpcNetworkManager* network_manager_;
- scoped_ptr<content::IpcPacketSocketFactory> socket_factory_;
scoped_refptr<VideoCaptureImplManager> vc_manager_;
MediaRequestMap user_media_requests_;
LocalNativeStreamMap local_media_streams_;
- // PeerConnection threads. signaling_thread_ is created from the
- // "current" chrome thread.
- talk_base::Thread* signaling_thread_;
- talk_base::Thread* worker_thread_;
- base::Thread chrome_worker_thread_;
-
DISALLOW_COPY_AND_ASSIGN(MediaStreamImpl);
};

Powered by Google App Engine
This is Rietveld 408576698