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

Issue 636863003: Make SpeechRecognition per RenderFrame instead of per RenderView.

Created:
6 years, 2 months ago by mlamouri (slow - plz ping)
Modified:
5 years, 11 months ago
Reviewers:
Charlie Reis
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, jochen+watch_chromium.org, mkwst+moarreviews-ipc_chromium.org, mkwst+moarreviews-renderer_chromium.org, mkwst+moarreviews-shell_chromium.org, nasko+codewatch_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make SpeechRecognition per RenderFrame instead of per RenderView. This is updating the Chromium code. It is part of a multi sided patch list. Part 1: https://codereview.chromium.org/636863002 Part 2: <this> Part 3: https://codereview.chromium.org/752303003/ BUG=390749

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : passing tests #

Patch Set 4 : cleanups #

Total comments: 3

Patch Set 5 : fixes threading issues #

Total comments: 24

Patch Set 6 : rebase + review comments #

Patch Set 7 : review comments #

Total comments: 9

Patch Set 8 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+422 lines, -357 lines) Patch
M chrome/browser/speech/chrome_speech_recognition_manager_delegate.h View 1 2 3 4 5 3 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc View 1 2 3 4 5 6 7 15 chunks +66 lines, -91 lines 0 comments Download
M chrome/browser/ui/app_list/speech_recognizer.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/loader/resource_scheduler_filter.cc View 1 chunk +5 lines, -6 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/speech/speech_recognition_dispatcher_host.h View 1 2 3 4 5 6 7 2 chunks +32 lines, -18 lines 0 comments Download
M content/browser/speech/speech_recognition_dispatcher_host.cc View 1 2 3 4 5 6 7 11 chunks +199 lines, -90 lines 0 comments Download
M content/browser/speech/speech_recognition_manager_impl.h View 1 2 3 4 1 chunk +3 lines, -4 lines 0 comments Download
M content/browser/speech/speech_recognition_manager_impl.cc View 1 2 3 4 5 6 7 2 chunks +15 lines, -32 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -5 lines 0 comments Download
M content/common/speech_recognition_messages.h View 1 2 3 4 5 6 7 2 chunks +15 lines, -16 lines 0 comments Download
M content/public/browser/speech_recognition_manager.h View 1 2 3 4 2 chunks +5 lines, -9 lines 0 comments Download
M content/public/browser/speech_recognition_session_context.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -6 lines 0 comments Download
M content/public/browser/speech_recognition_session_context.cc View 1 2 3 4 1 chunk +3 lines, -4 lines 0 comments Download
M content/public/test/fake_speech_recognition_manager.h View 1 2 3 4 1 chunk +3 lines, -4 lines 0 comments Download
M content/public/test/fake_speech_recognition_manager.cc View 1 2 3 4 3 chunks +7 lines, -10 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 4 chunks +13 lines, -5 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 3 chunks +0 lines, -6 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 4 chunks +0 lines, -10 lines 0 comments Download
M content/renderer/speech_recognition_dispatcher.h View 1 2 3 4 5 3 chunks +6 lines, -9 lines 0 comments Download
M content/renderer/speech_recognition_dispatcher.cc View 1 2 3 4 5 6 5 chunks +11 lines, -10 lines 0 comments Download
M content/shell/renderer/test_runner/web_frame_test_proxy.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -0 lines 0 comments Download
M content/shell/renderer/test_runner/web_test_proxy.h View 1 2 3 4 5 6 7 2 chunks +0 lines, -4 lines 0 comments Download
M content/shell/renderer/test_runner/web_test_proxy.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -4 lines 0 comments Download
M extensions/shell/browser/shell_speech_recognition_manager_delegate.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M extensions/shell/browser/shell_speech_recognition_manager_delegate.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -7 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
mlamouri (slow - plz ping)
I'm not a very big fan of using RenderFrameHost* instead of render_frame_id and render_process_id in ...
6 years, 1 month ago (2014-11-10 20:09:40 UTC) #3
Charlie Reis
Hmm, I started reviewing this but it's accessing UI thread objects (WebContents, RFH) on the ...
6 years, 1 month ago (2014-11-11 04:37:31 UTC) #4
mlamouri (slow - plz ping)
Thanks for the review Charlie. I was actually not aware that WebContents and RenderFrameHost are ...
6 years ago (2014-11-28 14:31:49 UTC) #6
Charlie Reis
Thanks, looking better. One question about WebContentsObserver vs BrowserMessageFilter below, plus some nits. https://codereview.chromium.org/636863003/diff/80001/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc File ...
6 years ago (2014-12-01 23:49:43 UTC) #7
mlamouri (slow - plz ping)
PTAL https://codereview.chromium.org/636863003/diff/80001/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc File chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc (left): https://codereview.chromium.org/636863003/diff/80001/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc#oldcode362 chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc:362: DCHECK_NE(context.render_process_id, 0); On 2014/12/01 23:49:42, Charlie Reis wrote: ...
6 years ago (2014-12-08 17:41:04 UTC) #8
Charlie Reis
Thanks! See my comment about BrowserMessageFilter vs WCO below. Minor nit: it helps if you ...
6 years ago (2014-12-08 20:02:57 UTC) #9
mlamouri (slow - plz ping)
All comments applied. PTAL. https://codereview.chromium.org/636863003/diff/80001/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc File chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc (left): https://codereview.chromium.org/636863003/diff/80001/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc#oldcode362 chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc:362: DCHECK_NE(context.render_process_id, 0); On 2014/12/08 20:02:57, ...
6 years ago (2014-12-08 21:08:01 UTC) #10
Charlie Reis
Thanks, that looks better. A few questions below, but I think it's close. https://codereview.chromium.org/636863003/diff/80001/content/browser/speech/speech_recognition_dispatcher_host.h File ...
6 years ago (2014-12-09 00:52:34 UTC) #11
mlamouri (slow - plz ping)
5 years, 11 months ago (2015-01-19 11:20:23 UTC) #12
Review comments applied. I've also started something with regards to aborting
sessions when a RFH is killed. There might be some more work needed there with
threading but I will have to have a look next time I allocate time for this 20%.

