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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2553993003: PlzNavigate: fix flaky TabManagerTest.TabManagerBasics browser test. (Closed)
Patch Set: Created 4 years 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 | « chrome/browser/memory/tab_manager_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 46a226f7c67434387fa3d2765c8253817d999130..d6a4f94c90a6b273276b6b3f997db6ddabda43d9 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -674,9 +674,15 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
RenderFrameHost* render_frame_host,
const IPC::Message& message) {
DCHECK(render_view_host || render_frame_host);
- if (GetWebUI() &&
- static_cast<WebUIImpl*>(GetWebUI())->OnMessageReceived(message)) {
- return true;
+
+ if (render_view_host) {
+ RenderFrameHost* main_frame = render_view_host->GetMainFrame();
+ if (main_frame) {
jam 2016/12/08 17:43:53 nit: are you sure you need this check?
yzshen1 2016/12/08 17:46:19 Yes, there are cases where render_view_host->GetMa
+ WebUIImpl* web_ui =
+ static_cast<RenderFrameHostImpl*>(main_frame)->web_ui();
+ if (web_ui && web_ui->OnMessageReceived(message))
+ return true;
+ }
}
if (render_frame_host) {
« no previous file with comments | « chrome/browser/memory/tab_manager_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698