Index: content/browser/speech/speech_recognition_manager_impl.cc |
diff --git a/content/browser/speech/speech_recognition_manager_impl.cc b/content/browser/speech/speech_recognition_manager_impl.cc |
index d8faf9d202798cb261ab6feb730c123b539da49f..ea49579e07ba55f0e356852b4c2cb0c502850faf 100644 |
--- a/content/browser/speech/speech_recognition_manager_impl.cc |
+++ b/content/browser/speech/speech_recognition_manager_impl.cc |
@@ -178,15 +178,21 @@ void SpeechRecognitionManagerImpl::RecognitionAllowedCallback(int session_id, |
#endif // defined(OS_IOS) |
if (is_allowed) { |
- MessageLoop::current()->PostTask(FROM_HERE, |
+ base::MessageLoop::current()->PostTask( |
+ FROM_HERE, |
base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, |
- weak_factory_.GetWeakPtr(), session_id, EVENT_START)); |
+ weak_factory_.GetWeakPtr(), |
+ session_id, |
+ EVENT_START)); |
} else { |
OnRecognitionError(session_id, SpeechRecognitionError( |
SPEECH_RECOGNITION_ERROR_NOT_ALLOWED)); |
- MessageLoop::current()->PostTask(FROM_HERE, |
+ base::MessageLoop::current()->PostTask( |
+ FROM_HERE, |
base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, |
- weak_factory_.GetWeakPtr(), session_id, EVENT_ABORT)); |
+ weak_factory_.GetWeakPtr(), |
+ session_id, |
+ EVENT_ABORT)); |
} |
} |
@@ -225,9 +231,12 @@ void SpeechRecognitionManagerImpl::AbortSession(int session_id) { |
BrowserMainLoop::GetMediaStreamManager()->CancelRequest(context.label); |
#endif // !defined(OS_IOS) |
- MessageLoop::current()->PostTask(FROM_HERE, |
+ base::MessageLoop::current()->PostTask( |
+ FROM_HERE, |
base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, |
- weak_factory_.GetWeakPtr(), session_id, EVENT_ABORT)); |
+ weak_factory_.GetWeakPtr(), |
+ session_id, |
+ EVENT_ABORT)); |
} |
void SpeechRecognitionManagerImpl::StopAudioCaptureForSession(int session_id) { |
@@ -242,9 +251,12 @@ void SpeechRecognitionManagerImpl::StopAudioCaptureForSession(int session_id) { |
BrowserMainLoop::GetMediaStreamManager()->CancelRequest(context.label); |
#endif // !defined(OS_IOS) |
- MessageLoop::current()->PostTask(FROM_HERE, |
+ base::MessageLoop::current()->PostTask( |
+ FROM_HERE, |
base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, |
- weak_factory_.GetWeakPtr(), session_id, EVENT_STOP_CAPTURE)); |
+ weak_factory_.GetWeakPtr(), |
+ session_id, |
+ EVENT_STOP_CAPTURE)); |
} |
// Here begins the SpeechRecognitionEventListener interface implementation, |
@@ -331,9 +343,12 @@ void SpeechRecognitionManagerImpl::OnAudioEnd(int session_id) { |
delegate_listener->OnAudioEnd(session_id); |
if (SpeechRecognitionEventListener* listener = GetListener(session_id)) |
listener->OnAudioEnd(session_id); |
- MessageLoop::current()->PostTask(FROM_HERE, |
+ base::MessageLoop::current()->PostTask( |
+ FROM_HERE, |
base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, |
- weak_factory_.GetWeakPtr(), session_id, EVENT_AUDIO_ENDED)); |
+ weak_factory_.GetWeakPtr(), |
+ session_id, |
+ EVENT_AUDIO_ENDED)); |
} |
void SpeechRecognitionManagerImpl::OnRecognitionResults( |
@@ -390,7 +405,8 @@ void SpeechRecognitionManagerImpl::OnRecognitionEnd(int session_id) { |
delegate_listener->OnRecognitionEnd(session_id); |
if (SpeechRecognitionEventListener* listener = GetListener(session_id)) |
listener->OnRecognitionEnd(session_id); |
- MessageLoop::current()->PostTask(FROM_HERE, |
+ base::MessageLoop::current()->PostTask( |
+ FROM_HERE, |
base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, |
weak_factory_.GetWeakPtr(), |
session_id, |