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

Unified Diff: content/browser/speech/speech_recognition_dispatcher_host.cc

Issue 1351643003: Fix WebSpeech API for OOPIF based <webview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits from Charlie Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/speech_recognition_dispatcher_host.cc
diff --git a/content/browser/speech/speech_recognition_dispatcher_host.cc b/content/browser/speech/speech_recognition_dispatcher_host.cc
index f920c51e779d6632c6eab3f1c8ee304080c789aa..3512aca22151060bbd3ec96f632eae26f83395ec 100644
--- a/content/browser/speech/speech_recognition_dispatcher_host.cc
+++ b/content/browser/speech/speech_recognition_dispatcher_host.cc
@@ -98,17 +98,19 @@ void SpeechRecognitionDispatcherHost::OnStartRequest(
LOG(WARNING) << "SRDH::OnStartRequest, RenderViewHost does not exist";
return;
}
+
WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
WebContents::FromRenderViewHost(render_view_host));
- BrowserPluginGuest* guest = web_contents->GetBrowserPluginGuest();
- if (guest) {
- // If the speech API request was from a guest, save the context of the
- // embedder since we will use it to decide permission.
+ WebContentsImpl* outer_web_contents = web_contents->GetOuterWebContents();
+ if (outer_web_contents) {
+ // If the speech API request was from an inner WebContents or a guest, save
+ // the context of the outer WebContents or the embedder since we will use it
+ // to decide permission.
embedder_render_process_id =
- guest->embedder_web_contents()->GetRenderProcessHost()->GetID();
+ outer_web_contents->GetRenderProcessHost()->GetID();
DCHECK_NE(embedder_render_process_id, 0);
embedder_render_view_id =
- guest->embedder_web_contents()->GetRenderViewHost()->GetRoutingID();
+ outer_web_contents->GetRenderViewHost()->GetRoutingID();
DCHECK_NE(embedder_render_view_id, MSG_ROUTING_NONE);
}
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698