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

Unified Diff: content/renderer/media/mock_media_stream_dependency_factory.cc

Issue 10919122: Move creation of PeerConnection from the RenderView to the RenderThreadImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to latest codec base. 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/mock_media_stream_dependency_factory.cc
diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc
index 98161f0349db52996127967f0a38454ef87050a5..ad839e5aa219e26c68676bf6977be2c2245175db 100644
--- a/content/renderer/media/mock_media_stream_dependency_factory.cc
+++ b/content/renderer/media/mock_media_stream_dependency_factory.cc
@@ -245,32 +245,18 @@ class MockIceCandidate : public IceCandidateInterface {
} // namespace webrtc
-MockMediaStreamDependencyFactory::MockMediaStreamDependencyFactory(
- VideoCaptureImplManager* vc_manager)
- : MediaStreamDependencyFactory(vc_manager),
+MockMediaStreamDependencyFactory::MockMediaStreamDependencyFactory()
+ : MediaStreamDependencyFactory(NULL, NULL),
mock_pc_factory_created_(false) {
}
MockMediaStreamDependencyFactory::~MockMediaStreamDependencyFactory() {}
-bool MockMediaStreamDependencyFactory::CreatePeerConnectionFactory(
- talk_base::Thread* worker_thread,
- talk_base::Thread* signaling_thread,
- content::P2PSocketDispatcher* socket_dispatcher,
- talk_base::NetworkManager* network_manager,
- talk_base::PacketSocketFactory* socket_factory) {
+bool MockMediaStreamDependencyFactory::EnsurePeerConnectionFactory() {
mock_pc_factory_created_ = true;
return true;
}
-void MockMediaStreamDependencyFactory::ReleasePeerConnectionFactory() {
- mock_pc_factory_created_ = false;
-}
-
-bool MockMediaStreamDependencyFactory::PeerConnectionFactoryCreated() {
- return mock_pc_factory_created_;
-}
-
talk_base::scoped_refptr<webrtc::PeerConnectionInterface>
MockMediaStreamDependencyFactory::CreatePeerConnection(
const std::string& config,
@@ -282,6 +268,7 @@ MockMediaStreamDependencyFactory::CreatePeerConnection(
talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface>
MockMediaStreamDependencyFactory::CreateLocalMediaStream(
const std::string& label) {
+ DCHECK(mock_pc_factory_created_);
talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface> stream(
new talk_base::RefCountedObject<webrtc::MockLocalMediaStream>(label));
return stream;
@@ -291,6 +278,7 @@ talk_base::scoped_refptr<webrtc::LocalVideoTrackInterface>
MockMediaStreamDependencyFactory::CreateLocalVideoTrack(
const std::string& label,
int video_session_id) {
+ DCHECK(mock_pc_factory_created_);
talk_base::scoped_refptr<webrtc::LocalVideoTrackInterface> track(
new talk_base::RefCountedObject<webrtc::MockLocalVideoTrack>(label));
return track;
@@ -300,6 +288,7 @@ talk_base::scoped_refptr<webrtc::LocalAudioTrackInterface>
MockMediaStreamDependencyFactory::CreateLocalAudioTrack(
const std::string& label,
webrtc::AudioDeviceModule* audio_device) {
+ DCHECK(mock_pc_factory_created_);
talk_base::scoped_refptr<webrtc::LocalAudioTrackInterface> track(
new talk_base::RefCountedObject<webrtc::MockLocalAudioTrack>(label));
return track;

Powered by Google App Engine
This is Rietveld 408576698