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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 return EventTypeNames::touchend; 2072 return EventTypeNames::touchend;
2073 case WebInputEvent::TouchCancel: 2073 case WebInputEvent::TouchCancel:
2074 return EventTypeNames::touchcancel; 2074 return EventTypeNames::touchcancel;
2075 default: 2075 default:
2076 return String("unknown"); 2076 return String("unknown");
2077 } 2077 }
2078 } 2078 }
2079 2079
2080 bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) 2080 bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
2081 { 2081 {
2082 WebAutofillClient* autofillClient = mainFrameImpl() ? mainFrameImpl()->autof illClient() : 0; 2082 // TODO(dcheng): The fact that this is getting called when there is no local
2083 // main frame is problematic and probably indicates a bug in the input event
2084 // routing code.
2085 if (!mainFrameImpl())
2086 return false;
2087
2088 WebAutofillClient* autofillClient = mainFrameImpl()->autofillClient();
2083 UserGestureNotifier notifier(autofillClient, &m_userGestureObserved); 2089 UserGestureNotifier notifier(autofillClient, &m_userGestureObserved);
2084 // On the first input event since page load, |notifier| instructs the 2090 // On the first input event since page load, |notifier| instructs the
2085 // autofill client to unblock values of password input fields of any forms 2091 // autofill client to unblock values of password input fields of any forms
2086 // on the page. There is a single input event, GestureTap, which can both 2092 // on the page. There is a single input event, GestureTap, which can both
2087 // be the first event after page load, and cause a form submission. In that 2093 // be the first event after page load, and cause a form submission. In that
2088 // case, the form submission happens before the autofill client is told 2094 // case, the form submission happens before the autofill client is told
2089 // to unblock the password values, and so the password values are not 2095 // to unblock the password values, and so the password values are not
2090 // submitted. To avoid that, GestureTap is handled explicitly: 2096 // submitted. To avoid that, GestureTap is handled explicitly:
2091 if (inputEvent.type == WebInputEvent::GestureTap && autofillClient) { 2097 if (inputEvent.type == WebInputEvent::GestureTap && autofillClient) {
2092 m_userGestureObserved = true; 2098 m_userGestureObserved = true;
(...skipping 2407 matching lines...) Expand 10 before | Expand all | Expand 10 after
4500 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4506 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4501 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4507 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4502 } 4508 }
4503 4509
4504 void WebViewImpl::forceNextWebGLContextCreationToFail() 4510 void WebViewImpl::forceNextWebGLContextCreationToFail()
4505 { 4511 {
4506 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4512 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4507 } 4513 }
4508 4514
4509 } // namespace blink 4515 } // namespace blink
OLDNEW
« 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