Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1811)

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1079973007: Don't crash if there is no local main frame on WebView::handleInputEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index bca1b598cbd217254dc1fd8f71ce17e3b1f7ae4f..0ed038eb8fa1febc7dfa5d9417dd29ec62f02e80 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2079,7 +2079,13 @@ static String inputTypeToName(WebInputEvent::Type type)
bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
{
- WebAutofillClient* autofillClient = mainFrameImpl() ? mainFrameImpl()->autofillClient() : 0;
+ // TODO(dcheng): The fact that this is getting called when there is no local
+ // main frame is problematic and probably indicates a bug in the input event
+ // routing code.
+ if (!mainFrameImpl())
+ return false;
+
+ WebAutofillClient* autofillClient = mainFrameImpl()->autofillClient();
UserGestureNotifier notifier(autofillClient, &m_userGestureObserved);
// On the first input event since page load, |notifier| instructs the
// autofill client to unblock values of password input fields of any forms
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698