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

Unified Diff: content/browser/speech/speech_input_dispatcher_host.cc

Issue 8818012: Remove the AudioManager singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Set svn eol properties for a couple of files Created 9 years 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/browser/speech/speech_input_dispatcher_host.cc
===================================================================
--- content/browser/speech/speech_input_dispatcher_host.cc (revision 114012)
+++ content/browser/speech/speech_input_dispatcher_host.cc (working copy)
@@ -5,6 +5,7 @@
#include "content/browser/speech/speech_input_dispatcher_host.h"
#include "base/lazy_instance.h"
+#include "content/browser/resource_context.h"
#include "content/browser/speech/speech_input_preferences.h"
#include "content/common/speech_input_messages.h"
#include "content/public/browser/content_browser_client.h"
@@ -114,11 +115,13 @@
SpeechInputDispatcherHost::SpeechInputDispatcherHost(
int render_process_id,
net::URLRequestContextGetter* context_getter,
- SpeechInputPreferences* speech_input_preferences)
+ SpeechInputPreferences* speech_input_preferences,
+ const content::ResourceContext* resource_context)
: render_process_id_(render_process_id),
may_have_pending_requests_(false),
context_getter_(context_getter),
- speech_input_preferences_(speech_input_preferences) {
+ speech_input_preferences_(speech_input_preferences),
+ resource_context_(resource_context) {
// This is initialized by Browser. Do not add any non-trivial
// initialization here, instead do it lazily when required (e.g. see the
// method |manager()|) or add an Init() method.
@@ -161,6 +164,7 @@
void SpeechInputDispatcherHost::OnStartRecognition(
const SpeechInputHostMsg_StartRecognition_Params &params) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
int caller_id = g_speech_input_callers.Get().CreateId(
render_process_id_, params.render_view_id, params.request_id);
manager()->StartRecognition(this, caller_id,
@@ -169,7 +173,8 @@
params.language, params.grammar,
params.origin_url,
context_getter_.get(),
- speech_input_preferences_.get());
+ speech_input_preferences_.get(),
+ resource_context_->audio_manager());
}
void SpeechInputDispatcherHost::OnCancelRecognition(int render_view_id,
« no previous file with comments | « content/browser/speech/speech_input_dispatcher_host.h ('k') | content/browser/speech/speech_input_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698