2007-11-09 Jon Honeycutt <jhoneycutt@apple.com>
authorhoneycutt <honeycutt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Nov 2007 02:28:57 +0000 (02:28 +0000)
committerhoneycutt <honeycutt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Nov 2007 02:28:57 +0000 (02:28 +0000)
        Reviewed by Sam.

        <rdar://5585900>: Safari crashes when selected in context menu to open
        audio format files (au, aif) with QT 7.3

        The crash occurred on a machine where QT 7.3 was failing to initialize.
        The fix is to avoid sending streams to full-page plugins that've failed
        to load

        * WebFrame.cpp:
        (WebFrame::finishedLoading): Check plugin status before calling manual
        stream methods
        (WebFrame::setMainDocumentError): Same
        (WebFrame::committedLoad): Same

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

WebKit/win/ChangeLog
WebKit/win/WebFrame.cpp

index 3fd3200..b3b0004 100644 (file)
@@ -1,3 +1,20 @@
+2007-11-09  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        Reviewed by Sam.
+
+        <rdar://5585900>: Safari crashes when selected in context menu to open
+        audio format files (au, aif) with QT 7.3
+
+        The crash occurred on a machine where QT 7.3 was failing to initialize.
+        The fix is to avoid sending streams to full-page plugins that've failed 
+        to load
+
+        * WebFrame.cpp:
+        (WebFrame::finishedLoading): Check plugin status before calling manual
+        stream methods
+        (WebFrame::setMainDocumentError): Same
+        (WebFrame::committedLoad): Same
+
 2007-11-09  Sam Weinig  <sam@webkit.org>
 
         Rubber stamped by Oliver.
index d17fcd6..31c1f7b 100644 (file)
@@ -1728,7 +1728,8 @@ void WebFrame::finishedLoading(DocumentLoader* loader)
     if (!d->m_pluginView)
         committedLoad(loader, 0, 0);
     else {
-        d->m_pluginView->didFinishLoading();
+        if (d->m_pluginView->status() == PluginStatusLoadedSuccessfully)
+            d->m_pluginView->didFinishLoading();
         d->m_pluginView = 0;
         d->m_hasSentResponseToPlugin = false;
     }
@@ -1926,7 +1927,8 @@ PassRefPtr<DocumentLoader> WebFrame::createDocumentLoader(const ResourceRequest&
 void WebFrame::setMainDocumentError(DocumentLoader*, const ResourceError& error)
 {
     if (d->m_pluginView) {
-        d->m_pluginView->didFail(error);
+        if (d->m_pluginView->status() == PluginStatusLoadedSuccessfully)
+            d->m_pluginView->didFail(error);
         d->m_pluginView = 0;
         d->m_hasSentResponseToPlugin = false;
     }
@@ -2028,7 +2030,7 @@ void WebFrame::committedLoad(DocumentLoader* loader, const char* data, int lengt
     if (!d->m_pluginView)
         receivedData(data, length, textEncoding);
 
-    if (d->m_pluginView) {
+    if (d->m_pluginView && d->m_pluginView->status() == PluginStatusLoadedSuccessfully) {
         if (!d->m_hasSentResponseToPlugin) {
             d->m_pluginView->didReceiveResponse(d->frame->loader()->documentLoader()->response());
             // didReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in
@@ -2366,7 +2368,7 @@ Widget* WebFrame::createPlugin(const IntSize& pluginSize, Element* element, cons
         pluginName = pluginView->plugin()->name();
     if (!pluginName.isNull()) {
         static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorPlugInNameKey);
-        RetainPtr<CFStringRef> str(AdoptCF, mimeType.createCFString());
+        RetainPtr<CFStringRef> str(AdoptCF, pluginName.createCFString());
         CFDictionarySetValue(userInfo.get(), key, str.get());
     }