Index: chrome/browser/ui/app_list/speech_recognizer.cc |
diff --git a/chrome/browser/ui/app_list/speech_recognizer.cc b/chrome/browser/ui/app_list/speech_recognizer.cc |
index 4945b2ef2b2ebf7554186b00f7c3dff7ab8fcb0f..4f2788faa180af32402be03d11056120f2b137b6 100644 |
--- a/chrome/browser/ui/app_list/speech_recognizer.cc |
+++ b/chrome/browser/ui/app_list/speech_recognizer.cc |
@@ -11,6 +11,7 @@ |
#include "base/timer/timer.h" |
#include "chrome/browser/ui/app_list/speech_recognizer_delegate.h" |
#include "content/public/browser/browser_thread.h" |
+#include "content/public/browser/render_frame_host.h" |
#include "content/public/browser/render_process_host.h" |
#include "content/public/browser/speech_recognition_event_listener.h" |
#include "content/public/browser/speech_recognition_manager.h" |
@@ -43,7 +44,7 @@ class SpeechRecognizer::EventListener |
net::URLRequestContextGetter* url_request_context_getter, |
const std::string& locale); |
- void StartOnIOThread(int render_process_id); |
+ void StartOnIOThread(int render_process_id, int render_frame_id); |
void StopOnIOThread(); |
private: |
@@ -104,7 +105,8 @@ SpeechRecognizer::EventListener::~EventListener() { |
DCHECK(!speech_timeout_.IsRunning()); |
} |
-void SpeechRecognizer::EventListener::StartOnIOThread(int render_process_id) { |
+void SpeechRecognizer::EventListener::StartOnIOThread(int render_process_id, |
+ int render_frame_id) { |
DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
if (session_ != kInvalidSessionId) |
StopOnIOThread(); |
@@ -119,6 +121,7 @@ void SpeechRecognizer::EventListener::StartOnIOThread(int render_process_id) { |
config.url_request_context_getter = url_request_context_getter_; |
config.event_listener = weak_factory_.GetWeakPtr(); |
config.initial_context.render_process_id = render_process_id; |
+ config.initial_context.render_frame_id = render_frame_id; |
auto speech_instance = content::SpeechRecognitionManager::GetInstance(); |
session_ = speech_instance->CreateSession(config); |
@@ -276,7 +279,8 @@ void SpeechRecognizer::Start() { |
FROM_HERE, |
base::Bind(&SpeechRecognizer::EventListener::StartOnIOThread, |
speech_event_listener_, |
- contents->GetRenderProcessHost()->GetID())); |
+ contents->GetMainFrame()->GetProcess()->GetID(), |
+ contents->GetMainFrame()->GetRoutingID())); |
} |
void SpeechRecognizer::Stop() { |