diff options
author | Patrick Scott <phanna@android.com> | 2009-08-17 11:58:15 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-08-17 11:58:15 -0700 |
commit | 726cbbc81385999cfe6aa3510ed7098f2bab767c (patch) | |
tree | 0c10c1a6cc75730e6420e6549cb6d8c1e36bf8d7 | |
parent | 6f005c9e8f4b80ca59aaacd9e8fee9670a4a5c8f (diff) | |
parent | d605fe10b4d30363d5a1efcec8df4d1b4b730e66 (diff) | |
download | external_webkit-726cbbc81385999cfe6aa3510ed7098f2bab767c.zip external_webkit-726cbbc81385999cfe6aa3510ed7098f2bab767c.tar.gz external_webkit-726cbbc81385999cfe6aa3510ed7098f2bab767c.tar.bz2 |
am d605fe10: am 7df3d98b: Check for a null request in the policy callbacks.
Merge commit 'd605fe10b4d30363d5a1efcec8df4d1b4b730e66'
* commit 'd605fe10b4d30363d5a1efcec8df4d1b4b730e66':
Check for a null request in the policy callbacks.
-rw-r--r-- | WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index 7554a84..3ea7e49 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -426,9 +426,15 @@ static bool TreatAsAttachment(const String& content_disposition) { } void FrameLoaderClientAndroid::dispatchDecidePolicyForMIMEType(FramePolicyFunction func, - const String& MIMEType, const ResourceRequest&) { + const String& MIMEType, const ResourceRequest& request) { ASSERT(m_frame); ASSERT(func); + if (!func) + return; + if (request.isNull()) { + (m_frame->loader()->*func)(PolicyIgnore); + return; + } // Default to Use (display internally). PolicyAction action = PolicyUse; // Check if we should Download instead. @@ -461,13 +467,20 @@ void FrameLoaderClientAndroid::dispatchDecidePolicyForMIMEType(FramePolicyFuncti } void FrameLoaderClientAndroid::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction func, - const NavigationAction&, const ResourceRequest& req, + const NavigationAction&, const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName) { ASSERT(m_frame); + ASSERT(func); + if (!func) + return; + if (request.isNull()) { + (m_frame->loader()->*func)(PolicyIgnore); + return; + } // If we get to this point it means that a link has a target that was not // found by the frame tree. Instead of creating a new frame, return the // current frame in dispatchCreatePage. - if (canHandleRequest(req)) + if (canHandleRequest(request)) (m_frame->loader()->*func)(PolicyUse); else (m_frame->loader()->*func)(PolicyIgnore); @@ -486,6 +499,12 @@ void FrameLoaderClientAndroid::dispatchDecidePolicyForNavigationAction(FramePoli PassRefPtr<FormState> formState) { ASSERT(m_frame); ASSERT(func); + if (!func) + return; + if (request.isNull()) { + (m_frame->loader()->*func)(PolicyIgnore); + return; + } if (action.type() == NavigationTypeFormResubmitted) { m_webFrame->decidePolicyForFormResubmission(func); return; |