2009-02-27 Gustavo Noronha Silva <gns@gnome.org>
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Feb 2009 02:21:11 +0000 (02:21 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Feb 2009 02:21:11 +0000 (02:21 +0000)
        Reviewed by David Hyatt.

        Automatically ignore empty requests to avoid crashing. This fixes
        the crash in fast/loader/empty-embed-src-attribute.html.

        * WebCoreSupport/FrameLoaderClientGtk.cpp:
        (WebKit::FrameLoaderClient::dispatchDecidePolicyForMIMEType):
        (WebKit::FrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
        (WebKit::FrameLoaderClient::dispatchDecidePolicyForNavigationAction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41313 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

index 8369c70..c11031d 100644 (file)
@@ -1,3 +1,15 @@
+2009-02-27  Gustavo Noronha Silva  <gns@gnome.org>
+
+        Reviewed by David Hyatt.
+
+        Automatically ignore empty requests to avoid crashing. This fixes
+        the crash in fast/loader/empty-embed-src-attribute.html.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDecidePolicyForMIMEType):
+        (WebKit::FrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
+        (WebKit::FrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+
 2009-02-27  Xan Lopez  <xan@gnome.org>
 
         Reviewed by Alexey Proskuryakov.
index 951e8d1..4044090 100644 (file)
@@ -274,6 +274,11 @@ void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction poli
     if (!policyFunction)
         return;
 
+    if (resourceRequest.isNull()) {
+        (core(m_frame)->loader()->*policyFunction)(PolicyIgnore);
+        return;
+    }
+
     WebKitWebView* page = getViewFromFrame(m_frame);
     WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data());
 
@@ -301,6 +306,12 @@ void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFuncti
     ASSERT(policyFunction);
     if (!policyFunction)
         return;
+
+    if (resourceRequest.isNull()) {
+        (core(m_frame)->loader()->*policyFunction)(PolicyIgnore);
+        return;
+    }
+
     // FIXME: I think Qt version marshals this to another thread so when we
     // have multi-threaded download, we might need to do the same
     (core(m_frame)->loader()->*policyFunction)(PolicyUse);
@@ -312,6 +323,11 @@ void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunct
     if (!policyFunction)
         return;
 
+    if (resourceRequest.isNull()) {
+        (core(m_frame)->loader()->*policyFunction)(PolicyIgnore);
+        return;
+    }
+
     WebKitWebView* webView = getViewFromFrame(m_frame);
     WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data());
     WebKitNavigationResponse response;