[webkit-reviews] review denied: [Bug 219995] [GTK][WPE] Expose setCORSDisablingPatterns : [Attachment 416474] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 18 01:46:59 PST 2020


Carlos Garcia Campos <cgarcia at igalia.com> has denied Jan-Michael Brummer
<jan.brummer at tabos.org>'s request for review:
Bug 219995: [GTK][WPE] Expose setCORSDisablingPatterns
https://bugs.webkit.org/show_bug.cgi?id=219995

Attachment 416474: Patch

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




--- Comment #7 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 416474
  --> https://bugs.webkit.org/attachment.cgi?id=416474
Patch

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

r- because we need an API test. Thanks Jan-Michael!

> Source/WebKit/ChangeLog:8
> +	   No new tests (OOPS!).

Remove this line.

> Source/WebKit/ChangeLog:13
> +	   * UIProcess/API/gtk/WebKitWebView.h:
> +	   * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
> +	   (webkit_web_view_set_cors_disabling_patterns):
> +	   * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:

You should regenerate the changelog, since there are more files modified.

> Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:4717
> + * webkit_web_view_set_cors_disabling_patterns:

what about webkit_web_view_set_cors_allow_list()?

> Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:4719
> + * @patterns: a NULL-terminated list of patterns.

(array zero-terminated=1) (element-type utf8) (transfer none) (nullable): a
%NULL-terminated list of patterns

> Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:4721
> + * Sets @pattern for which CORS checks are disabled in @web_view.

I think we need more documentation here. It's not clear to me what a valid
pattern is (check UserContentURLPattern::parse()).

> Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:4729
> +    if (!patterns || !g_strv_length(const_cast<char**>(patterns)))

I don't think we should return early in this case. Setting an empty list is the
only way to reset the patterns. That's what updateCORSDisablingPatterns() does.
I think we should mark patterns as nullable and document that if it's NULL or
empty the patterns will be reset. I think this is consistent with
webkit_user_script_new().


More information about the webkit-reviews mailing list