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

Unified Diff: Source/core/input/EventHandler.cpp

Issue 1315983004: Fix use-after-free bug in long press selection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix minor issue Created 5 years, 4 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
Index: Source/core/input/EventHandler.cpp
diff --git a/Source/core/input/EventHandler.cpp b/Source/core/input/EventHandler.cpp
index 006aa2c40a9b7a45bfea777b122a31c3acd2a0e9..e869308b11cf8dc9dd93b3a1a5d3f02d57519328 100644
--- a/Source/core/input/EventHandler.cpp
+++ b/Source/core/input/EventHandler.cpp
@@ -2126,6 +2126,7 @@ bool EventHandler::handleGestureLongPress(const GestureEventWithHitTestResults&
IntPoint hitTestPoint = m_frame->view()->rootFrameToContents(gestureEvent.position());
HitTestResult result = hitTestResultAtPoint(hitTestPoint);
+ RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
if (selectionController().handleGestureLongPress(gestureEvent, result)) {
focusDocumentView();
return true;
@@ -2785,7 +2786,7 @@ bool EventHandler::sendContextMenuEventForKey(Element* overrideTargetElement)
// The contextmenu event is a mouse event even when invoked using the keyboard.
// This is required for web compatibility.
PlatformEvent::Type eventType = PlatformEvent::MousePressed;
- if (m_frame->settings()->showContextMenuOnMouseUp())
+ if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp())
yosin_UTC9 2015/08/31 02:11:13 Does this change relate to crbug/519905? It is bet
majidvp 2015/08/31 18:06:25 It is necessary to fix the bug.
yosin_UTC9 2015/09/01 01:33:28 Please this describe this in description explicitl
majidvp 2015/09/01 15:33:53 Updated the description to make it clear. The te
eventType = PlatformEvent::MouseReleased;
PlatformMouseEvent mouseEvent(locationInRootFrame, globalPosition, RightButton, eventType, 1, false, false, false, false, PlatformMouseEvent::RealOrIndistinguishable, WTF::currentTime());
@@ -2808,7 +2809,7 @@ bool EventHandler::sendContextMenuEventForGesture(const GestureEventWithHitTestR
PlatformEvent::Type eventType = PlatformEvent::MousePressed;
- if (m_frame->settings()->showContextMenuOnMouseUp())
+ if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp())
yosin_UTC9 2015/08/31 02:11:13 Does this change relate to crbug/519905? It is bet
majidvp 2015/08/31 18:06:25 Ditto.
eventType = PlatformEvent::MouseReleased;
else
modifiers |= PlatformEvent::RightButtonDown;

Powered by Google App Engine
This is Rietveld 408576698