GNOME Bugzilla – Bug 741175
Bindings for WebKit2GTK+ WebExtension API are missing unowned on get_http_headers
Last modified: 2016-09-20 10:13:23 UTC
There's a bug in the WebExtension binding making it impossible to access HTTP headers without causing a crash because they're freed incorrectly. > diff -u {/usr/share/vala-0.26/vapi,midori}/webkit2gtk-web-extension-4.0.vapi --- /usr/share/vala-0.26/vapi/webkit2gtk-web-extension-4.0.vapi 2014-12-05 19:52:09.965510761 +0100 +++ midori/webkit2gtk-web-extension-4.0.vapi 2014-12-05 19:45:34.299030920 +0100 @@ -2619,7 +2619,7 @@ public class URIRequest : GLib.Object { [CCode (has_construct_function = false)] public URIRequest (string uri); - public Soup.MessageHeaders get_http_headers (); + public unowned Soup.MessageHeaders get_http_headers (); public unowned string get_uri (); public void set_uri (string uri); public string uri { get; set construct; }
webkit2gtk-web-extension-4.0.vapi is autogenerated from WebKit2WebExtension-4.0.gir , and the return value is full ownership transfer. Will check if updating the gir fixes this.
So I've installed the gir from debian unstable and the return value of get_http_headers() has full ownership.
/** * webkit_uri_request_get_http_headers: * @request: a #WebKitURIRequest * * Get the HTTP headers of a #WebKitURIRequest as a #SoupMessageHeaders. * * Returns: (transfer none): a #SoupMessageHeaders with the HTTP headers of @request * or %NULL if @request is not an HTTP request. */ So something is going wrong here...
Created attachment 335870 [details] [review] webkit2gtk: URI*.get_http_headers returns unowned Soup.MessageHeaders Those are actually annotated "transfer none" in the webkit's source.
Attachment 335870 [details] pushed as 63fa61b - webkit2gtk: URI*.get_http_headers returns unowned Soup.MessageHeaders