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

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: enable test 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
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..587b1e917fe60b0458a377a1e84b86a747f9f150 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 outer WebContents or a guest, save
Charlie Reis 2015/09/24 05:09:14 s/outer/inner/, right?
lazyboy 2015/09/28 03:37:16 Yes, thanks. Done.
+ // 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') | content/browser/web_contents/web_contents_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698