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

Unified Diff: content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc

Issue 1834323002: MediaStream audio: Refactor 3 separate "glue" implementations into one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reworked unit tests around structural changes, and added exhaustive media_stream_audio_unittest.cc. Created 4 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/webrtc/mock_peer_connection_dependency_factory.cc
diff --git a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc
index 982291bdbf87f839095750eb6ef280046a406784..64cd844f194de268e74c4bd70da374f111564066 100644
--- a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc
+++ b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc
@@ -9,11 +9,7 @@
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "content/renderer/media/mock_peer_connection_impl.h"
-#include "content/renderer/media/webaudio_capturer_source.h"
-#include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h"
#include "content/renderer/media/webrtc/webrtc_video_capturer_adapter.h"
-#include "content/renderer/media/webrtc_audio_capturer.h"
-#include "content/renderer/media/webrtc_local_audio_track.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
#include "third_party/webrtc/api/mediastreaminterface.h"
#include "third_party/webrtc/base/scoped_ref_ptr.h"
@@ -380,7 +376,9 @@ class MockIceCandidate : public IceCandidateInterface {
MockPeerConnectionDependencyFactory::MockPeerConnectionDependencyFactory()
: PeerConnectionDependencyFactory(NULL),
- fail_to_create_next_audio_capturer_(false) {
+ signaling_thread_("MockPCFactory WebRtc Signaling Thread") {
+ EnsureWebRtcAudioDeviceImpl();
+ CHECK(signaling_thread_.Start());
}
MockPeerConnectionDependencyFactory::~MockPeerConnectionDependencyFactory() {}
@@ -416,9 +414,6 @@ MockPeerConnectionDependencyFactory::CreateVideoSource(
return nullptr;
}
-void MockPeerConnectionDependencyFactory::CreateWebAudioSource(
- blink::WebMediaStreamSource* source) {}
-
scoped_refptr<webrtc::MediaStreamInterface>
MockPeerConnectionDependencyFactory::CreateLocalMediaStream(
const std::string& label) {
@@ -458,19 +453,9 @@ MockPeerConnectionDependencyFactory::CreateIceCandidate(
return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp);
}
-std::unique_ptr<WebRtcAudioCapturer>
-MockPeerConnectionDependencyFactory::CreateAudioCapturer(
- int render_frame_id,
- const StreamDeviceInfo& device_info,
- const blink::WebMediaConstraints& constraints,
- MediaStreamAudioSource* audio_source) {
- if (fail_to_create_next_audio_capturer_) {
- fail_to_create_next_audio_capturer_ = false;
- return NULL;
- }
- DCHECK(audio_source);
- return WebRtcAudioCapturer::CreateCapturer(-1, device_info, constraints, NULL,
- audio_source);
+scoped_refptr<base::SingleThreadTaskRunner>
+MockPeerConnectionDependencyFactory::GetWebRtcSignalingThread() const {
+ return signaling_thread_.task_runner();
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698