From: hausmann@webkit.org Date: Wed, 2 Apr 2008 12:00:31 +0000 (+0000) Subject: Holger Hans Peter Freyther X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=16416321b09d0ed83b4c999c17562623cf2ece8f Holger Hans Peter Freyther * Attempt to make the m_webFrame null pointer checking consistent. Always check for m_webFrame. It should get set by the QWebFrame with the FramerLoaderClientQt::setFrame call and should stay valid until the destruction of the QWebFrame. * Currently the same checking is not needed for m_frame as it will only set to 0 in FrameLoaderClientQt::frameLoaderDestroyed and should be not 0 because of the setFrame initialisation. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31563 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index de47596..4307a79 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,22 @@ +2008-04-02 Holger Hans Peter Freyther + + Reviewed by Simon. + + * Attempt to make the m_webFrame null pointer checking consistent. Always check for + m_webFrame. It should get set by the QWebFrame with the FramerLoaderClientQt::setFrame + call and should stay valid until the destruction of the QWebFrame. + * Currently the same checking is not needed for m_frame as it will only set to 0 in + FrameLoaderClientQt::frameLoaderDestroyed and should be not 0 because of the setFrame + initialisation. + + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle): + (WebCore::FrameLoaderClientQt::setMainDocumentError): + (WebCore::FrameLoaderClientQt::dispatchDidReceiveContentLength): + (WebCore::FrameLoaderClientQt::objectContentType): + (WebCore::FrameLoaderClientQt::createPlugin): + 2008-04-01 Holger Hans Peter Freyther Reviewed by Simon. diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index 4d70d25..513aabf 100644 --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -238,6 +238,9 @@ void FrameLoaderClientQt::dispatchDidStartProvisionalLoad() void FrameLoaderClientQt::dispatchDidReceiveTitle(const String& title) { + if (!m_webFrame) + return; + // ### hack emit m_webFrame->urlChanged(m_webFrame->url()); emit titleChanged(title); @@ -246,7 +249,7 @@ void FrameLoaderClientQt::dispatchDidReceiveTitle(const String& title) void FrameLoaderClientQt::dispatchDidCommitLoad() { - if (m_frame->tree()->parent()) + if (m_frame->tree()->parent() || !m_webFrame) return; m_webFrame->page()->d->updateNavigationActions(); } @@ -254,7 +257,7 @@ void FrameLoaderClientQt::dispatchDidCommitLoad() void FrameLoaderClientQt::dispatchDidFinishDocumentLoad() { - if (m_frame->tree()->parent()) + if (m_frame->tree()->parent() || !m_webFrame) return; m_webFrame->page()->d->updateNavigationActions(); } @@ -264,7 +267,7 @@ void FrameLoaderClientQt::dispatchDidFinishLoad() { if (m_webFrame) emit m_webFrame->loadDone(true); - if (m_frame->tree()->parent()) + if (m_frame->tree()->parent() || !m_webFrame) return; m_webFrame->page()->d->updateNavigationActions(); } @@ -315,7 +318,7 @@ void FrameLoaderClientQt::postProgressStartedNotification() { if (m_webFrame && m_frame->page()) emit loadStarted(); - if (m_frame->tree()->parent()) + if (m_frame->tree()->parent() || !m_webFrame) return; m_webFrame->page()->d->updateNavigationActions(); } @@ -459,7 +462,7 @@ void FrameLoaderClientQt::windowObjectCleared() void FrameLoaderClientQt::didPerformFirstNavigation() const { - if (m_frame->tree()->parent()) + if (m_frame->tree()->parent() || !m_webFrame) return; m_webFrame->page()->d->updateNavigationActions(); } @@ -578,6 +581,9 @@ WTF::PassRefPtr FrameLoaderClientQt::createDocumentLoad void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&) { #if QT_VERSION >= 0x040400 + if (!m_webFrame) + return; + QNetworkReplyHandler* handler = handle->getInternal()->m_job; QNetworkReply* reply = handler->release(); if (reply) { @@ -711,6 +717,9 @@ void FrameLoaderClientQt::dispatchUnableToImplementPolicy(const WebCore::Resourc void FrameLoaderClientQt::startDownload(const WebCore::ResourceRequest& request) { #if QT_VERSION >= 0x040400 + if (!m_webFrame) + return; + QWebPage *page = m_webFrame->page(); emit m_webFrame->page()->download(request.toNetworkRequest()); #endif @@ -719,6 +728,9 @@ void FrameLoaderClientQt::startDownload(const WebCore::ResourceRequest& request) PassRefPtr FrameLoaderClientQt::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) { + if (!m_webFrame) + return 0; + QWebFrameData frameData; frameData.url = url; frameData.name = name; @@ -799,6 +811,10 @@ Widget* FrameLoaderClientQt::createPlugin(const IntSize&, Element* element, cons { // qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<