Bug 134476

Summary: [GTK] Annotations for WebResource.get_data produce wrong signature in Vala binding
Product: WebKit Reporter: nilclass
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bunhere, cdumez, cgarcia, commit-queue, gustavo, gyuyoung.kim, mrobinson, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[GTK] fix WebKit.WebResource.get_data_finish return value annotations
cgarcia: review+, cgarcia: commit-queue-
Patch for landing none

Description nilclass 2014-06-30 17:51:16 PDT
The get_data method of WebKit.WebResource is currently unusable from Vala code, because the method signature in the .vapi file is incorrect.

Currently the generated Vala signature is:

  public async uint8 get_data (GLib.Cancellable? cancellable, out size_t length) throws GLib.Error;

the expected signature is:

  [CCode (array_length_type = "size_t")]
  public async uint8[] get_data (GLib.Cancellable? cancellable) throws GLib.Error;

I have checked that applying this change to the webkit2gtk-3.0.vapi file manually & linking against webkit2gtk version 2.4.2 works, but I don't have the capacity right now to compile webkit to find out what changes to the annotations are required to reach this result.
If someone could point me to the right documentation, I'd be willing to submit a patch.
Comment 1 Evan Nemerson 2014-06-30 18:06:00 PDT
Created attachment 234132 [details]
[GTK] fix WebKit.WebResource.get_data_finish return value annotations
Comment 2 WebKit Commit Bot 2014-06-30 21:21:32 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Carlos Garcia Campos 2014-07-01 00:14:02 PDT
Comment on attachment 234132 [details]
[GTK] fix WebKit.WebResource.get_data_finish return value annotations

Thanks for the patch. It looks good to me, but you need to fill a changelog entry, see http://www.webkit.org/coding/contributing.html
Comment 4 Carlos Garcia Campos 2014-07-01 01:32:15 PDT
Created attachment 234151 [details]
Patch for landing

Added changelog entry
Comment 5 WebKit Commit Bot 2014-07-01 02:11:19 PDT
Comment on attachment 234151 [details]
Patch for landing

Clearing flags on attachment: 234151

Committed r170633: <http://trac.webkit.org/changeset/170633>
Comment 6 WebKit Commit Bot 2014-07-01 02:11:24 PDT
All reviewed patches have been landed.  Closing bug.