Title: [171792] trunk
Revision
171792
Author
[email protected]
Date
2014-07-30 00:06:43 -0700 (Wed, 30 Jul 2014)

Log Message

[GTK] Remove WebKitCertificateInfo from WebKit2GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=134830

Reviewed by Gustavo Noronha Silva.

Source/WebKit2:
It was added to make the API more convenient but it has ended up
making it more complicated. WebKitWebView::load-failed-with-tls-errors
now receives a GTlsCertificate + GTlsCertificateFlags and
webkit_web_context_allow_tls_certificate_for_host() receives a GTlsCertificate
since the errors are not actually needed. This makes the API more
consistent with the existing method webkit_web_view_get_tls_info().

* PlatformGTK.cmake: Remove files from compilation.
* UIProcess/API/gtk/WebKitCertificateInfo.cpp: Removed.
* UIProcess/API/gtk/WebKitCertificateInfo.h: Removed.
* UIProcess/API/gtk/WebKitCertificateInfoPrivate.h: Removed.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_allow_tls_certificate_for_host):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkitWebViewLoadFailedWithTLSErrors):
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
* UIProcess/API/gtk/webkit2.h:

Tools:
Update the SSL test for the API changes.

* TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
(testLoadFailedWithTLSErrors):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (171791 => 171792)


--- trunk/Source/WebKit2/ChangeLog	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-30 07:06:43 UTC (rev 171792)
@@ -1,3 +1,32 @@
+2014-07-29  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Remove WebKitCertificateInfo from WebKit2GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=134830
+
+        Reviewed by Gustavo Noronha Silva.
+
+        It was added to make the API more convenient but it has ended up
+        making it more complicated. WebKitWebView::load-failed-with-tls-errors
+        now receives a GTlsCertificate + GTlsCertificateFlags and
+        webkit_web_context_allow_tls_certificate_for_host() receives a GTlsCertificate
+        since the errors are not actually needed. This makes the API more
+        consistent with the existing method webkit_web_view_get_tls_info().
+
+        * PlatformGTK.cmake: Remove files from compilation.
+        * UIProcess/API/gtk/WebKitCertificateInfo.cpp: Removed.
+        * UIProcess/API/gtk/WebKitCertificateInfo.h: Removed.
+        * UIProcess/API/gtk/WebKitCertificateInfoPrivate.h: Removed.
+        * UIProcess/API/gtk/WebKitWebContext.cpp:
+        (webkit_web_context_allow_tls_certificate_for_host):
+        * UIProcess/API/gtk/WebKitWebContext.h:
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (webkit_web_view_class_init):
+        (webkitWebViewLoadFailedWithTLSErrors):
+        * UIProcess/API/gtk/WebKitWebView.h:
+        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
+        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
+        * UIProcess/API/gtk/webkit2.h:
+
 2014-07-29  Jinwoo Song  <[email protected]>
 
         [EFL] Do not initialize g_type system explicitly in the ewk_init()

Modified: trunk/Source/WebKit2/PlatformGTK.cmake (171791 => 171792)


--- trunk/Source/WebKit2/PlatformGTK.cmake	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/PlatformGTK.cmake	2014-07-30 07:06:43 UTC (rev 171792)
@@ -100,9 +100,6 @@
     UIProcess/API/gtk/WebKitBackForwardListItem.cpp
     UIProcess/API/gtk/WebKitBackForwardListItem.h
     UIProcess/API/gtk/WebKitBackForwardListPrivate.h
-    UIProcess/API/gtk/WebKitCertificateInfo.cpp
-    UIProcess/API/gtk/WebKitCertificateInfo.h
-    UIProcess/API/gtk/WebKitCertificateInfoPrivate.h
     UIProcess/API/gtk/WebKitContextMenu.cpp
     UIProcess/API/gtk/WebKitContextMenu.h
     UIProcess/API/gtk/WebKitContextMenuActions.cpp
@@ -324,7 +321,6 @@
     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitAuthenticationRequest.h
     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardList.h
     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardListItem.h
-    ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitCertificateInfo.h
     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitCredential.h
     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenu.h
     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenuActions.h

