[webkit-reviews] review granted: [Bug 195965] Add SPI to inform applications of WKContentRuleList actions : [Attachment 365373] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 20 16:52:11 PDT 2019


Geoffrey Garen <ggaren at apple.com> has granted Alex Christensen
<achristensen at apple.com>'s request for review:
Bug 195965: Add SPI to inform applications of WKContentRuleList actions
https://bugs.webkit.org/show_bug.cgi?id=195965

Attachment 365373: patch

https://bugs.webkit.org/attachment.cgi?id=365373&action=review




--- Comment #14 from Geoffrey Garen <ggaren at apple.com> ---
Comment on attachment 365373
  --> https://bugs.webkit.org/attachment.cgi?id=365373
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=365373&action=review

r=me

> Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:96
> +- (void)_webView:(WKWebView *)webView
contentRuleListWithIdentifier:(NSString *)identifier
performedActionOnURL:(NSURL *)url blockedLoad:(BOOL)blockedLoad
blockedCookies:(BOOL)blockedCookies madeHTTPS:(BOOL)madeHTTPS
notifications:(NSArray<NSString *> *)notifications
WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));

I'd recommend ....performedAction:(_WKContentRuleListAction *)action
forURL:....

Then we can put the BOOLs in the object, and add if needed in future, and it's
slightly nicer to write client code.

_WKContentRuleListAction can just wrap WebCore's struct.

> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:657
> +	       auto notifications = adoptNS([[NSMutableArray alloc]
initWithCapacity:result.notifications.size()]);

You can skip this allocation if there are no notifications.


More information about the webkit-reviews mailing list