RESOLVED FIXED Bug 165517
Add SPI for sending WebsiteSettings to WebProcess during navigation
https://bugs.webkit.org/show_bug.cgi?id=165517
Summary Add SPI for sending WebsiteSettings to WebProcess during navigation
Alex Christensen
Reported 2016-12-06 23:01:27 PST
Add SPI for sending WebsiteSettings to WebProcess during navigation
Attachments
Patch (103.67 KB, patch)
2016-12-07 00:43 PST, Alex Christensen
no flags
Patch (104.49 KB, patch)
2016-12-07 01:11 PST, Alex Christensen
no flags
Patch (103.67 KB, patch)
2016-12-07 10:19 PST, Alex Christensen
no flags
Patch (86.38 KB, patch)
2016-12-07 17:24 PST, Alex Christensen
no flags
Patch (86.37 KB, patch)
2016-12-07 20:14 PST, Alex Christensen
andersca: review+
Alex Christensen
Comment 1 2016-12-07 00:43:18 PST
Alex Christensen
Comment 2 2016-12-07 01:11:45 PST
Alex Christensen
Comment 3 2016-12-07 10:19:51 PST
Anders Carlsson
Comment 4 2016-12-07 14:02:58 PST
Comment on attachment 296396 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=296396&action=review > Source/WebCore/loader/DocumentLoader.h:235 > + std::optional<bool> userContentExtensionsDisabled() const { return m_userContentExtensionsDisabled; } > + void setUserContentExtensionsDisabled(std::optional<bool> disabled) { m_userContentExtensionsDisabled = disabled; } Using std::optional<bool> is pretty confusing, it seems like you should be able to just have it be a boolean (and using enabled by default seems easier to understand too). > Source/WebKit2/UIProcess/API/Cocoa/_WKWebsitePolicies.h:33 > +@property (nonatomic) BOOL contentBlockersDisabled; Again, I think this should be contentBlockersEnabled.
Alex Christensen
Comment 5 2016-12-07 17:24:55 PST
Alex Christensen
Comment 6 2016-12-07 20:14:42 PST
Anders Carlsson
Comment 7 2016-12-08 12:28:30 PST
Comment on attachment 296470 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=296470&action=review > Source/WebKit2/UIProcess/API/APIWebsitePolicies.h:37 > + explicit WebsitePolicies() = default; > + virtual ~WebsitePolicies() = default; I'd put these out of line so we won't end up emitting a vtable wherever we use RefPtr<WebsitePolicies>. > Source/WebKit2/UIProcess/API/APIWebsitePolicies.h:45 > + Extra newline here. > Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:68 > +- (void)_webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy, _WKWebsitePolicies *))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); It's a little ugly that we now have an extra parameter here that only makes sense for calling it with WKNavigationActionPolicyAllow. I think if we want to make this API, we should use an object instead, similar to WebPolicyListener (or whatever it's called).. > Source/WebKit2/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:44 > + @package @package shouldn't be indented. > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:819 > + // Only setUserContentExtensionsEnabled if it hasn't already been disabled by reloading without content blockers. > + if (documentLoader->userContentExtensionsEnabled()) > + documentLoader->setUserContentExtensionsEnabled(websitePolicies.contentBlockersEnabled); Does that mean that it's impossible to implement "reload _with_ content blockers"?
Alex Christensen
Comment 8 2016-12-08 12:42:15 PST
Comment on attachment 296470 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=296470&action=review >> Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:819 >> + documentLoader->setUserContentExtensionsEnabled(websitePolicies.contentBlockersEnabled); > > Does that mean that it's impossible to implement "reload _with_ content blockers"? yes. we would definitely need optional bools for that.
Alex Christensen
Comment 9 2016-12-08 12:45:34 PST
Comment on attachment 296470 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=296470&action=review >> Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:68 >> +- (void)_webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy, _WKWebsitePolicies *))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > > It's a little ugly that we now have an extra parameter here that only makes sense for calling it with WKNavigationActionPolicyAllow. > > I think if we want to make this API, we should use an object instead, similar to WebPolicyListener (or whatever it's called).. Ok, I'll land this as-is. If we make it API, we would need to rename it anyways. The _ is the only difference between this and an existing selector's name.
Alex Christensen
Comment 10 2016-12-08 12:53:16 PST
Note You need to log in before you can comment on or make changes to this bug.