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

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

Issue 1942803002: Caching AudioOutputDevice instances in mixer manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, fix for sleep() compile error on win and a bit of cleanup around timeouts. Created 4 years, 7 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/audio_device_factory.cc
diff --git a/content/renderer/media/audio_device_factory.cc b/content/renderer/media/audio_device_factory.cc
index 40d8455f5c402a2c1a02af593bd174ab333add57..fd0afe5e008072e708f8888d4ca23fd317fad75c 100644
--- a/content/renderer/media/audio_device_factory.cc
+++ b/content/renderer/media/audio_device_factory.cc
@@ -135,22 +135,14 @@ AudioDeviceFactory::NewAudioCapturerSource(int render_frame_id) {
}
// static
-// TODO(http://crbug.com/587461): Find a better way to check if device exists
-// and is authorized.
media::OutputDeviceInfo AudioDeviceFactory::GetOutputDeviceInfo(
int render_frame_id,
int session_id,
const std::string& device_id,
const url::Origin& security_origin) {
- scoped_refptr<media::AudioRendererSink> sink = NewFinalAudioRendererSink(
+ RenderThreadImpl* render_thread = RenderThreadImpl::current();
miu 2016/05/12 21:53:06 Not sure if this happens in any unit tests, but wh
o1ka 2016/05/17 17:17:23 Done. Now it does not happen in unit tests (and I
+ return render_thread->GetAudioRendererMixerManager()->GetOutputDeviceInfo(
render_frame_id, session_id, device_id, security_origin);
-
- const media::OutputDeviceInfo& device_info = sink->GetOutputDeviceInfo();
-
- // TODO(olka): Cache it and reuse, http://crbug.com/586161
- sink->Stop(); // Must be stopped.
-
- return device_info;
}
AudioDeviceFactory::AudioDeviceFactory() {

Powered by Google App Engine
This is Rietveld 408576698