[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 02:07:12 PDT 2021


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

--- Comment #15 from liushuyu011 at gmail.com ---
(In reply to Carlos Garcia Campos from comment #13)
> Comment on attachment 441990 [details]
> 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 existing 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: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.
> 

Sorry, I have a question here:

I can think of two approaches to read the input stream from the `WebKitURISchemeResponse` in the `WebKitURISchemeRequest` context:

1. Add a non-public function to get the `GInputStream` in the `WebKitURISchemeResponse`, then assign it to the `stream` field in `WebKitURISchemeRequest`;
2. Change `webkit_uri_scheme_request_finish_with_response` to accept a `GInputStream` parameter so `WebKitURISchemeResponse` only contains "metadata"

I am not sure which one is better in your opinion?

Thanks

-- 
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/6dfbf6b1/attachment-0001.htm>


More information about the webkit-unassigned mailing list