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

Side by Side Diff: third_party/WebKit/Source/core/input/PointerEventManager.cpp

Issue 2485383004: Add a null check for token creation to avoid crash (Closed)
Patch Set: Created 4 years, 1 month 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
« 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/input/PointerEventManager.h" 5 #include "core/input/PointerEventManager.h"
6 6
7 #include "core/dom/DocumentUserGestureToken.h" 7 #include "core/dom/DocumentUserGestureToken.h"
8 #include "core/dom/ElementTraversal.h" 8 #include "core/dom/ElementTraversal.h"
9 #include "core/dom/shadow/FlatTreeTraversal.h" 9 #include "core/dom/shadow/FlatTreeTraversal.h"
10 #include "core/events/MouseEvent.h" 10 #include "core/events/MouseEvent.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 // Any finger lifting is a user gesture only when it wasn't associated with a 311 // Any finger lifting is a user gesture only when it wasn't associated with a
312 // scroll. 312 // scroll.
313 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZu7 nvOg/edit# 313 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZu7 nvOg/edit#
314 // Re-use the same UserGesture for touchend and pointerup (but not for the 314 // Re-use the same UserGesture for touchend and pointerup (but not for the
315 // mouse events generated by GestureTap). 315 // mouse events generated by GestureTap).
316 // For the rare case of multi-finger scenarios spanning documents, it 316 // For the rare case of multi-finger scenarios spanning documents, it
317 // seems extremely unlikely to matter which document the gesture is 317 // seems extremely unlikely to matter which document the gesture is
318 // associated with so just pick the first finger. 318 // associated with so just pick the first finger.
319 RefPtr<UserGestureToken> possibleGestureToken; 319 RefPtr<UserGestureToken> possibleGestureToken;
320 if (event.type() == PlatformEvent::TouchEnd && 320 if (event.type() == PlatformEvent::TouchEnd &&
321 !m_inCanceledStateForPointerTypeTouch) { 321 !m_inCanceledStateForPointerTypeTouch && touchInfos[0].targetFrame) {
dtapuska 2016/11/09 21:12:14 I'd feel safer if we added !touchInfo.isEmpty() as
Navid Zolghadr 2016/11/09 21:18:04 Although that would be weird to pass such a thing
322 possibleGestureToken = 322 possibleGestureToken =
323 DocumentUserGestureToken::create(touchInfos[0].targetFrame->document()); 323 DocumentUserGestureToken::create(touchInfos[0].targetFrame->document());
324 } 324 }
325 UserGestureIndicator holder(possibleGestureToken); 325 UserGestureIndicator holder(possibleGestureToken);
326 326
327 dispatchTouchPointerEvents(event, touchInfos); 327 dispatchTouchPointerEvents(event, touchInfos);
328 328
329 return m_touchEventManager->handleTouchEvent(event, touchInfos); 329 return m_touchEventManager->handleTouchEvent(event, touchInfos);
330 } 330 }
331 331
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 return true; 718 return true;
719 } 719 }
720 return false; 720 return false;
721 } 721 }
722 722
723 EventTarget* PointerEventManager::getMouseCapturingNode() { 723 EventTarget* PointerEventManager::getMouseCapturingNode() {
724 return getCapturingNode(PointerEventFactory::s_mouseId); 724 return getCapturingNode(PointerEventFactory::s_mouseId);
725 } 725 }
726 726
727 } // namespace blink 727 } // 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