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 d96814515a88d7f2fa6fec2e54d0288d5af9c00f..19c4e0198433ff2d1dfdf55105b52bc7c61cdc0d 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -774,7 +774,6 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHostImpl* render_view_host, |
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, |
OnRequestPpapiBrokerPermission) |
#endif |
- IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) |
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowValidationMessage, |
OnShowValidationMessage) |
IPC_MESSAGE_HANDLER(ViewHostMsg_HideValidationMessage, |
@@ -829,6 +828,7 @@ bool WebContentsImpl::OnMessageReceived(RenderFrameHostImpl* render_frame_host, |
IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, |
OnUpdatePageImportanceSignals) |
IPC_MESSAGE_HANDLER(FrameHostMsg_Find_Reply, OnFindReply) |
+ IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) |
#if BUILDFLAG(ENABLE_PLUGINS) |
IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated, |
OnPepperInstanceCreated) |
@@ -4144,13 +4144,19 @@ void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host, |
#endif // BUILDFLAG(ENABLE_PLUGINS) |
void WebContentsImpl::OnUpdateFaviconURL( |
- RenderViewHostImpl* source, |
+ RenderFrameHostImpl* source, |
const std::vector<FaviconURL>& candidates) { |
+ // Ignore favicons for non-main frame. |
+ if (source->GetParent()) { |
+ NOTREACHED(); |
+ return; |
+ } |
+ |
// We get updated favicon URLs after the page stops loading. If a cross-site |
// navigation occurs while a page is still loading, the initial page |
// may stop loading and send us updated favicon URLs after the navigation |
// for the new page has committed. |
- if (!source->is_active()) |
+ if (!source->IsCurrent()) |
return; |
for (auto& observer : observers_) |