Changeset 122567 in webkit


Ignore:
Timestamp:
Jul 13, 2012 5:08:00 AM (12 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] WebKit2 crash when going back/forward
https://bugs.webkit.org/show_bug.cgi?id=91220

Reviewed by Xan Lopez.

For some reason when a page is loaded from the backforward list,
when the didCommitLoadForFrame callback is called for the main
frame, the callback didInitiateLoadForResource hasn't been called
yet, so we don't even have a main resource at that point. We were
assuming we always had a main resource with a response. For now we
just check whether we have a resource before trying to set the
certificate to fix the crash, but we need to figue out why this is
happening an how to properly fix it.

  • UIProcess/API/gtk/WebKitLoaderClient.cpp:

(didCommitLoadForFrame): Check whether we have a main resource
before setting the certificate.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r122566 r122567  
     12012-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] WebKit2 crash when going back/forward
     4        https://bugs.webkit.org/show_bug.cgi?id=91220
     5
     6        Reviewed by Xan Lopez.
     7
     8        For some reason when a page is loaded from the backforward list,
     9        when the didCommitLoadForFrame callback is called for the main
     10        frame, the callback didInitiateLoadForResource hasn't been called
     11        yet, so we don't even have a main resource at that point. We were
     12        assuming we always had a main resource with a response. For now we
     13        just check whether we have a resource before trying to set the
     14        certificate to fix the crash, but we need to figue out why this is
     15        happening an how to properly fix it.
     16
     17        * UIProcess/API/gtk/WebKitLoaderClient.cpp:
     18        (didCommitLoadForFrame): Check whether we have a main resource
     19        before setting the certificate.
     20
    1212012-07-13  Christophe Dumez  <christophe.dumez@intel.com>
    222
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp

    r122547 r122567  
    6767
    6868    WebKitWebView* webView = WEBKIT_WEB_VIEW(clientInfo);
    69     WebKitURIResponse* response = webkit_web_resource_get_response(webkit_web_view_get_main_resource(webView));
    70     webkitURIResponseSetCertificateInfo(response, WKFrameGetCertificateInfo(frame));
     69    WebKitWebResource* resource = webkit_web_view_get_main_resource(webView);
     70    if (resource) {
     71        // We might not have a resource if this load is a content replacement.
     72        // FIXME: For some reason, when going back/forward this callback is emitted even before
     73        // didInitiateLoadForResource(), so we don't have a main resource at this point either.
     74        webkitURIResponseSetCertificateInfo(webkit_web_resource_get_response(resource), WKFrameGetCertificateInfo(frame));
     75    }
    7176
    7277    webkitWebViewLoadChanged(webView, WEBKIT_LOAD_COMMITTED);
Note: See TracChangeset for help on using the changeset viewer.