Deleted: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfo.cpp (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfo.cpp	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfo.cpp	2014-07-30 07:06:43 UTC (rev 171792)
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2013 Samsung Electronics Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "WebKitCertificateInfo.h"
-
-#include "WebKitCertificateInfoPrivate.h"
-#include <wtf/text/CString.h>
-
-using namespace WebKit;
-using namespace WebCore;
-
-/**
- * SECTION: WebKitCertificateInfo
- * @Short_description: Boxed type to encapsulate TLS certificate information
- * @Title: WebKitCertificateInfo
- * @See_also: #WebKitWebView, #WebKitWebContext
- *
- * When a client loads a page over HTTPS where there is an underlying TLS error
- * WebKit will fire a #WebKitWebView::load-failed-with-tls-errors signal with a
- * #WebKitCertificateInfo and the host of the failing URI.
- *
- * To handle this signal asynchronously you should make a copy of the
- * #WebKitCertificateInfo with webkit_certificate_info_copy().
- */
-
-G_DEFINE_BOXED_TYPE(WebKitCertificateInfo, webkit_certificate_info, webkit_certificate_info_copy, webkit_certificate_info_free)
-
-const CertificateInfo& webkitCertificateInfoGetCertificateInfo(WebKitCertificateInfo* info)
-{
-    ASSERT(info);
-    return info->certificateInfo;
-}
-
-/**
- * webkit_certificate_info_copy:
- * @info: a #WebKitCertificateInfo
- *
- * Make a copy of the #WebKitCertificateInfo.
- *
- * Returns: (transfer full): A copy of passed in #WebKitCertificateInfo.
- *
- * Since: 2.4
- */
-WebKitCertificateInfo* webkit_certificate_info_copy(WebKitCertificateInfo* info)
-{
-    g_return_val_if_fail(info, 0);
-
-    WebKitCertificateInfo* copy = g_slice_new0(WebKitCertificateInfo);
-    new (copy) WebKitCertificateInfo(info);
-    return copy;
-}
-
-/**
- * webkit_certificate_info_free:
- * @info: a #WebKitCertificateInfo
- *
- * Free the #WebKitCertificateInfo.
- *
- * Since: 2.4
- */
-void webkit_certificate_info_free(WebKitCertificateInfo* info)
-{
-    g_return_if_fail(info);
-
-    info->~WebKitCertificateInfo();
-    g_slice_free(WebKitCertificateInfo, info);
-}
-
-/**
- * webkit_certificate_info_get_tls_certificate:
- * @info: a #WebKitCertificateInfo
- *
- * Get the #GTlsCertificate associated with this
- * #WebKitCertificateInfo.
- *
- * Returns: (transfer none): The certificate of @info.
- *
- * Since: 2.4
- */
-GTlsCertificate* webkit_certificate_info_get_tls_certificate(WebKitCertificateInfo *info)
-{
-    g_return_val_if_fail(info, 0);
-
-    return info->certificateInfo.certificate();
-}
-
-/**
- * webkit_certificate_info_get_tls_errors:
- * @info: a #WebKitCertificateInfo
- *
- * Get the #GTlsCertificateFlags verification status associated with this
- * #WebKitCertificateInfo.
- *
- * Returns: The verification status of @info.
- *
- * Since: 2.4
- */
-GTlsCertificateFlags webkit_certificate_info_get_tls_errors(WebKitCertificateInfo *info)
-{
-    g_return_val_if_fail(info, static_cast<GTlsCertificateFlags>(0));
-
-    return info->certificateInfo.tlsErrors();
-}

Deleted: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfo.h (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfo.h	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfo.h	2014-07-30 07:06:43 UTC (rev 171792)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2013 Samsung Electronics Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
-#error "Only <webkit2/webkit2.h> can be included directly."
-#endif
-
-#ifndef WebKitCertificateInfo_h
-#define WebKitCertificateInfo_h
-
-#include <gio/gio.h>
-#include <glib-object.h>
-#include <webkit2/WebKitDefines.h>
-
-G_BEGIN_DECLS
-
-#define WEBKIT_TYPE_CERTIFICATE_INFO (webkit_certificate_info_get_type())
-
-typedef struct _WebKitCertificateInfo WebKitCertificateInfo;
-
-WEBKIT_API GType
-webkit_certificate_info_get_type            (void);
-
-WEBKIT_API WebKitCertificateInfo *
-webkit_certificate_info_copy                (WebKitCertificateInfo *info);
-
-WEBKIT_API void
-webkit_certificate_info_free                (WebKitCertificateInfo *info);
-
-WEBKIT_API GTlsCertificate *
-webkit_certificate_info_get_tls_certificate (WebKitCertificateInfo *info);
-
-WEBKIT_API GTlsCertificateFlags
-webkit_certificate_info_get_tls_errors      (WebKitCertificateInfo *info);
-
-G_END_DECLS
-
-#endif

Deleted: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfoPrivate.h (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfoPrivate.h	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfoPrivate.h	2014-07-30 07:06:43 UTC (rev 171792)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2013 Samsung Electronics Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef WebKitCertificateInfoPrivate_h
-#define WebKitCertificateInfoPrivate_h
-
-#include "WebKitCertificateInfo.h"
-#include "WebKitPrivate.h"
-#include <WebCore/CertificateInfo.h>
-
-struct _WebKitCertificateInfo {
-    _WebKitCertificateInfo(GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors)
-        : certificateInfo(certificate, tlsErrors)
-    {
-    }
-
-    _WebKitCertificateInfo(WebKitCertificateInfo* info)
-        : certificateInfo(info->certificateInfo)
-    {
-    }
-
-    WebCore::CertificateInfo certificateInfo;
-};
-
-const WebCore::CertificateInfo& webkitCertificateInfoGetCertificateInfo(WebKitCertificateInfo*);
-
-#endif // WebKitCertificateInfoPrivate_h

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp	2014-07-30 07:06:43 UTC (rev 171792)
@@ -26,7 +26,6 @@
 #include "WebCookieManagerProxy.h"
 #include "WebGeolocationManagerProxy.h"
 #include "WebKitBatteryProvider.h"
-#include "WebKitCertificateInfoPrivate.h"
 #include "WebKitCookieManagerPrivate.h"
 #include "WebKitDownloadClient.h"
 #include "WebKitDownloadPrivate.h"
@@ -900,20 +899,20 @@
 /**
  * webkit_web_context_allow_tls_certificate_for_host:
  * @context: a #WebKitWebContext
- * @info: a #WebKitCertificateInfo
+ * @certificate: a #GTlsCertificate
  * @host: the host for which a certificate is to be allowed
  *
  * Ignore further TLS errors on the @host for the certificate present in @info.
  *
- * Since: 2.4
+ * Since: 2.6
  */
-void webkit_web_context_allow_tls_certificate_for_host(WebKitWebContext* context, WebKitCertificateInfo* info, const gchar* host)
+void webkit_web_context_allow_tls_certificate_for_host(WebKitWebContext* context, GTlsCertificate* certificate, const gchar* host)
 {
     g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
-    g_return_if_fail(info);
+    g_return_if_fail(G_IS_TLS_CERTIFICATE(certificate));
     g_return_if_fail(host);
 
-    RefPtr<WebCertificateInfo> webCertificateInfo = WebCertificateInfo::create(webkitCertificateInfoGetCertificateInfo(info));
+    RefPtr<WebCertificateInfo> webCertificateInfo = WebCertificateInfo::create(WebCore::CertificateInfo(certificate, static_cast<GTlsCertificateFlags>(0)));
     context->priv->context->allowSpecificHTTPSCertificateForHost(webCertificateInfo.get(), String::fromUTF8(host));
 }
 

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h	2014-07-30 07:06:43 UTC (rev 171792)
@@ -25,7 +25,6 @@
 #define WebKitWebContext_h
 
 #include <glib-object.h>
-#include <webkit2/WebKitCertificateInfo.h>
 #include <webkit2/WebKitCookieManager.h>
 #include <webkit2/WebKitDefines.h>
 #include <webkit2/WebKitDownload.h>
@@ -236,7 +235,7 @@
 
 WEBKIT_API void
 webkit_web_context_allow_tls_certificate_for_host   (WebKitWebContext              *context,
-                                                     WebKitCertificateInfo         *info,
+                                                     GTlsCertificate               *certificate,
                                                      const gchar                   *host);
 
 WEBKIT_API void

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp	2014-07-30 07:06:43 UTC (rev 171792)
@@ -29,7 +29,6 @@
 #include "WebKitAuthenticationDialog.h"
 #include "WebKitAuthenticationRequestPrivate.h"
 #include "WebKitBackForwardListPrivate.h"
-#include "WebKitCertificateInfoPrivate.h"
 #include "WebKitContextMenuClient.h"
 #include "WebKitContextMenuItemPrivate.h"
 #include "WebKitContextMenuPrivate.h"
@@ -871,16 +870,16 @@
     /**
      * WebKitWebView::load-failed-with-tls-errors:
      * @web_view: the #WebKitWebView on which the signal is emitted
-     * @info: a #WebKitCertificateInfo
+     * @certificate: a #GTlsCertificate
+     * @errors: a #GTlsCertificateFlags with the verification status of @certificate
      * @host: the host on which the error occurred
      *
-     * Emitted when a TLS error occurs during a load operation. The @info
-     * object contains information about the error such as the #GTlsCertificate
-     * and the #GTlsCertificateFlags. To allow an exception for this certificate
+     * Emitted when a TLS error occurs during a load operation.
+     * To allow an exception for this certificate
      * and this host use webkit_web_context_allow_tls_certificate_for_host().
      *
-     * To handle this signal asynchronously you should copy the #WebKitCertificateInfo
-     * with webkit_certificate_info_copy() and return %TRUE.
+     * To handle this signal asynchronously you should call g_object_ref() on @certificate
+     * and return %TRUE.
      *
      * If %FALSE is returned, #WebKitWebView::load-failed will be emitted. The load
      * will finish regardless of the returned value.
@@ -888,7 +887,7 @@
      * Returns: %TRUE to stop other handlers from being invoked for the event.
      *   %FALSE to propagate the event further.
      *
-     * Since: 2.4
+     * Since: 2.6
      */
     signals[LOAD_FAILED_WITH_TLS_ERRORS] =
         g_signal_new("load-failed-with-tls-errors",
@@ -896,9 +895,10 @@
             G_SIGNAL_RUN_LAST,
             G_STRUCT_OFFSET(WebKitWebViewClass, load_failed_with_tls_errors),
             g_signal_accumulator_true_handled, 0 /* accumulator data */,
-            webkit_marshal_BOOLEAN__BOXED_STRING,
-            G_TYPE_BOOLEAN, 2, /* number of parameters */
-            WEBKIT_TYPE_CERTIFICATE_INFO  | G_SIGNAL_TYPE_STATIC_SCOPE,
+            g_cclosure_marshal_generic,
+            G_TYPE_BOOLEAN, 3,
+            G_TYPE_TLS_CERTIFICATE,
+            G_TYPE_TLS_CERTIFICATE_FLAGS,
             G_TYPE_STRING);
 
     /**
@@ -1582,9 +1582,8 @@
     WebKitTLSErrorsPolicy tlsErrorsPolicy = webkit_web_context_get_tls_errors_policy(webView->priv->context);
     if (tlsErrorsPolicy == WEBKIT_TLS_ERRORS_POLICY_FAIL) {
         GUniquePtr<SoupURI> soupURI(soup_uri_new(failingURI));
-        WebKitCertificateInfo info(certificate, tlsErrors);
         gboolean returnValue;
-        g_signal_emit(webView, signals[LOAD_FAILED_WITH_TLS_ERRORS], 0, &info, soupURI->host, &returnValue);
+        g_signal_emit(webView, signals[LOAD_FAILED_WITH_TLS_ERRORS], 0, certificate, tlsErrors, soupURI->host, &returnValue);
         if (!returnValue)
             g_signal_emit(webView, signals[LOAD_FAILED], 0, WEBKIT_LOAD_STARTED, failingURI, error, &returnValue);
     }

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h	2014-07-30 07:06:43 UTC (rev 171792)
@@ -235,7 +235,8 @@
     gboolean   (* authenticate)                (WebKitWebView               *web_view,
                                                 WebKitAuthenticationRequest *request);
     gboolean   (* load_failed_with_tls_errors) (WebKitWebView               *web_view,
-                                                WebKitCertificateInfo       *info,
+                                                GTlsCertificate             *certificate,
+                                                GTlsCertificateFlags         errors,
                                                 const gchar                 *host);
     void (*_webkit_reserved0) (void);
     void (*_webkit_reserved1) (void);

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml	2014-07-30 07:06:43 UTC (rev 171792)
@@ -43,7 +43,6 @@
     <xi:include href=""
     <xi:include href=""
     <xi:include href=""
-    <xi:include href=""
   </chapter>
 
   <chapter>

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt	2014-07-30 07:06:43 UTC (rev 171792)
@@ -1142,18 +1142,3 @@
 WebKitScriptWorldPrivate
 webkit_script_world_get_type
 </SECTION>
-
-<SECTION>
-<FILE>WebKitCertificateInfo</FILE>
-WebKitCertificateInfo
-webkit_certificate_info_copy
-webkit_certificate_info_free
-webkit_certificate_info_get_tls_certificate
-webkit_certificate_info_get_tls_errors
-
-<SUBSECTION Standard>
-WEBKIT_TYPE_CERTIFICATE_INFO
-
-<SUBSECTION Private>
-webkit_certificate_info_get_type
-</SECTION>

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h (171791 => 171792)


--- trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h	2014-07-30 07:06:43 UTC (rev 171792)
@@ -30,7 +30,6 @@
 #include <webkit2/WebKitAuthenticationRequest.h>
 #include <webkit2/WebKitBackForwardList.h>
 #include <webkit2/WebKitBackForwardListItem.h>
-#include <webkit2/WebKitCertificateInfo.h>
 #include <webkit2/WebKitContextMenu.h>
 #include <webkit2/WebKitContextMenuActions.h>
 #include <webkit2/WebKitContextMenuItem.h>

Modified: trunk/Tools/ChangeLog (171791 => 171792)


--- trunk/Tools/ChangeLog	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Tools/ChangeLog	2014-07-30 07:06:43 UTC (rev 171792)
@@ -1,3 +1,15 @@
+2014-07-29  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Remove WebKitCertificateInfo from WebKit2GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=134830
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Update the SSL test for the API changes.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
+        (testLoadFailedWithTLSErrors):
+
 2014-07-24  David Farler  <[email protected]>
 
         Add knowledge of the iOS Simulator to webkitpy

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp (171791 => 171792)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp	2014-07-30 06:16:37 UTC (rev 171791)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp	2014-07-30 07:06:43 UTC (rev 171792)
@@ -149,6 +149,7 @@
     MAKE_GLIB_TEST_FIXTURE(TLSErrorsTest);
 
     TLSErrorsTest()
+        : m_tlsErrors(static_cast<GTlsCertificateFlags>(0))
     {
         g_signal_connect(m_webView, "load-failed-with-tls-errors", G_CALLBACK(runLoadFailedWithTLSErrorsCallback), this);
     }
@@ -156,21 +157,19 @@
     ~TLSErrorsTest()
     {
         g_signal_handlers_disconnect_matched(m_webView, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
-        if (m_certificateInfo)
-            webkit_certificate_info_free(m_certificateInfo);
     }
 
-    static gboolean runLoadFailedWithTLSErrorsCallback(WebKitWebView*, WebKitCertificateInfo* info, const char* host, TLSErrorsTest* test)
+    static gboolean runLoadFailedWithTLSErrorsCallback(WebKitWebView*, GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors, const char* host, TLSErrorsTest* test)
     {
-        test->runLoadFailedWithTLSErrors(info, host);
+        test->runLoadFailedWithTLSErrors(certificate, tlsErrors, host);
         return TRUE;
     }
 
-    void runLoadFailedWithTLSErrors(WebKitCertificateInfo* info, const char* host)
+    void runLoadFailedWithTLSErrors(GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors, const char* host)
     {
-        if (m_certificateInfo)
-            webkit_certificate_info_free(m_certificateInfo);
-        m_certificateInfo = webkit_certificate_info_copy(info);
+        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(certificate));
+        m_certificate = certificate;
+        m_tlsErrors = tlsErrors;
         m_host.reset(g_strdup(host));
         g_main_loop_quit(m_mainLoop);
     }
@@ -180,18 +179,13 @@
         g_main_loop_run(m_mainLoop);
     }
 
-    WebKitCertificateInfo* certificateInfo()
-    {
-        return m_certificateInfo;
-    }
+    GTlsCertificate* certificate() const { return m_certificate.get(); }
+    GTlsCertificateFlags tlsErrors() const { return m_tlsErrors; }
+    const char* host() const { return m_host.get(); }
 
-    const char* host()
-    {
-        return m_host.get();
-    }
-
 private:
-    WebKitCertificateInfo* m_certificateInfo;
+    GRefPtr<GTlsCertificate> m_certificate;
+    GTlsCertificateFlags m_tlsErrors;
     GUniquePtr<char> m_host;
 };
 
@@ -204,14 +198,14 @@
     test->loadURI(kHttpsServer->getURIForPath("/test-tls/").data());
     test->waitUntilLoadFailedWithTLSErrors();
     // Test the WebKitCertificateInfo API.
-    g_assert(G_IS_TLS_CERTIFICATE(webkit_certificate_info_get_tls_certificate(test->certificateInfo())));
-    g_assert_cmpuint(webkit_certificate_info_get_tls_errors(test->certificateInfo()), ==, G_TLS_CERTIFICATE_UNKNOWN_CA);
+    g_assert(G_IS_TLS_CERTIFICATE(test->certificate()));
+    g_assert_cmpuint(test->tlsErrors(), ==, G_TLS_CERTIFICATE_UNKNOWN_CA);
     g_assert_cmpstr(test->host(), ==, soup_uri_get_host(kHttpsServer->baseURI()));
     g_assert_cmpint(test->m_loadEvents[0], ==, LoadTrackingTest::ProvisionalLoadStarted);
     g_assert_cmpint(test->m_loadEvents[1], ==, LoadTrackingTest::LoadFinished);
 
     // Test allowing an exception for this certificate on this host.
-    webkit_web_context_allow_tls_certificate_for_host(context, test->certificateInfo(), test->host());
+    webkit_web_context_allow_tls_certificate_for_host(context, test->certificate(), test->host());
     // The page should now load without errors.
     test->loadURI(kHttpsServer->getURIForPath("/test-tls/").data());
     test->waitUntilLoadFinished();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to