WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
174073
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
Details
Formatted Diff
Diff
Patch
(23.04 KB, patch)
2017-07-02 18:03 PDT
,
Brady Eidson
no flags
Details
Formatted Diff
Diff
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
Details
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
Details
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
Details
Patch
(26.38 KB, patch)
2017-07-02 20:29 PDT
,
Brady Eidson
no flags
Details
Formatted Diff
Diff
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
Details
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
Details
Patch
(26.43 KB, patch)
2017-07-02 22:13 PDT
,
Brady Eidson
no flags
Details
Formatted Diff
Diff
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
Details
Patch
(28.54 KB, patch)
2017-07-02 22:54 PDT
,
Brady Eidson
no flags
Details
Formatted Diff
Diff
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
Details
Patch
(30.98 KB, patch)
2017-07-02 23:46 PDT
,
Brady Eidson
no flags
Details
Formatted Diff
Diff
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
Details
Patch
(31.07 KB, patch)
2017-07-03 07:26 PDT
,
Brady Eidson
no flags
Details
Formatted Diff
Diff
Patch
(31.21 KB, patch)
2017-07-03 11:15 PDT
,
Brady Eidson
no flags
Details
Formatted Diff
Diff
Show Obsolete
(15)
View All
Add attachment
proposed patch, testcase, etc.
Brady Eidson
Comment 1
2017-07-02 17:12:37 PDT
Comment hidden (obsolete)
Created
attachment 314429
[details]
Patch
Brady Eidson
Comment 2
2017-07-02 18:03:46 PDT
Comment hidden (obsolete)
Created
attachment 314433
[details]
Patch
Build Bot
Comment 3
2017-07-02 18:48:46 PDT
Comment hidden (obsolete)
Comment on
attachment 314433
[details]
Patch
Attachment 314433
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/4040358
Number of test failures exceeded the failure limit.
Build Bot
Comment 4
2017-07-02 18:48:47 PDT
Comment hidden (obsolete)
Created
attachment 314434
[details]
Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 5
2017-07-02 18:58:42 PDT
Comment hidden (obsolete)
Comment on
attachment 314433
[details]
Patch
Attachment 314433
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/4040361
Number of test failures exceeded the failure limit.
Build Bot
Comment 6
2017-07-02 18:58:43 PDT
Comment hidden (obsolete)
Created
attachment 314435
[details]
Archive of layout-test-results from ews114 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 7
2017-07-02 19:10:00 PDT
Comment hidden (obsolete)
Comment on
attachment 314433
[details]
Patch
Attachment 314433
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/4040387
New failing tests: workers/bomb.html
Build Bot
Comment 8
2017-07-02 19:10:02 PDT
Comment hidden (obsolete)
Created
attachment 314436
[details]
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Brady Eidson
Comment 9
2017-07-02 20:04:12 PDT
Comment hidden (obsolete)
*Layout test* failures... nice! Digging in.
Brady Eidson
Comment 10
2017-07-02 20:29:20 PDT
Comment hidden (obsolete)
Created
attachment 314438
[details]
Patch
Build Bot
Comment 11
2017-07-02 21:15:18 PDT
Comment hidden (obsolete)
Comment on
attachment 314438
[details]
Patch
Attachment 314438
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/4040883
Number of test failures exceeded the failure limit.
Build Bot
Comment 12
2017-07-02 21:15:19 PDT
Comment hidden (obsolete)
Created
attachment 314440
[details]
Archive of layout-test-results from ews100 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 13
2017-07-02 21:25:00 PDT
Comment hidden (obsolete)
Comment on
attachment 314438
[details]
Patch
Attachment 314438
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/4040886
Number of test failures exceeded the failure limit.
Build Bot
Comment 14
2017-07-02 21:25:02 PDT
Comment hidden (obsolete)
Created
attachment 314442
[details]
Archive of layout-test-results from ews114 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Brady Eidson
Comment 15
2017-07-02 21:53:35 PDT
Comment hidden (obsolete)
Huh... the first round of ASSERTS I could easily reproduce locally... not this new round.
Brady Eidson
Comment 16
2017-07-02 21:53:51 PDT
Comment hidden (obsolete)
And I'm not seeing where EWS stashes the crash logs...
Brady Eidson
Comment 17
2017-07-02 21:54:58 PDT
Comment hidden (obsolete)
(In reply to Brady Eidson from
comment #15
)
> Huh... the first round of ASSERTS I could easily reproduce locally... not > this new round.
Oh! These aren't crashes. These are failures. Lots... of failures...
Brady Eidson
Comment 18
2017-07-02 21:55:17 PDT
Comment hidden (obsolete)
(Suffice it to say, not seeing those locally either)
Brady Eidson
Comment 19
2017-07-02 22:02:21 PDT
Comment hidden (obsolete)
(Actually, never mind - can totally reproduce these failures!)
Brady Eidson
Comment 20
2017-07-02 22:13:18 PDT
Comment hidden (obsolete)
Created
attachment 314446
[details]
Patch
Brady Eidson
Comment 21
2017-07-02 22:37:58 PDT
Comment hidden (obsolete)
HTTP tests now all load icons and they shouldn't necessarily. Double-checking what normally keeps them at bay.
Build Bot
Comment 22
2017-07-02 22:54:33 PDT
Comment hidden (obsolete)
Comment on
attachment 314446
[details]
Patch
Attachment 314446
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/4041253
Number of test failures exceeded the failure limit.
Build Bot
Comment 23
2017-07-02 22:54:35 PDT
Comment hidden (obsolete)
Created
attachment 314450
[details]
Archive of layout-test-results from ews100 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Brady Eidson
Comment 24
2017-07-02 22:54:43 PDT
Comment hidden (obsolete)
Created
attachment 314451
[details]
Patch
Brady Eidson
Comment 25
2017-07-02 23:22:43 PDT
Comment hidden (obsolete)
Down to two that are almost certainly actually caused by this change: http/tests/misc/favicon-loads-with-images-disabled.html [ Failure ] http/tests/security/contentSecurityPolicy/block-favicon.html [ Failure ]
Brady Eidson
Comment 26
2017-07-02 23:29:40 PDT
Comment hidden (obsolete)
(In reply to Brady Eidson from
comment #25
)
> Down to two that are almost certainly actually caused by this change: > http/tests/misc/favicon-loads-with-images-disabled.html [ Failure ] > http/tests/security/contentSecurityPolicy/block-favicon.html [ Failure ]
The former was a legit bug in the patch (now fixed) The latter was a legit bug in the test - We actually *should* see the "resource load blocked" console message.
Build Bot
Comment 27
2017-07-02 23:33:48 PDT
Comment hidden (obsolete)
Comment on
attachment 314451
[details]
Patch
Attachment 314451
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/4041390
New failing tests: http/tests/security/contentSecurityPolicy/block-favicon.html http/tests/misc/favicon-loads-with-images-disabled.html
Build Bot
Comment 28
2017-07-02 23:33:50 PDT
Comment hidden (obsolete)
Created
attachment 314455
[details]
Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Brady Eidson
Comment 29
2017-07-02 23:33:58 PDT
Comment hidden (obsolete)
(In reply to Brady Eidson from
comment #26
)
> (In reply to Brady Eidson from
comment #25
) > > The latter was a legit bug in the test - We actually *should* see the > "resource load blocked" console message.
Double checking this - It seems logical to me we should see that the load was actually blocked by our machinery, but maybe it was supposed to be blocked even sooner...?
Brady Eidson
Comment 30
2017-07-02 23:37:28 PDT
Comment hidden (obsolete)
(In reply to Brady Eidson from
comment #29
)
> (In reply to Brady Eidson from
comment #26
) > > (In reply to Brady Eidson from
comment #25
) > > > > The latter was a legit bug in the test - We actually *should* see the > > "resource load blocked" console message. > > Double checking this - It seems logical to me we should see that the load > was actually blocked by our machinery, but maybe it was supposed to be > blocked even sooner...?
Yup, I think this is accurate. The test as-is doesn't actually verify anything. The icon is not being loaded in WK2, but the test is not actually verifying that! Will file a followup bug for WK2
Brady Eidson
Comment 31
2017-07-02 23:41:26 PDT
Comment hidden (obsolete)
(In reply to Brady Eidson from
comment #30
)
> (In reply to Brady Eidson from
comment #29
) > > (In reply to Brady Eidson from
comment #26
) > > > (In reply to Brady Eidson from
comment #25
) > > > > > > The latter was a legit bug in the test - We actually *should* see the > > > "resource load blocked" console message. > > > > Double checking this - It seems logical to me we should see that the load > > was actually blocked by our machinery, but maybe it was supposed to be > > blocked even sooner...? > > Yup, I think this is accurate. The test as-is doesn't actually verify > anything. > > The icon is not being loaded in WK2, but the test is not actually verifying > that! > > Will file a followup bug for WK2
NM - Feel a lot better about the fact that it doesn't run in WK2 anyways.
Brady Eidson
Comment 32
2017-07-02 23:46:07 PDT
Comment hidden (obsolete)
Created
attachment 314457
[details]
Patch
Build Bot
Comment 33
2017-07-03 03:25:45 PDT
Comment hidden (obsolete)
Comment on
attachment 314457
[details]
Patch
Attachment 314457
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/4042781
New failing tests: workers/bomb.html
Build Bot
Comment 34
2017-07-03 03:25:46 PDT
Comment hidden (obsolete)
Created
attachment 314469
[details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Brady Eidson
Comment 35
2017-07-03 07:22:21 PDT
Comment hidden (obsolete)
iOS build error in WebFrameLoaderClient.mm... but that error is not included in the scroll back. Nice. Thanks.
Brady Eidson
Comment 36
2017-07-03 07:26:43 PDT
Created
attachment 314481
[details]
Patch
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
Created
attachment 314500
[details]
Patch
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.
Top of Page
Format For Printing
XML
Clone This Bug