diff options
author | John Reck <jreck@google.com> | 2012-03-01 19:18:38 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-03-01 19:18:38 -0800 |
commit | b5f9fc7c5bf10db6f4a97c94f027142a57a5cf36 (patch) | |
tree | ac5e8788c8a77a5203869615110848fdf5a6ffd6 /Source/WebKit | |
parent | f9aa763e9ad41bee64fbd834d1acf4a158e93a3e (diff) | |
download | external_webkit-b5f9fc7c5bf10db6f4a97c94f027142a57a5cf36.zip external_webkit-b5f9fc7c5bf10db6f4a97c94f027142a57a5cf36.tar.gz external_webkit-b5f9fc7c5bf10db6f4a97c94f027142a57a5cf36.tar.bz2 |
Fix m.movies.com crash
Bug: 6105672
Bug was caused by an attempt to get WebViewCore in a frame destructor.
Fixed by adding some shortcuts that do not rely on a valid tree if the
ScrollView given has a platformWidget
Change-Id: I14b4506f621c7234fb1a841d5c9ed14028d0d816
Diffstat (limited to 'Source/WebKit')
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 443f2ca..8908be9 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -538,6 +538,8 @@ WebViewCore* WebViewCore::getWebViewCore(const WebCore::FrameView* view) { if (!view) return 0; + if (view->platformWidget()) + return static_cast<WebFrameView*>(view->platformWidget())->webViewCore(); Frame* frame = view->frame(); while (Frame* parent = frame->tree()->parent()) frame = parent; @@ -553,9 +555,16 @@ WebViewCore* WebViewCore::getWebViewCore(const WebCore::ScrollView* view) { if (!view) return 0; - FrameView* frameView = static_cast<FrameView*>(view->root()); - if (!frameView) - return 0; + if (view->platformWidget()) + return static_cast<WebFrameView*>(view->platformWidget())->webViewCore(); + const FrameView* frameView = 0; + if (view->isFrameView()) + frameView = static_cast<const FrameView*>(view); + else { + frameView = static_cast<const FrameView*>(view->root()); + if (!frameView) + return 0; + } return getWebViewCore(frameView); } @@ -898,8 +907,6 @@ void WebViewCore::scrollTo(int x, int y, bool animate) { ALOG_ASSERT(m_javaGlue->m_obj, "A Java widget was not associated with this view bridge!"); -// ALOGD("WebViewCore::scrollTo(%d %d)\n", x, y); - JNIEnv* env = JSC::Bindings::getJNIEnv(); AutoJObject javaObject = m_javaGlue->object(env); if (!javaObject.get()) |