RESOLVED FIXED174073
Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism
https://bugs.webkit.org/show_bug.cgi?id=174073
Summary Switch all WebKit API related to favicons from WebIconDatabase over to new We...
Brady Eidson
Reported 2017-07-01 22:13:34 PDT
Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism With the test I'm adding over in https://bugs.webkit.org/show_bug.cgi?id=174069, this patch will demonstrate no regressions and - in fact - will show a *progression* in the KVO observation of the mainFrameIcon. This will also prep us to cut out massive swaths of icondatabase related code.
Attachments
Patch (23.04 KB, patch)
2017-07-02 17:12 PDT, Brady Eidson
no flags
Patch (23.04 KB, patch)
2017-07-02 18:03 PDT, Brady Eidson
no flags
Archive of layout-test-results from ews101 for mac-elcapitan (348.34 KB, application/zip)
2017-07-02 18:48 PDT, Build Bot
no flags
Archive of layout-test-results from ews114 for mac-elcapitan (2.62 MB, application/zip)
2017-07-02 18:58 PDT, Build Bot
no flags
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (1.16 MB, application/zip)
2017-07-02 19:10 PDT, Build Bot
no flags
Patch (26.38 KB, patch)
2017-07-02 20:29 PDT, Brady Eidson
no flags
Archive of layout-test-results from ews100 for mac-elcapitan (377.45 KB, application/zip)
2017-07-02 21:15 PDT, Build Bot
no flags
Archive of layout-test-results from ews114 for mac-elcapitan (7.36 MB, application/zip)
2017-07-02 21:25 PDT, Build Bot
no flags
Patch (26.43 KB, patch)
2017-07-02 22:13 PDT, Brady Eidson
no flags
Archive of layout-test-results from ews100 for mac-elcapitan (674.63 KB, application/zip)
2017-07-02 22:54 PDT, Build Bot
no flags
Patch (28.54 KB, patch)
2017-07-02 22:54 PDT, Brady Eidson
no flags
Archive of layout-test-results from ews102 for mac-elcapitan (1.14 MB, application/zip)
2017-07-02 23:33 PDT, Build Bot
no flags
Patch (30.98 KB, patch)
2017-07-02 23:46 PDT, Brady Eidson
no flags
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (1.36 MB, application/zip)
2017-07-03 03:25 PDT, Build Bot
no flags
Patch (31.07 KB, patch)
2017-07-03 07:26 PDT, Brady Eidson
no flags
Patch (31.21 KB, patch)
2017-07-03 11:15 PDT, Brady Eidson
no flags
Brady Eidson
Comment 1 2017-07-02 17:12:37 PDT Comment hidden (obsolete)
Brady Eidson
Comment 2 2017-07-02 18:03:46 PDT Comment hidden (obsolete)
Build Bot
Comment 3 2017-07-02 18:48:46 PDT Comment hidden (obsolete)
Build Bot
Comment 4 2017-07-02 18:48:47 PDT Comment hidden (obsolete)
Build Bot
Comment 5 2017-07-02 18:58:42 PDT Comment hidden (obsolete)
Build Bot
Comment 6 2017-07-02 18:58:43 PDT Comment hidden (obsolete)
Build Bot
Comment 7 2017-07-02 19:10:00 PDT Comment hidden (obsolete)
Build Bot
Comment 8 2017-07-02 19:10:02 PDT Comment hidden (obsolete)
Brady Eidson
Comment 9 2017-07-02 20:04:12 PDT Comment hidden (obsolete)
Brady Eidson
Comment 10 2017-07-02 20:29:20 PDT Comment hidden (obsolete)
Build Bot
Comment 11 2017-07-02 21:15:18 PDT Comment hidden (obsolete)
Build Bot
Comment 12 2017-07-02 21:15:19 PDT Comment hidden (obsolete)
Build Bot
Comment 13 2017-07-02 21:25:00 PDT Comment hidden (obsolete)
Build Bot
Comment 14 2017-07-02 21:25:02 PDT Comment hidden (obsolete)
Brady Eidson
Comment 15 2017-07-02 21:53:35 PDT Comment hidden (obsolete)
Brady Eidson
Comment 16 2017-07-02 21:53:51 PDT Comment hidden (obsolete)
Brady Eidson
Comment 17 2017-07-02 21:54:58 PDT Comment hidden (obsolete)
Brady Eidson
Comment 18 2017-07-02 21:55:17 PDT Comment hidden (obsolete)
Brady Eidson
Comment 19 2017-07-02 22:02:21 PDT Comment hidden (obsolete)
Brady Eidson
Comment 20 2017-07-02 22:13:18 PDT Comment hidden (obsolete)
Brady Eidson
Comment 21 2017-07-02 22:37:58 PDT Comment hidden (obsolete)
Build Bot
Comment 22 2017-07-02 22:54:33 PDT Comment hidden (obsolete)
Build Bot
Comment 23 2017-07-02 22:54:35 PDT Comment hidden (obsolete)
Brady Eidson
Comment 24 2017-07-02 22:54:43 PDT Comment hidden (obsolete)
Brady Eidson
Comment 25 2017-07-02 23:22:43 PDT Comment hidden (obsolete)
Brady Eidson
Comment 26 2017-07-02 23:29:40 PDT Comment hidden (obsolete)
Build Bot
Comment 27 2017-07-02 23:33:48 PDT Comment hidden (obsolete)
Build Bot
Comment 28 2017-07-02 23:33:50 PDT Comment hidden (obsolete)
Brady Eidson
Comment 29 2017-07-02 23:33:58 PDT Comment hidden (obsolete)
Brady Eidson
Comment 30 2017-07-02 23:37:28 PDT Comment hidden (obsolete)
Brady Eidson
Comment 31 2017-07-02 23:41:26 PDT Comment hidden (obsolete)
Brady Eidson
Comment 32 2017-07-02 23:46:07 PDT Comment hidden (obsolete)
Build Bot
Comment 33 2017-07-03 03:25:45 PDT Comment hidden (obsolete)
Build Bot
Comment 34 2017-07-03 03:25:46 PDT Comment hidden (obsolete)
Brady Eidson
Comment 35 2017-07-03 07:22:21 PDT Comment hidden (obsolete)
Brady Eidson
Comment 36 2017-07-03 07:26:43 PDT
Andy Estes
Comment 37 2017-07-03 11:01:50 PDT
Comment on attachment 314481 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=314481&action=review > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2283 > + auto* frame = core(m_webFrame.get()); > + DocumentLoader* documentLoader = frame->loader().documentLoader(); > + ASSERT(documentLoader); Can these be references instead of pointers? > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2289 > + if (!frame->isMainFrame() || !documentLoader->url().protocolIsInHTTPFamily() || ![WebView _isIconLoadingEnabled] || disallowedDueToImageLoadSettings) { I'd rewrite this to check disallowedDueToImageLoadSettings first. > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2299 > + for (auto icon = icons.rbegin(); icon != icons.rend(); ++icon) { It's not clear to me why we have to iterate backwards; I'm sure there's a reason. > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2311 > + // No WebCore icon loading on iOS > + for (auto& icon : icons) > + documentLoader->didGetLoadDecisionForIcon(false, icon.second, 0); Can iOS be handled like the other cases where icon loading is disallowed? > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:1794 > + for (auto& icon : icons) > + webPage->send(Messages::WebPageProxy::GetLoadDecisionForIcon(icon.first, CallbackID::fromInteger(icon.second))); Can this be sent as one message containing all the icons instead of a message for each icon? > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h:260 > + void getLoadDecisionForIcons(const Vector<std::pair<WebCore::LinkIcon&, uint64_t>>&) final; The vector of pairs could use a typedef.
Brady Eidson
Comment 38 2017-07-03 11:07:49 PDT
(In reply to Andy Estes from comment #37) > Comment on attachment 314481 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=314481&action=review > > > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2283 > > + auto* frame = core(m_webFrame.get()); > > + DocumentLoader* documentLoader = frame->loader().documentLoader(); > > + ASSERT(documentLoader); > > Can these be references instead of pointers? You mean at the level of rearchitecting WebFrameLoaderClient? The WebFrame could be, the DocumentLoader probably not. You mean in this patch? No. > > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2289 > > + if (!frame->isMainFrame() || !documentLoader->url().protocolIsInHTTPFamily() || ![WebView _isIconLoadingEnabled] || disallowedDueToImageLoadSettings) { > > I'd rewrite this to check disallowedDueToImageLoadSettings first. Yah probably a good call. > > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2299 > > + for (auto icon = icons.rbegin(); icon != icons.rend(); ++icon) { > > It's not clear to me why we have to iterate backwards; I'm sure there's a > reason. I'll add a comment. It's preserving previous behavior of choosing the last icon listed instead of the first. > > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2311 > > + // No WebCore icon loading on iOS > > + for (auto& icon : icons) > > + documentLoader->didGetLoadDecisionForIcon(false, icon.second, 0); > > Can iOS be handled like the other cases where icon loading is disallowed? I briefly considered a way of combining the runtime "disallowed" check with the iOS build time behavior. Every iteration I came up with made the code super ugly. > > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:1794 > > + for (auto& icon : icons) > > + webPage->send(Messages::WebPageProxy::GetLoadDecisionForIcon(icon.first, CallbackID::fromInteger(icon.second))); > > Can this be sent as one message containing all the icons instead of a > message for each icon? Yes, but that's outside the scope of this patch. (Before this patch the UI process expects one at a time, and the same is true after this patch)
Andy Estes
Comment 39 2017-07-03 11:13:25 PDT
(In reply to Brady Eidson from comment #38) > (In reply to Andy Estes from comment #37) > > Comment on attachment 314481 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=314481&action=review > > > > > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2283 > > > + auto* frame = core(m_webFrame.get()); > > > + DocumentLoader* documentLoader = frame->loader().documentLoader(); > > > + ASSERT(documentLoader); > > > > Can these be references instead of pointers? > > You mean at the level of rearchitecting WebFrameLoaderClient? > The WebFrame could be, the DocumentLoader probably not. > > You mean in this patch? No. I simply meant: auto& frame = *core(m_webFrame.get()); DocumentLoader& documentLoader = *frame->loader().documentLoader();
Brady Eidson
Comment 40 2017-07-03 11:15:00 PDT
Brady Eidson
Comment 41 2017-07-03 14:26:37 PDT
(In reply to Andy Estes from comment #39) > (In reply to Brady Eidson from comment #38) > > (In reply to Andy Estes from comment #37) > > > Comment on attachment 314481 [details] > > > Patch > > > > > > View in context: > > > https://bugs.webkit.org/attachment.cgi?id=314481&action=review > > > > > > > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:2283 > > > > + auto* frame = core(m_webFrame.get()); > > > > + DocumentLoader* documentLoader = frame->loader().documentLoader(); > > > > + ASSERT(documentLoader); > > > > > > Can these be references instead of pointers? > > > > You mean at the level of rearchitecting WebFrameLoaderClient? > > The WebFrame could be, the DocumentLoader probably not. > > > > You mean in this patch? No. > > I simply meant: > > auto& frame = *core(m_webFrame.get()); > DocumentLoader& documentLoader = *frame->loader().documentLoader(); Oh, no, I much prefer to hold the ASSERT.
WebKit Commit Bot
Comment 42 2017-07-03 15:17:05 PDT
Comment on attachment 314500 [details] Patch Clearing flags on attachment: 314500 Committed r219099: <http://trac.webkit.org/changeset/219099>
WebKit Commit Bot
Comment 43 2017-07-03 15:17:07 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.