[Webkit-unassigned] [Bug 159410] When WKWebView prepares the session state blob, we should be able to filter it.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 6 14:03:54 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=159410

--- Comment #10 from Brady Eidson <beidson at apple.com> ---
Comment on attachment 282914
  --> https://bugs.webkit.org/attachment.cgi?id=282914
Add a SPI to WKWebView so that we can filter the session state.

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:3378
> +    auto handler = adoptNS([filter copy]);
> +    WebKit::SessionState sessionState = _page->sessionState([handler](WebKit::WebBackForwardListItem& item) {

Can put the filter copy inside the lambda:
[handler = adoptNS([filter copy])]

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:3384
> +        BOOL (^filterBlock)(WKBackForwardListItem *item) = (BOOL (^)(WKBackForwardListItem *item))handler.get();
> +        if (filterBlock) {
> +            if (!filterBlock(wrapper(item)))
> +                return false;
> +        }
> +        return true;

This should be able to be simpler:

if (!handler)
   return true;

BOOL (^filterBlock)(WKBackForwardListItem *item) = (BOOL (^)(WKBackForwardListItem *item))handler.get();
return filterBlock(wrapper(item));

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160706/efbc5112/attachment.html>


More information about the webkit-unassigned mailing list