Commit 6ef9d628 authored by honeycutt's avatar honeycutt

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



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bee98fe2
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.
......
......@@ -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());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment