summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-11-03 12:30:30 +0000
committerBen Murdoch <benm@google.com>2011-11-03 12:34:08 +0000
commit9f3355b57b144ac285d6bb28e39268a8e9f26fd6 (patch)
tree69d2339d2facf031f80bac5f57e4f94d5a64e56f /Source
parent1c694b72a5eeade23acf64618e14ab19fcb5801a (diff)
downloadexternal_webkit-9f3355b57b144ac285d6bb28e39268a8e9f26fd6.zip
external_webkit-9f3355b57b144ac285d6bb28e39268a8e9f26fd6.tar.gz
external_webkit-9f3355b57b144ac285d6bb28e39268a8e9f26fd6.tar.bz2
Fix crash in Autofill.
Fix a crash in autofill that can be caused by toggling the setting on and off. Bug: 5452927 Change-Id: I80ba0b823fd16cb4e2df3359be95f3d063a9b091
Diffstat (limited to 'Source')
-rw-r--r--Source/WebKit/android/WebCoreSupport/autofill/WebAutofill.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/autofill/WebAutofill.cpp b/Source/WebKit/android/WebCoreSupport/autofill/WebAutofill.cpp
index 7ab7abd..863e8b0 100644
--- a/Source/WebKit/android/WebCoreSupport/autofill/WebAutofill.cpp
+++ b/Source/WebKit/android/WebCoreSupport/autofill/WebAutofill.cpp
@@ -129,6 +129,14 @@ void WebAutofill::formsSeenImpl()
void WebAutofill::formFieldFocused(WebCore::HTMLFormControlElement* formFieldElement)
{
+ if (!enabled()) {
+ // In case that we've just been disabled and the last time we got autofill
+ // suggestions we told Java about them, clear that bit Java side now
+ // we're disabled.
+ mWebViewCore->setWebTextViewAutoFillable(FORM_NOT_AUTOFILLABLE, string16());
+ return;
+ }
+
ASSERT(formFieldElement);
Document* doc = formFieldElement->document();
@@ -149,13 +157,7 @@ void WebAutofill::formFieldFocused(WebCore::HTMLFormControlElement* formFieldEle
mLastSearchDomVersion = domVersion;
}
- if (!enabled()) {
- // In case that we've just been disabled and the last time we got autofill
- // suggestions and told Java about them, clear that bit Java side now
- // we're disabled.
- mWebViewCore->setWebTextViewAutoFillable(FORM_NOT_AUTOFILLABLE, string16());
- return;
- }
+ ASSERT(mFormManager);
// Get the FormField from the Node.
webkit_glue::FormField* formField = new webkit_glue::FormField;