Bug 110190 - [GTK] Move the API to get TLS certificate from WebKitURIResponse to WebKitWebView
Summary: [GTK] Move the API to get TLS certificate from WebKitURIResponse to WebKitWeb...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks: 109287
  Show dependency treegraph
 
Reported: 2013-02-19 01:15 PST by Carlos Garcia Campos
Modified: 2013-02-19 08:52 PST (History)
9 users (show)

See Also:


Attachments
Patch (11.13 KB, patch)
2013-02-19 01:19 PST, Carlos Garcia Campos
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2013-02-19 01:15:42 PST
Current API is problematic, and having the method directly in the web view makes the API more convenient to use.
Comment 1 Carlos Garcia Campos 2013-02-19 01:19:31 PST
Created attachment 189019 [details]
Patch
Comment 2 WebKit Review Bot 2013-02-19 01:22:03 PST
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 Gustavo Noronha (kov) 2013-02-19 04:48:22 PST
Comment on attachment 189019 [details]
Patch

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

> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2907
> + *    from the server, or %FALSE otherwise.

I believe you can drop this 'or', it's made redundant by 'otherwise'.
Comment 4 Carlos Garcia Campos 2013-02-19 05:12:54 PST
(In reply to comment #3)
> (From update of attachment 189019 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=189019&action=review

Thanks for the review, but remember this has to be r+'ed by an owner.
 
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2907
> > + *    from the server, or %FALSE otherwise.
> 
> I believe you can drop this 'or', it's made redundant by 'otherwise'.

I think martin insisted in adding that 'or', but I'm not sure, I'm not English expert :-P
Comment 5 Gustavo Noronha (kov) 2013-02-19 08:20:52 PST
Comment on attachment 189019 [details]
Patch

I just remembered/realized this needs to be looked at by an OWNER, but it looks good to me from a purely GTK+ perspective.
Comment 6 Martin Robinson 2013-02-19 08:23:06 PST
Comment on attachment 189019 [details]
Patch

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

Looks good to me as well. This will need an owner's review.

> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2896
> + * @certificate: (out) (transfer none): return location for a #GTlsCertificate
> + * @errors: (out): return location for a #GTlsCertificateFlags the verification status of @certificate

Is there an equivalent to "allow none" for out parameters or is it just assumed?

>>> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2907
>>> + *    from the server, or %FALSE otherwise.
>> 
>> I believe you can drop this 'or', it's made redundant by 'otherwise'.
> 
> I think martin insisted in adding that 'or', but I'm not sure, I'm not English expert :-P

I think the 'or' is fine.

> Source/WebKit2/UIProcess/API/gtk/tests/TestSSL.cpp:51
>          GTlsCertificate* certificate = 0;
> -        webkit_uri_response_get_https_status(response, &certificate, &m_tlsErrors);
> +        webkit_web_view_get_tls_info(m_webView, &certificate, &m_tlsErrors);
>          m_certificate = certificate;

Why not just use &m_certificate here?
Comment 7 Carlos Garcia Campos 2013-02-19 08:27:17 PST
(In reply to comment #6)
> (From update of attachment 189019 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=189019&action=review
> 
> Looks good to me as well. This will need an owner's review.
> 
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2896
> > + * @certificate: (out) (transfer none): return location for a #GTlsCertificate
> > + * @errors: (out): return location for a #GTlsCertificateFlags the verification status of @certificate
> 
> Is there an equivalent to "allow none" for out parameters or is it just assumed?

It's assumed.

> >>> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2907
> >>> + *    from the server, or %FALSE otherwise.
> >> 
> >> I believe you can drop this 'or', it's made redundant by 'otherwise'.
> > 
> > I think martin insisted in adding that 'or', but I'm not sure, I'm not English expert :-P
> 
> I think the 'or' is fine.
> 
> > Source/WebKit2/UIProcess/API/gtk/tests/TestSSL.cpp:51
> >          GTlsCertificate* certificate = 0;
> > -        webkit_uri_response_get_https_status(response, &certificate, &m_tlsErrors);
> > +        webkit_web_view_get_tls_info(m_webView, &certificate, &m_tlsErrors);
> >          m_certificate = certificate;
> 
> Why not just use &m_certificate here?

Is that possible with a GRefPtr?
Comment 8 Martin Robinson 2013-02-19 08:31:15 PST
Comment on attachment 189019 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/gtk/tests/TestSSL.cpp:51
>>          m_certificate = certificate;
> 
> Why not just use &m_certificate here?

Ah! Nope. Only with GOwnPtr currently.
Comment 9 Carlos Garcia Campos 2013-02-19 08:52:32 PST
Committed r143341: <http://trac.webkit.org/changeset/143341>