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

Unified Diff: third_party/WebKit/Source/core/page/AutoscrollController.cpp

Issue 2316113003: Check frame for nullptr in AutoscrollController::animate (Closed)
Patch Set: Complete the solution Created 4 years, 3 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: third_party/WebKit/Source/core/page/AutoscrollController.cpp
diff --git a/third_party/WebKit/Source/core/page/AutoscrollController.cpp b/third_party/WebKit/Source/core/page/AutoscrollController.cpp
index 34620a291a0f193b9ce7d0e5e8744a84ed516de0..2721ae0b8c0981cb89d71bba4cb9e82763a93c65 100644
--- a/third_party/WebKit/Source/core/page/AutoscrollController.cpp
+++ b/third_party/WebKit/Source/core/page/AutoscrollController.cpp
@@ -241,19 +241,21 @@ void AutoscrollController::animate(double)
return;
}
- EventHandler& eventHandler = m_autoscrollLayoutObject->frame()->eventHandler();
dtapuska 2016/09/08 14:13:20 I was kind of anticipating a change like LocalFra
switch (m_autoscrollType) {
case AutoscrollForDragAndDrop:
if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay)
m_autoscrollLayoutObject->autoscroll(m_dragAndDropAutoscrollReferencePosition);
break;
case AutoscrollForSelection:
- if (!eventHandler.mousePressed()) {
- stopAutoscroll();
- return;
+ if (LocalFrame* frame = m_autoscrollLayoutObject->frame()) {
+ EventHandler& eventHandler = frame->eventHandler();
+ if (!eventHandler.mousePressed()) {
+ stopAutoscroll();
+ return;
+ }
+ eventHandler.updateSelectionForMouseDrag();
+ m_autoscrollLayoutObject->autoscroll(eventHandler.lastKnownMousePosition());
}
- eventHandler.updateSelectionForMouseDrag();
- m_autoscrollLayoutObject->autoscroll(eventHandler.lastKnownMousePosition());
break;
case NoAutoscroll:
break;
@@ -264,8 +266,12 @@ void AutoscrollController::animate(double)
stopAutoscroll();
return;
}
- if (FrameView* view = m_autoscrollLayoutObject->frame()->view())
- updatePanScrollState(view, eventHandler.lastKnownMousePosition());
+ if (LocalFrame* frame = m_autoscrollLayoutObject->frame()) {
+ if (FrameView* view = frame->view()) {
+ EventHandler& eventHandler = frame->eventHandler();
+ updatePanScrollState(view, eventHandler.lastKnownMousePosition());
+ }
+ }
m_autoscrollLayoutObject->panScroll(m_panScrollStartPos);
break;
#endif
« 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