https://codereview.chromium.org/636863003/diff/120001/chrome/browser/speech/c...
File chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc (left):

https://codereview.chromium.org/636863003/diff/120001/chrome/browser/speech/c...
chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc:360: // Make
sure that initiators (extensions/web pages) properly set the
On 2014/12/09 at 00:52:33, Charlie Reis wrote:
> Let's preserve this comment, since it gives the motivation.

Done. Moved where the check happens.

https://codereview.chromium.org/636863003/diff/120001/content/browser/speech/...
File content/browser/speech/speech_recognition_dispatcher_host.h (right):

https://codereview.chromium.org/636863003/diff/120001/content/browser/speech/...
content/browser/speech/speech_recognition_dispatcher_host.h:76: void
OnAbortRequest(int request_id, int render_frame_id);
On 2014/12/09 at 00:52:33, Charlie Reis wrote:
> Why reverse these parameters?  I would normally expect the frame's routing ID
to come before the request ID, since request IDs are specific to a frame.  (Or
did that change?)
> 
> Also, since they're both ints, it seems like swapping the order would make it
to end up with bugs where they're passed in the wrong order, without compiler
help for detecting it.
> 
> Same for OnStopCaptureRequest.

Done.

https://codereview.chromium.org/636863003/diff/120001/content/browser/web_con...
File content/browser/web_contents/web_contents_impl.h (right):

https://codereview.chromium.org/636863003/diff/120001/content/browser/web_con...
content/browser/web_contents/web_contents_impl.h:30: #include
"content/public/browser/browser_thread.h"
On 2014/12/09 at 00:52:33, Charlie Reis wrote:
> Unnecessary now?

Removed.

https://codereview.chromium.org/636863003/diff/120001/extensions/shell/browse...
File extensions/shell/browser/shell_speech_recognition_manager_delegate.cc
(right):

https://codereview.chromium.org/636863003/diff/120001/extensions/shell/browse...
extensions/shell/browser/shell_speech_recognition_manager_delegate.cc:115: const
content::RenderViewHost* render_view_host =
On 2014/12/09 at 00:52:33, Charlie Reis wrote:
> We don't need |render_view_host| if we use WebContents::FromRenderFrameHost
below, right?  Same for the #include.

Right ;)

Powered by Google App Engine
This is Rietveld 408576698