diff options
author | Henrik Baard <henrik.baard@sonyericsson.com> | 2010-08-13 17:02:46 +0200 |
---|---|---|
committer | Kenneth Andersson <kenneth.andersson@sonyericsson.com> | 2010-08-16 08:52:37 +0200 |
commit | 5dc34a8555dde1ae4a2c174870c4296cc44f8a22 (patch) | |
tree | 6ee43caaf5801bfc7fac9dcf13a8b8f9a2a94501 | |
parent | b940ad181c917c781eaab144ed645b7c85dbc94e (diff) | |
download | external_webkit-5dc34a8555dde1ae4a2c174870c4296cc44f8a22.zip external_webkit-5dc34a8555dde1ae4a2c174870c4296cc44f8a22.tar.gz external_webkit-5dc34a8555dde1ae4a2c174870c4296cc44f8a22.tar.bz2 |
activeDocumentLoader() causes crash in WebCoreFrameBridge.cpp
This is a fix for a crash found in real phones, there is cases when
activeDocumentLoader() can return null, probably related to closing of a
frame or canceling of a request.
Change-Id: Id340ab006b6e40e396645a4e668dcb58824a63e7
-rw-r--r-- | WebKit/android/jni/WebCoreFrameBridge.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index 250ffc9..c7f9eca 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -529,7 +529,12 @@ WebFrame::loadStarted(WebCore::Frame* frame) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - const WebCore::KURL& url = frame->loader()->activeDocumentLoader()->url(); + // activeDocumentLoader() can return null. + DocumentLoader* documentLoader = frame->loader()->activeDocumentLoader(); + if (documentLoader == NULL) + return; + + const WebCore::KURL& url = documentLoader->url(); if (url.isEmpty()) return; LOGV("::WebCore:: loadStarted %s", url.string().ascii().data()); @@ -595,8 +600,14 @@ WebFrame::didFinishLoad(WebCore::Frame* frame) TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif JNIEnv* env = getJNIEnv(); + + // activeDocumentLoader() can return null. WebCore::FrameLoader* loader = frame->loader(); - const WebCore::KURL& url = loader->activeDocumentLoader()->url(); + DocumentLoader* documentLoader = loader->activeDocumentLoader(); + if (documentLoader == NULL) + return; + + const WebCore::KURL& url = documentLoader->url(); if (url.isEmpty()) return; LOGV("::WebCore:: didFinishLoad %s", url.string().ascii().data()); |