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

Issue 3108007: Adds SpeechInputManagerImpl to handle requests from render views and return recognition events. (Closed)

Created:
10 years, 4 months ago by Satish
Modified:
9 years, 7 months ago
Reviewers:
bulach
CC:
chromium-reviews, ben+cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Adds SpeechInputManagerImpl to handle requests from render views and return recognition events. This CL depends on http://codereview.chromium.org/3124009 going in first for the SpeechRecognizer class. Also renamed SpeechInputManager::Listener to Delegate to be consistent with Chromium terminology. TEST=manually, open a webpage containing an <input speech> tag and click on the speech button to test. BUG=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=56002

Patch Set 1 #

Total comments: 7

Patch Set 2 : Address marcus's comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -16 lines) Patch
M chrome/browser/speech/speech_input_browsertest.cc View 2 chunks +8 lines, -8 lines 0 comments Download
M chrome/browser/speech/speech_input_dispatcher_host.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/speech/speech_input_manager.h View 3 chunks +9 lines, -3 lines 0 comments Download
M chrome/browser/speech/speech_input_manager.cc View 1 1 chunk +88 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Satish
10 years, 4 months ago (2010-08-11 10:25:25 UTC) #1
bulach
LGTM looks fine, thanks! some nits and suggestions below: http://codereview.chromium.org/3108007/diff/1/4 File chrome/browser/speech/speech_input_manager.cc (right): http://codereview.chromium.org/3108007/diff/1/4#newcode16 chrome/browser/speech/speech_input_manager.cc:16: ...
10 years, 4 months ago (2010-08-11 10:55:12 UTC) #2
Satish
10 years, 4 months ago (2010-08-11 11:27:30 UTC) #3
Thanks for the quick review. A couple of replies below.

http://codereview.chromium.org/3108007/diff/1/4
File chrome/browser/speech/speech_input_manager.cc (right):

http://codereview.chromium.org/3108007/diff/1/4#newcode50
chrome/browser/speech/speech_input_manager.cc:50:
recognizers_.begin()->second->StopRecording(true);
On 2010/08/11 10:55:13, bulach wrote:
> hmm, shouldn't this class outlive the recognizers, i.e., here it should check
> that recognizers_.empty() ?

Technically yes it should outlive. But in case there is a render view which
crashes or due to a bug doesn't call CancelRecognition before it closes, we'll
have some recognizers hanging in here. We need to call StopRecording explicitly
to stop the audio recorder and free up resources properly, hence I added this
here.

http://codereview.chromium.org/3108007/diff/1/4#newcode57
chrome/browser/speech/speech_input_manager.cc:57: return;
On 2010/08/11 10:55:13, bulach wrote:
> hmm, the DCHECK and the if are a bit contradictory.. I'd think that it's
either
> fine to start an existing render_view_id again (and then remove the check), or
> it's not allowed, so remove the if?

From what I know DCHECK only checks the condition in debug builds, and I felt it
was better to sanity check than let the code crash in a release build. I can
remove the check if you disagree, as there are pros and cons to both approaches.

Powered by Google App Engine
This is Rietveld 408576698