[Webkit-unassigned] [Bug 231880] [GTK][WPE] Support setting status code and getting HTTP method in custom URI scheme handlers
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Oct 21 01:16:00 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=231880
Carlos Garcia Campos <cgarcia at igalia.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #441990|review? |review-
Flags| |
--- Comment #13 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 441990
--> https://bugs.webkit.org/attachment.cgi?id=441990
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=441990&action=review
Thanks, this goes in the right direction, but we don't really want to duplicate the code to read the stream.
> Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp:262
> + webkitURISchemeResponseSetTask(response, request->priv->task);
> + webkitURISchemeResponseReadStart(response);
We don't want to move/duplicate the code to read the response, just use the new WebKitURISchemeResponse to store the response parameters and get them from here to reuse the exiting code. Current webkit_uri_scheme_request_finish should be rewritten to build a response and call this method.
> Source/WebKit/UIProcess/API/glib/WebKitURISchemeResponse.cpp:70
> +WEBKIT_DEFINE_TYPE(WebKitURISchemeResponse, webkit_uri_scheme_response, G_TYPE_OBJECT);
We don't need the ; here
> Source/WebKit/UIProcess/API/glib/WebKitURISchemeResponse.cpp:76
> +WebKitURISchemeResponse* webkit_uri_scheme_response_new()
This could receive the stream and length at least, since the stream is mandatory.
> Source/WebKit/UIProcess/API/glib/WebKitURISchemeResponse.cpp:133
> +void webkitURISchemeResponseSetTask(WebKitURISchemeResponse* schemeResponse, RefPtr<WebURLSchemeTask> task)
> +{
> + g_return_if_fail(WEBKIT_IS_URI_SCHEME_RESPONSE(schemeResponse));
> + schemeResponse->priv->task = task;
> +}
We don't need the task here.
> Source/WebKit/UIProcess/API/glib/WebKitURISchemeResponse.cpp:144
> +void webkit_uri_scheme_response_set_status_code(WebKitURISchemeResponse* response, gint statusCode)
We could add a single method set_status() like liboup3 does, that receives an optional reason_phrase (or status text) parameter.
> Source/WebKit/UIProcess/API/glib/WebKitURISchemeResponse.cpp:168
> + * webkit_uri_scheme_response_set_status_body:
I think the body should be a constructor parameter and I would add a new setter for the content type
> Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:1295
> +WebKitURISchemeResponse
This doesn't belong here
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211021/4cbe726f/attachment.htm>
More information about the webkit-unassigned
mailing list