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

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

Issue 2322013002: Check frame for nullptr in WebCore::AutoscrollController::animate (Closed)
Patch Set: Small fix for windows 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 0934143858f7592725af5e51b1c6fdde30aaa720..12e75a3b60a3a65912d185a87e4bdb6d5610bcea 100644
--- a/third_party/WebKit/Source/core/page/AutoscrollController.cpp
+++ b/third_party/WebKit/Source/core/page/AutoscrollController.cpp
@@ -237,26 +237,24 @@ bool AutoscrollController::panScrollInProgress() const
// of WTF::currentTime().
void AutoscrollController::animate(double)
{
- if (!m_autoscrollLayoutObject) {
+ if (!m_autoscrollLayoutObject || !m_autoscrollLayoutObject->frame()) {
stopAutoscroll();
return;
}
+ EventHandler& eventHandler = m_autoscrollLayoutObject->frame()->eventHandler();
switch (m_autoscrollType) {
case AutoscrollForDragAndDrop:
if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay)
m_autoscrollLayoutObject->autoscroll(m_dragAndDropAutoscrollReferencePosition);
break;
case AutoscrollForSelection:
- if (LocalFrame* frame = m_autoscrollLayoutObject->frame()) {
- EventHandler& eventHandler = frame->eventHandler();
- if (!eventHandler.mousePressed()) {
- stopAutoscroll();
- return;
- }
- eventHandler.updateSelectionForMouseDrag();
- m_autoscrollLayoutObject->autoscroll(eventHandler.lastKnownMousePosition());
+ if (!eventHandler.mousePressed()) {
+ stopAutoscroll();
+ return;
}
+ eventHandler.updateSelectionForMouseDrag();
+ m_autoscrollLayoutObject->autoscroll(eventHandler.lastKnownMousePosition());
break;
case NoAutoscroll:
break;
@@ -267,12 +265,8 @@ void AutoscrollController::animate(double)
stopAutoscroll();
return;
}
- if (LocalFrame* frame = m_autoscrollLayoutObject->frame()) {
- if (FrameView* view = frame->view()) {
- EventHandler& eventHandler = frame->eventHandler();
- updatePanScrollState(view, eventHandler.lastKnownMousePosition());
- }
- }
+ if (FrameView* view = m_autoscrollLayoutObject->frame()->view())
+ 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