commit | ab48fc09bde27056d7ac48f88d7c141a7d3d58a2 | [log] [tgz] |
---|---|---|
author | Alan Cutter <[email protected]> | Mon Feb 24 12:26:42 2020 |
committer | Commit Bot <[email protected]> | Mon Feb 24 12:26:42 2020 |
tree | c41541bcfabffa5dfa5d05b7356293a69fffb13d | |
parent | ef383ff421a15285ef996375a4f29aa7f9be85c5 [diff] [blame] |
Don't clear the page's cached favicon URL when iframe navigations start https://chromium-review.googlesource.com/c/chromium/src/+/1959334 upstreamed the favicon caching functionality of ContentFaviconDriver into WebContentsImpl. One thing that it missed was making clearing the favicon cache on navigation start conditional that the main frame was being navigated. This CL adds that conditional and fixes a bug where delayed iframe loads would prevent "Create shortcut..." from working as it would wait indefinitely for a favicon URL event when it saw there was none. Bug: 1046883 Change-Id: I520531558dec2d2daa8817884a33701b75f017bd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2068266 Reviewed-by: Mikel Astiz <[email protected]> Reviewed-by: Kinuko Yasuda <[email protected]> Commit-Queue: Kinuko Yasuda <[email protected]> Auto-Submit: Alan Cutter <[email protected]> Cr-Commit-Position: refs/heads/master@{#743907}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 4b85f236..e6abd33d 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4412,7 +4412,8 @@ void WebContentsImpl::DidStartNavigation(NavigationHandle* navigation_handle) { TRACE_EVENT1("navigation", "WebContentsImpl::DidStartNavigation", "navigation_handle", navigation_handle); - favicon_urls_.clear(); + if (navigation_handle->IsInMainFrame()) + favicon_urls_.clear(); for (auto& observer : observers_) observer.DidStartNavigation(navigation_handle);