Make UpdateFaviconURL IPC target a frame, rather than a view.
This CL has 3 main parts:
- Removing no-op implementation of IconURLs method from
WebRemoteFrameImpl and moving declaration of this virtual method from
WebFrame to WebLocalFrame. This change is contained within
third_party/WebKit and addresses https://crbug.com/416660.
- Moving handling of icon updates from RenderView to RenderFrame
(this includes moving the IPC from view_messages.h to
frame_messages.h). This change is in the //content layer and
addresses the left-over methods and the comment from r263486
related to https://crbug.com/361761.
- Refactoring of content::FaviconURL::IconType to highlight the fact
that the enum values should NOT be used as bit masks.
BUG=361761, 416660
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
[email protected], [email protected]
Review-Url: https://codereview.chromium.org/2918903002
Cr-Commit-Position: refs/heads/master@{#477803}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d9681451..19c4e01 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -774,7 +774,6 @@
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 @@
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 @@
#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_)