RESOLVED FIXED 209755
Known app-bound domain protocols should not check the app-bound domain list
https://bugs.webkit.org/show_bug.cgi?id=209755
Summary Known app-bound domain protocols should not check the app-bound domain list
Kate Cheney
Reported 2020-03-30 11:04:58 PDT
It is wasteful to check the app-bound domain list and wait for a response when some protocols are automatically considered app-bound.
Attachments
Patch (5.13 KB, patch)
2020-03-30 11:08 PDT, Kate Cheney
no flags
Patch (5.25 KB, patch)
2020-03-30 11:13 PDT, Kate Cheney
no flags
Patch (5.24 KB, patch)
2020-03-30 13:24 PDT, Kate Cheney
no flags
Patch (6.87 KB, patch)
2020-03-30 14:30 PDT, Kate Cheney
no flags
Kate Cheney
Comment 1 2020-03-30 11:05:32 PDT
Kate Cheney
Comment 2 2020-03-30 11:08:44 PDT
Kate Cheney
Comment 3 2020-03-30 11:13:17 PDT
Chris Dumez
Comment 4 2020-03-30 13:08:37 PDT
Comment on attachment 394937 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394937&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:5115 > +#if PLATFORM(COCOA) && PLATFORM(IOS_FAMILY) PLATFORM(COCOA) && seems redundant > Source/WebKit/UIProcess/WebPageProxy.cpp:5116 > + if (!shouldBeTreatedAsAppBound(request.url())) Not sure I understand why the ! here.
Kate Cheney
Comment 5 2020-03-30 13:19:45 PDT
Comment on attachment 394937 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394937&action=review >> Source/WebKit/UIProcess/WebPageProxy.cpp:5115 >> +#if PLATFORM(COCOA) && PLATFORM(IOS_FAMILY) > > PLATFORM(COCOA) && seems redundant Removing. >> Source/WebKit/UIProcess/WebPageProxy.cpp:5116 >> + if (!shouldBeTreatedAsAppBound(request.url())) > > Not sure I understand why the ! here. If shouldExpectAppBoundDomainResult is Yes, we make the call to check the app-bound domain list (see below). We only want to check the app-bound domain list if the request url is not one of these special, automatic app-bound domain protocols. Keeping it as ShouldExpectAppBoundDomainResult::No for the app-bound domain protocols makes sure we don't dispatch and wait for the list to be checked. ShouldExpectAppBoundDomainResult::No now automatically returns NavigatingToAppBoundDomain::Yes in the WebFramePolicyListener constructor.
Kate Cheney
Comment 6 2020-03-30 13:20:32 PDT
(In reply to katherine_cheney from comment #5) > Comment on attachment 394937 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=394937&action=review > > >> Source/WebKit/UIProcess/WebPageProxy.cpp:5115 > >> +#if PLATFORM(COCOA) && PLATFORM(IOS_FAMILY) > > > > PLATFORM(COCOA) && seems redundant > > Removing. > > >> Source/WebKit/UIProcess/WebPageProxy.cpp:5116 > >> + if (!shouldBeTreatedAsAppBound(request.url())) > > > > Not sure I understand why the ! here. > > If shouldExpectAppBoundDomainResult is Yes, we make the call to check the > app-bound domain list (see below). We only want to check the app-bound > domain list if the request url is not one of these special, automatic > app-bound domain protocols. > By "see below," I meant this line in the patch: + if (shouldExpectAppBoundDomainResult == ShouldExpectAppBoundDomainResult::Yes) + m_websiteDataStore->beginAppBoundDomainCheck(RegistrableDomain { request.url() }, listener); > Keeping it as ShouldExpectAppBoundDomainResult::No for the app-bound domain > protocols makes sure we don't dispatch and wait for the list to be checked. > ShouldExpectAppBoundDomainResult::No now automatically returns > NavigatingToAppBoundDomain::Yes in the WebFramePolicyListener constructor.
Kate Cheney
Comment 7 2020-03-30 13:24:01 PDT
Chris Dumez
Comment 8 2020-03-30 13:25:11 PDT
While I believe you that the patch does the right thing, it seems to do the right thing in a confusing way and it would be nice to refactor the code so that it is clearer. Right now, at best it would need a comment. But if code requires a comment, then it likely means the code is not clear enough to be self documenting.
Chris Dumez
Comment 9 2020-03-30 13:27:19 PDT
Comment on attachment 394952 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394952&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:-5177 > - m_websiteDataStore->beginAppBoundDomainCheck(RegistrableDomain { request.url() }, listener); Can beginAppBoundDomainCheck() take a URL and do an early return if the protocol is definitely app bound? Seems like it might be clearer than all this special casing at the call site. We'd always do an app bound check but the check would be super cheap in some cases.
Chris Dumez
Comment 10 2020-03-30 13:31:40 PDT
Comment on attachment 394952 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394952&action=review >> Source/WebKit/UIProcess/WebPageProxy.cpp:-5177 >> - m_websiteDataStore->beginAppBoundDomainCheck(RegistrableDomain { request.url() }, listener); > > Can beginAppBoundDomainCheck() take a URL and do an early return if the protocol is definitely app bound? Seems like it might be clearer than all this special casing at the call site. We'd always do an app bound check but the check would be super cheap in some cases. Also, please rename shouldBeTreatedAsAppBound() to something like shouldTreatURLProtocolAsAppBound()
Kate Cheney
Comment 11 2020-03-30 14:30:58 PDT
Chris Dumez
Comment 12 2020-03-30 15:56:06 PDT
Comment on attachment 394961 [details] Patch me likee
Kate Cheney
Comment 13 2020-03-30 16:02:37 PDT
(In reply to Chris Dumez from comment #12) > Comment on attachment 394961 [details] > Patch > > me likee :) thanks!
EWS
Comment 14 2020-03-30 16:06:07 PDT
Committed r259240: <https://trac.webkit.org/changeset/259240> All reviewed patches have been landed. Closing bug and clearing flags on attachment 394961 [details].
Note You need to log in before you can comment on or make changes to this bug.