Changeset 171792 in webkit
- Timestamp:
- Jul 30, 2014 12:06:43 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r171788 r171792 1 2014-07-29 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Remove WebKitCertificateInfo from WebKit2GTK+ API 4 https://bugs.webkit.org/show_bug.cgi?id=134830 5 6 Reviewed by Gustavo Noronha Silva. 7 8 It was added to make the API more convenient but it has ended up 9 making it more complicated. WebKitWebView::load-failed-with-tls-errors 10 now receives a GTlsCertificate + GTlsCertificateFlags and 11 webkit_web_context_allow_tls_certificate_for_host() receives a GTlsCertificate 12 since the errors are not actually needed. This makes the API more 13 consistent with the existing method webkit_web_view_get_tls_info(). 14 15 * PlatformGTK.cmake: Remove files from compilation. 16 * UIProcess/API/gtk/WebKitCertificateInfo.cpp: Removed. 17 * UIProcess/API/gtk/WebKitCertificateInfo.h: Removed. 18 * UIProcess/API/gtk/WebKitCertificateInfoPrivate.h: Removed. 19 * UIProcess/API/gtk/WebKitWebContext.cpp: 20 (webkit_web_context_allow_tls_certificate_for_host): 21 * UIProcess/API/gtk/WebKitWebContext.h: 22 * UIProcess/API/gtk/WebKitWebView.cpp: 23 (webkit_web_view_class_init): 24 (webkitWebViewLoadFailedWithTLSErrors): 25 * UIProcess/API/gtk/WebKitWebView.h: 26 * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: 27 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: 28 * UIProcess/API/gtk/webkit2.h: 29 1 30 2014-07-29 Jinwoo Song <jinwoo7.song@samsung.com> 2 31 -
trunk/Source/WebKit2/PlatformGTK.cmake
r171742 r171792 101 101 UIProcess/API/gtk/WebKitBackForwardListItem.h 102 102 UIProcess/API/gtk/WebKitBackForwardListPrivate.h 103 UIProcess/API/gtk/WebKitCertificateInfo.cpp104 UIProcess/API/gtk/WebKitCertificateInfo.h105 UIProcess/API/gtk/WebKitCertificateInfoPrivate.h106 103 UIProcess/API/gtk/WebKitContextMenu.cpp 107 104 UIProcess/API/gtk/WebKitContextMenu.h … … 325 322 ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardList.h 326 323 ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardListItem.h 327 ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitCertificateInfo.h328 324 ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitCredential.h 329 325 ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitContextMenu.h -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
r171742 r171792 27 27 #include "WebGeolocationManagerProxy.h" 28 28 #include "WebKitBatteryProvider.h" 29 #include "WebKitCertificateInfoPrivate.h"30 29 #include "WebKitCookieManagerPrivate.h" 31 30 #include "WebKitDownloadClient.h" … … 901 900 * webkit_web_context_allow_tls_certificate_for_host: 902 901 * @context: a #WebKitWebContext 903 * @ info: a #WebKitCertificateInfo902 * @certificate: a #GTlsCertificate 904 903 * @host: the host for which a certificate is to be allowed 905 904 * 906 905 * Ignore further TLS errors on the @host for the certificate present in @info. 907 906 * 908 * Since: 2. 4909 */ 910 void webkit_web_context_allow_tls_certificate_for_host(WebKitWebContext* context, WebKitCertificateInfo* info, const gchar* host)911 { 912 g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); 913 g_return_if_fail( info);907 * Since: 2.6 908 */ 909 void webkit_web_context_allow_tls_certificate_for_host(WebKitWebContext* context, GTlsCertificate* certificate, const gchar* host) 910 { 911 g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); 912 g_return_if_fail(G_IS_TLS_CERTIFICATE(certificate)); 914 913 g_return_if_fail(host); 915 914 916 RefPtr<WebCertificateInfo> webCertificateInfo = WebCertificateInfo::create( webkitCertificateInfoGetCertificateInfo(info));915 RefPtr<WebCertificateInfo> webCertificateInfo = WebCertificateInfo::create(WebCore::CertificateInfo(certificate, static_cast<GTlsCertificateFlags>(0))); 917 916 context->priv->context->allowSpecificHTTPSCertificateForHost(webCertificateInfo.get(), String::fromUTF8(host)); 918 917 } -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
r163698 r171792 26 26 27 27 #include <glib-object.h> 28 #include <webkit2/WebKitCertificateInfo.h>29 28 #include <webkit2/WebKitCookieManager.h> 30 29 #include <webkit2/WebKitDefines.h> … … 237 236 WEBKIT_API void 238 237 webkit_web_context_allow_tls_certificate_for_host (WebKitWebContext *context, 239 WebKitCertificateInfo *info,238 GTlsCertificate *certificate, 240 239 const gchar *host); 241 240 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
r171742 r171792 30 30 #include "WebKitAuthenticationRequestPrivate.h" 31 31 #include "WebKitBackForwardListPrivate.h" 32 #include "WebKitCertificateInfoPrivate.h"33 32 #include "WebKitContextMenuClient.h" 34 33 #include "WebKitContextMenuItemPrivate.h" … … 872 871 * WebKitWebView::load-failed-with-tls-errors: 873 872 * @web_view: the #WebKitWebView on which the signal is emitted 874 * @info: a #WebKitCertificateInfo 873 * @certificate: a #GTlsCertificate 874 * @errors: a #GTlsCertificateFlags with the verification status of @certificate 875 875 * @host: the host on which the error occurred 876 876 * 877 * Emitted when a TLS error occurs during a load operation. The @info 878 * object contains information about the error such as the #GTlsCertificate 879 * and the #GTlsCertificateFlags. To allow an exception for this certificate 877 * Emitted when a TLS error occurs during a load operation. 878 * To allow an exception for this certificate 880 879 * and this host use webkit_web_context_allow_tls_certificate_for_host(). 881 880 * 882 * To handle this signal asynchronously you should c opy the #WebKitCertificateInfo883 * with webkit_certificate_info_copy()and return %TRUE.881 * To handle this signal asynchronously you should call g_object_ref() on @certificate 882 * and return %TRUE. 884 883 * 885 884 * If %FALSE is returned, #WebKitWebView::load-failed will be emitted. The load … … 889 888 * %FALSE to propagate the event further. 890 889 * 891 * Since: 2. 4890 * Since: 2.6 892 891 */ 893 892 signals[LOAD_FAILED_WITH_TLS_ERRORS] = … … 897 896 G_STRUCT_OFFSET(WebKitWebViewClass, load_failed_with_tls_errors), 898 897 g_signal_accumulator_true_handled, 0 /* accumulator data */, 899 webkit_marshal_BOOLEAN__BOXED_STRING, 900 G_TYPE_BOOLEAN, 2, /* number of parameters */ 901 WEBKIT_TYPE_CERTIFICATE_INFO | G_SIGNAL_TYPE_STATIC_SCOPE, 898 g_cclosure_marshal_generic, 899 G_TYPE_BOOLEAN, 3, 900 G_TYPE_TLS_CERTIFICATE, 901 G_TYPE_TLS_CERTIFICATE_FLAGS, 902 902 G_TYPE_STRING); 903 903 … … 1583 1583 if (tlsErrorsPolicy == WEBKIT_TLS_ERRORS_POLICY_FAIL) { 1584 1584 GUniquePtr<SoupURI> soupURI(soup_uri_new(failingURI)); 1585 WebKitCertificateInfo info(certificate, tlsErrors);1586 1585 gboolean returnValue; 1587 g_signal_emit(webView, signals[LOAD_FAILED_WITH_TLS_ERRORS], 0, &info, soupURI->host, &returnValue);1586 g_signal_emit(webView, signals[LOAD_FAILED_WITH_TLS_ERRORS], 0, certificate, tlsErrors, soupURI->host, &returnValue); 1588 1587 if (!returnValue) 1589 1588 g_signal_emit(webView, signals[LOAD_FAILED], 0, WEBKIT_LOAD_STARTED, failingURI, error, &returnValue); -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
r171742 r171792 236 236 WebKitAuthenticationRequest *request); 237 237 gboolean (* load_failed_with_tls_errors) (WebKitWebView *web_view, 238 WebKitCertificateInfo *info, 238 GTlsCertificate *certificate, 239 GTlsCertificateFlags errors, 239 240 const gchar *host); 240 241 void (*_webkit_reserved0) (void); -
trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
r171742 r171792 44 44 <xi:include href="xml/WebKitFormSubmissionRequest.xml"/> 45 45 <xi:include href="xml/WebKitSecurityManager.xml"/> 46 <xi:include href="xml/WebKitCertificateInfo.xml"/>47 46 </chapter> 48 47 -
trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
r171742 r171792 1143 1143 webkit_script_world_get_type 1144 1144 </SECTION> 1145 1146 <SECTION>1147 <FILE>WebKitCertificateInfo</FILE>1148 WebKitCertificateInfo1149 webkit_certificate_info_copy1150 webkit_certificate_info_free1151 webkit_certificate_info_get_tls_certificate1152 webkit_certificate_info_get_tls_errors1153 1154 <SUBSECTION Standard>1155 WEBKIT_TYPE_CERTIFICATE_INFO1156 1157 <SUBSECTION Private>1158 webkit_certificate_info_get_type1159 </SECTION> -
trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h
r171742 r171792 31 31 #include <webkit2/WebKitBackForwardList.h> 32 32 #include <webkit2/WebKitBackForwardListItem.h> 33 #include <webkit2/WebKitCertificateInfo.h>34 33 #include <webkit2/WebKitContextMenu.h> 35 34 #include <webkit2/WebKitContextMenuActions.h> -
trunk/Tools/ChangeLog
r171789 r171792 1 2014-07-29 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Remove WebKitCertificateInfo from WebKit2GTK+ API 4 https://bugs.webkit.org/show_bug.cgi?id=134830 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Update the SSL test for the API changes. 9 10 * TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp: 11 (testLoadFailedWithTLSErrors): 12 1 13 2014-07-24 David Farler <dfarler@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp
r168417 r171792 150 150 151 151 TLSErrorsTest() 152 : m_tlsErrors(static_cast<GTlsCertificateFlags>(0)) 152 153 { 153 154 g_signal_connect(m_webView, "load-failed-with-tls-errors", G_CALLBACK(runLoadFailedWithTLSErrorsCallback), this); … … 157 158 { 158 159 g_signal_handlers_disconnect_matched(m_webView, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this); 159 if (m_certificateInfo) 160 webkit_certificate_info_free(m_certificateInfo); 161 } 162 163 static gboolean runLoadFailedWithTLSErrorsCallback(WebKitWebView*, WebKitCertificateInfo* info, const char* host, TLSErrorsTest* test) 164 { 165 test->runLoadFailedWithTLSErrors(info, host); 160 } 161 162 static gboolean runLoadFailedWithTLSErrorsCallback(WebKitWebView*, GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors, const char* host, TLSErrorsTest* test) 163 { 164 test->runLoadFailedWithTLSErrors(certificate, tlsErrors, host); 166 165 return TRUE; 167 166 } 168 167 169 void runLoadFailedWithTLSErrors( WebKitCertificateInfo* info, const char* host)170 { 171 if (m_certificateInfo)172 webkit_certificate_info_free(m_certificateInfo);173 m_ certificateInfo = webkit_certificate_info_copy(info);168 void runLoadFailedWithTLSErrors(GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors, const char* host) 169 { 170 assertObjectIsDeletedWhenTestFinishes(G_OBJECT(certificate)); 171 m_certificate = certificate; 172 m_tlsErrors = tlsErrors; 174 173 m_host.reset(g_strdup(host)); 175 174 g_main_loop_quit(m_mainLoop); … … 181 180 } 182 181 183 WebKitCertificateInfo* certificateInfo() 184 { 185 return m_certificateInfo; 186 } 187 188 const char* host() 189 { 190 return m_host.get(); 191 } 182 GTlsCertificate* certificate() const { return m_certificate.get(); } 183 GTlsCertificateFlags tlsErrors() const { return m_tlsErrors; } 184 const char* host() const { return m_host.get(); } 192 185 193 186 private: 194 WebKitCertificateInfo* m_certificateInfo; 187 GRefPtr<GTlsCertificate> m_certificate; 188 GTlsCertificateFlags m_tlsErrors; 195 189 GUniquePtr<char> m_host; 196 190 }; … … 205 199 test->waitUntilLoadFailedWithTLSErrors(); 206 200 // Test the WebKitCertificateInfo API. 207 g_assert(G_IS_TLS_CERTIFICATE( webkit_certificate_info_get_tls_certificate(test->certificateInfo())));208 g_assert_cmpuint( webkit_certificate_info_get_tls_errors(test->certificateInfo()), ==, G_TLS_CERTIFICATE_UNKNOWN_CA);201 g_assert(G_IS_TLS_CERTIFICATE(test->certificate())); 202 g_assert_cmpuint(test->tlsErrors(), ==, G_TLS_CERTIFICATE_UNKNOWN_CA); 209 203 g_assert_cmpstr(test->host(), ==, soup_uri_get_host(kHttpsServer->baseURI())); 210 204 g_assert_cmpint(test->m_loadEvents[0], ==, LoadTrackingTest::ProvisionalLoadStarted); … … 212 206 213 207 // Test allowing an exception for this certificate on this host. 214 webkit_web_context_allow_tls_certificate_for_host(context, test->certificate Info(), test->host());208 webkit_web_context_allow_tls_certificate_for_host(context, test->certificate(), test->host()); 215 209 // The page should now load without errors. 216 210 test->loadURI(kHttpsServer->getURIForPath("/test-tls/").data());
Note: See TracChangeset
for help on using the changeset viewer.