Chromium Code Reviews| Index: content/public/browser/speech_recognition_session_context.h |
| diff --git a/content/public/browser/speech_recognition_session_context.h b/content/public/browser/speech_recognition_session_context.h |
| index 532a4e47e6533c899452e7d5406862dcff397dc3..62e253c69136d2ab63f88633ad765f992e3d620c 100644 |
| --- a/content/public/browser/speech_recognition_session_context.h |
| +++ b/content/public/browser/speech_recognition_session_context.h |
| @@ -13,6 +13,8 @@ |
| namespace content { |
| +class RenderFrameHost; |
| + |
| // The context information required by clients of the SpeechRecognitionManager |
| // and its delegates for mapping the recognition session to other browser |
| // elements involved with it (e.g., the page element that requested the |
| @@ -24,26 +26,29 @@ struct CONTENT_EXPORT SpeechRecognitionSessionContext { |
| SpeechRecognitionSessionContext(); |
| ~SpeechRecognitionSessionContext(); |
| - int render_process_id; |
| - int render_view_id; |
| - int render_frame_id; |
| + // This could be { render_process_id, render_frame_id } but getting a |
| + // RenderFrameHost* from those must be done on the UI thread which makes it |
| + // really inconvenient. Instead, SpeechRecognitionDispatcherHost informs the |
|
Charlie Reis
2014/11/11 04:37:31
This is unsafe. RenderFrameHost itself cannot be
|
| + // SpeechRecognitionManager when a RenderFrameHost has been killed so the |
| + // associated SpeechRecognitionSessionContext can be deleted. |
| + RenderFrameHost* render_frame_host; |
| - // Browser plugin guest's render view id, if this context represents a speech |
| + // Browser plugin guest's render frame id, if this context represents a speech |
| // recognition request from an embedder on behalf of the guest. This is used |
| // for input tag where speech bubble is to be shown. |
| // |
| // TODO(lazyboy): Right now showing bubble from guest does not work, we fall |
| // back to embedder instead, fix this and use |
| - // embedder_render_process_id/embedder_render_view_id similar to Web Speech |
| + // embedder_render_process_id/embedder_render_frame_id similar to Web Speech |
| // API below. |
| - int guest_render_view_id; |
| + int guest_render_frame_id; |
| - // The pair (|embedder_render_process_id|, |embedder_render_view_id|) |
| + // The pair (|embedder_render_process_id|, |embedder_render_frame_id|) |
| // represents a Browser plugin guest's embedder. This is filled in if the |
| // session is from a guest Web Speech API. We use these to check if the |
| // embedder (app) is permitted to use audio. |
| int embedder_render_process_id; |
| - int embedder_render_view_id; |
| + int embedder_render_frame_id; |
| int request_id; |