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 7a0d5c814104717152dd983d5494f704fc31f756..0a25275729ca3749b6feafdad93fa1ffb49e5842 100644 |
--- a/content/browser/speech/speech_recognition_manager_impl.cc |
+++ b/content/browser/speech/speech_recognition_manager_impl.cc |
@@ -284,20 +284,18 @@ void SpeechRecognitionManagerImpl::OnRecognitionEnd(int session_id) { |
session_id, EVENT_RECOGNITION_ENDED)); |
} |
-// TODO(primiano) After CL2: if we see that both InputTagDispatcherHost and |
-// SpeechRecognitionDispatcherHost do the same lookup operations, implement the |
-// lookup method directly here. |
int SpeechRecognitionManagerImpl::LookupSessionByContext( |
- Callback<bool(const SpeechRecognitionSessionContext&)> matcher) const { |
+ int render_process_id, int render_view_id, int request_id) const { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
SessionsTable::const_iterator iter; |
- // Note: the callback (matcher) must NEVER perform non-const calls on us. |
for(iter = sessions_.begin(); iter != sessions_.end(); ++iter) { |
const int session_id = iter->first; |
- const Session& session = iter->second; |
- bool matches = matcher.Run(session.context); |
- if (matches) |
+ const SpeechRecognitionSessionContext& context = iter->second.context; |
+ if (context.render_process_id == render_process_id && |
+ context.render_view_id == render_view_id && |
+ context.request_id == request_id) { |
return session_id; |
+ } |
} |
return kSessionIDInvalid; |
} |