diff options
author | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-24 16:04:57 +0000 |
---|---|---|
committer | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-24 16:04:57 +0000 |
commit | 6f34fc29f326f1aac4edfa3ce03a4237aea22bc1 (patch) | |
tree | 3246bcd93678ff8128824ddc0b12d32c5fca1cfd /content/browser/speech/speech_recognition_manager_impl.cc | |
parent | d16e704e8f6e0fd8e71f68408bc50dabd427d83d (diff) | |
download | chromium_src-6f34fc29f326f1aac4edfa3ce03a4237aea22bc1.zip chromium_src-6f34fc29f326f1aac4edfa3ce03a4237aea22bc1.tar.gz chromium_src-6f34fc29f326f1aac4edfa3ce03a4237aea22bc1.tar.bz2 |
Revert 138801 - Introduced SpeechRecognitionDispatcher(Host) classes, handling dispatch of IPC messages for continuous speech recognition. (Speech CL2.1)
It looks like this bumped the Linux x64 size with ~40k, causing the perf bot to go red: http://build.chromium.org/p/chromium/buildstatus?builder=Linux%20x64&number=30110
Will try to figure out what's going on and re-land later.
BUG=116954
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10273006
TBR=primiano@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10443009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138807 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/speech/speech_recognition_manager_impl.cc')
-rw-r--r-- | content/browser/speech/speech_recognition_manager_impl.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/content/browser/speech/speech_recognition_manager_impl.cc b/content/browser/speech/speech_recognition_manager_impl.cc index 6bad70f..e1c3298 100644 --- a/content/browser/speech/speech_recognition_manager_impl.cc +++ b/content/browser/speech/speech_recognition_manager_impl.cc @@ -282,18 +282,20 @@ void SpeechRecognitionManagerImpl::OnRecognitionEnd(int session_id) { this->AsWeakPtr(), session_id, EVENT_RECOGNITION_ENDED)); } -int SpeechRecognitionManagerImpl::GetSession( - int render_process_id, int render_view_id, int request_id) const { +// 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 { 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 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) { + const Session& session = iter->second; + bool matches = matcher.Run(session.context); + if (matches) return session_id; - } } return kSessionIDInvalid; } |