Bug 92967 - [GTK][WK2] Add API for suggested filename from a URI Response.
Summary: [GTK][WK2] Add API for suggested filename from a URI Response.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-02 02:51 PDT by Claudio Saavedra
Modified: 2012-08-17 09:47 PDT (History)
6 users (show)

See Also:


Attachments
[GTK] Add WK2 API to get suggested filename for URI responses https://bugs.webkit.org/show_bug.cgi?id=92967 (7.87 KB, patch)
2012-08-02 03:02 PDT, Claudio Saavedra
cgarcia: review-
Details | Formatted Diff | Diff
[GTK] Add WK2 API to get suggested filename for URI responses https://bugs.webkit.org/show_bug.cgi?id=92967 (10.79 KB, patch)
2012-08-17 02:54 PDT, Claudio Saavedra
cgarcia: review+
cgarcia: commit-queue-
Details | Formatted Diff | Diff
[GTK] Add WK2 API to get suggested filename for URI responses https://bugs.webkit.org/show_bug.cgi?id=92967 (10.80 KB, patch)
2012-08-17 06:35 PDT, Claudio Saavedra
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Saavedra 2012-08-02 02:51:35 PDT
Similar to the WK1 case, we need to wrap the core ResourceResponse::suggestedFilename() getter.
Comment 1 Claudio Saavedra 2012-08-02 03:02:55 PDT
Created attachment 156024 [details]
        [GTK] Add WK2 API to get suggested filename for URI responses         https://bugs.webkit.org/show_bug.cgi?id=92967

Reviewed by NOBODY (OOPS!).

        Webcore has API the suggested filename for a response, add a
        property and getter for it in WebKitURIResponse.

        * UIProcess/API/gtk/WebKitURIResponse.cpp:
        (_WebKitURIResponsePrivate): Add a CString holding the value.
        (webkitURIResponseGetProperty): Add the gobject bits for the
        property.
        (webkit_uri_response_class_init): Install the property.
        (webkit_uri_response_get_suggested_filename): New getter.
        * UIProcess/API/gtk/WebKitURIResponse.h: Declare the public
        method.
        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add the new API
        symbols.
Comment 2 WebKit Review Bot 2012-08-02 03:06:49 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 Martin Robinson 2012-08-02 03:13:12 PDT
Comment on attachment 156024 [details]
        [GTK] Add WK2 API to get suggested filename for URI responses         https://bugs.webkit.org/show_bug.cgi?id=92967

Looks good to me!
Comment 4 Carlos Garcia Campos 2012-08-02 03:20:26 PDT
Comment on attachment 156024 [details]
        [GTK] Add WK2 API to get suggested filename for URI responses         https://bugs.webkit.org/show_bug.cgi?id=92967

View in context: https://bugs.webkit.org/attachment.cgi?id=156024&action=review

You should include a unit tests to check the new api added.

> Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp:255
> + * Returns: the suggested filename for @response, as specified by

Don't use Returns: tag twice

> Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp:259
> + * Returns: (transfer none): the suggested filename or %NULL if none

if none -> if not present

> Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp:260
> + * Since: 2.0

Don't add Since tags for wk2 gtk api, since we haven't released a first stable version yet.

> Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h:75
> +webkit_uri_response_get_suggested_filename (WebKitURIResponse *response);

parameter name should also be aligned with other methods
Comment 5 Claudio Saavedra 2012-08-02 03:33:18 PDT
(In reply to comment #4)

> > Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp:260
> > + * Since: 2.0
> 
> Don't add Since tags for wk2 gtk api, since we haven't released a first stable version yet.

Are you planning to add them all at once before releasing? If you know the actual version that will be used when the new API is released (I presume 2.0), I think you should add them already. Otherwise you're in for a tedious and repetitive task.
Comment 6 Carlos Garcia Campos 2012-08-02 03:36:28 PDT
(In reply to comment #5)
> (In reply to comment #4)
> 
> > > Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp:260
> > > + * Since: 2.0
> > 
> > Don't add Since tags for wk2 gtk api, since we haven't released a first stable version yet.
> 
> Are you planning to add them all at once before releasing? If you know the actual version that will be used when the new API is released (I presume 2.0), I think you should add them already. Otherwise you're in for a tedious and repetitive task.

No, it will be added for new api added after 2.0, all other methods are supposed to be 2.0.
Comment 7 Claudio Saavedra 2012-08-17 02:54:56 PDT
Created attachment 159063 [details]
        [GTK] Add WK2 API to get suggested filename for URI responses         https://bugs.webkit.org/show_bug.cgi?id=92967

Reviewed by NOBODY (OOPS!).

        Webcore has API the suggested filename for a response, add a
        property and getter for it in WebKitURIResponse.

        * UIProcess/API/gtk/WebKitURIResponse.cpp:
        (_WebKitURIResponsePrivate): Add a CString holding the value.
        (webkitURIResponseGetProperty): Add the gobject bits for the
        property.
        (webkit_uri_response_class_init): Install the property.
        (webkit_uri_response_get_suggested_filename): New getter.
        * UIProcess/API/gtk/WebKitURIResponse.h: Declare the public
        method.
        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add the new API
        symbols.
Comment 8 Carlos Garcia Campos 2012-08-17 03:16:14 PDT
Comment on attachment 159063 [details]
        [GTK] Add WK2 API to get suggested filename for URI responses         https://bugs.webkit.org/show_bug.cgi?id=92967

View in context: https://bugs.webkit.org/attachment.cgi?id=159063&action=review

> Source/WebKit2/ChangeLog:9
> +        Webcore has API the suggested filename for a response, add a
> +        property and getter for it in WebKitURIResponse.

I gues you mean Webcore has API *to get* the suggested filename

> Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp:260
> + * Returns: (transfer none): the suggested filename or %NULL if
> + *    the 'Content-Disposition' HTTP header is ot present.

ot -> not
Comment 9 Claudio Saavedra 2012-08-17 06:35:10 PDT
Created attachment 159108 [details]
        [GTK] Add WK2 API to get suggested filename for URI responses         https://bugs.webkit.org/show_bug.cgi?id=92967

Reviewed by NOBODY (OOPS!).

        Webcore has API the suggested filename for a response, add a
        property and getter for it in WebKitURIResponse.

        * UIProcess/API/gtk/WebKitURIResponse.cpp:
        (_WebKitURIResponsePrivate): Add a CString holding the value.
        (webkitURIResponseGetProperty): Add the gobject bits for the
        property.
        (webkit_uri_response_class_init): Install the property.
        (webkit_uri_response_get_suggested_filename): New getter.
        * UIProcess/API/gtk/WebKitURIResponse.h: Declare the public
        method.
        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add the new API
        symbols.
Comment 10 WebKit Review Bot 2012-08-17 09:47:04 PDT
Comment on attachment 159108 [details]
        [GTK] Add WK2 API to get suggested filename for URI responses         https://bugs.webkit.org/show_bug.cgi?id=92967

Clearing flags on attachment: 159108

Committed r125910: <http://trac.webkit.org/changeset/125910>
Comment 11 WebKit Review Bot 2012-08-17 09:47:10 PDT
All reviewed patches have been landed.  Closing bug.