After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 741175 - Bindings for WebKit2GTK+ WebExtension API are missing unowned on get_http_headers
Bindings for WebKit2GTK+ WebExtension API are missing unowned on get_http_hea...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GTK+ GStreamer WebKitGTK+
0.26.x
Other Linux
: Normal critical
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-05 18:56 UTC by Christian Dywan
Modified: 2016-09-20 10:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
webkit2gtk: URI*.get_http_headers returns unowned Soup.MessageHeaders (2.26 KB, patch)
2016-09-19 16:33 UTC, Rico Tzschichholz
committed Details | Review

Description Christian Dywan 2014-12-05 18:56:53 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; }
Comment 1 Luca Bruno 2014-12-06 14:57:18 UTC
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.
Comment 2 Luca Bruno 2014-12-06 15:13:30 UTC
So I've installed the gir from debian unstable and the return value of get_http_headers() has full ownership.
Comment 3 Rico Tzschichholz 2016-09-19 14:53:28 UTC
/**
 * 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...
Comment 4 Rico Tzschichholz 2016-09-19 16:33:38 UTC
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.
Comment 5 Rico Tzschichholz 2016-09-20 10:13:18 UTC
Attachment 335870 [details] pushed as 63fa61b - webkit2gtk: URI*.get_http_headers returns unowned Soup.MessageHeaders