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

Side by Side Diff: third_party/WebKit/Source/core/page/AutoscrollController.cpp

Issue 2326643002: Use monotonic time instead of current time in autoscroll controller (Closed)
Patch Set: 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 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 UseCounter::count(m_page->mainFrame(), UseCounter::PanScrollingStart); 226 UseCounter::count(m_page->mainFrame(), UseCounter::PanScrollingStart);
227 startAutoscroll(); 227 startAutoscroll();
228 } 228 }
229 #else 229 #else
230 bool AutoscrollController::panScrollInProgress() const 230 bool AutoscrollController::panScrollInProgress() const
231 { 231 {
232 return false; 232 return false;
233 } 233 }
234 #endif 234 #endif
235 235
236 // FIXME: This would get get better animation fidelity if it used the monotonicF rameBeginTime instead
237 // of WTF::currentTime().
238 void AutoscrollController::animate(double) 236 void AutoscrollController::animate(double)
239 { 237 {
240 if (!m_autoscrollLayoutObject) { 238 if (!m_autoscrollLayoutObject) {
241 stopAutoscroll(); 239 stopAutoscroll();
242 return; 240 return;
243 } 241 }
244 242
245 switch (m_autoscrollType) { 243 switch (m_autoscrollType) {
246 case AutoscrollForDragAndDrop: 244 case AutoscrollForDragAndDrop:
247 if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDe lay) 245 if (WTF::monotonicallyIncreasingTime() - m_dragAndDropAutoscrollStartTim e > autoscrollDelay)
dtapuska 2016/09/08 18:09:51 You are going to have to adjust the initialization
dtapuska 2016/09/08 18:16:27 Nevermind it appears that the m_dragAndDropAutoscr
248 m_autoscrollLayoutObject->autoscroll(m_dragAndDropAutoscrollReferenc ePosition); 246 m_autoscrollLayoutObject->autoscroll(m_dragAndDropAutoscrollReferenc ePosition);
249 break; 247 break;
250 case AutoscrollForSelection: 248 case AutoscrollForSelection:
251 if (LocalFrame* frame = m_autoscrollLayoutObject->frame()) { 249 if (LocalFrame* frame = m_autoscrollLayoutObject->frame()) {
252 EventHandler& eventHandler = frame->eventHandler(); 250 EventHandler& eventHandler = frame->eventHandler();
253 if (!eventHandler.mousePressed()) { 251 if (!eventHandler.mousePressed()) {
254 stopAutoscroll(); 252 stopAutoscroll();
255 return; 253 return;
256 } 254 }
257 eventHandler.updateSelectionForMouseDrag(); 255 eventHandler.updateSelectionForMouseDrag();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 view->setCursor(eastPanningCursor()); 315 view->setCursor(eastPanningCursor());
318 } else if (west) { 316 } else if (west) {
319 view->setCursor(westPanningCursor()); 317 view->setCursor(westPanningCursor());
320 } else { 318 } else {
321 view->setCursor(middlePanningCursor()); 319 view->setCursor(middlePanningCursor());
322 } 320 }
323 } 321 }
324 #endif 322 #endif
325 323
326 } // namespace blink 324 } // 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