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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 2644243002: Move ScrollableArea timer to TaskRunnerTimer. (Closed)
Patch Set: Created 3 years, 11 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: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
index 0e1681ef3de8de68557b632c4ba6cd0f38871993..0d4f9f209b37894fdc03c233fb202aec0e0ebb88 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
@@ -37,6 +37,9 @@
#include "platform/scroll/MainThreadScrollingReason.h"
#include "platform/scroll/ProgrammaticScrollAnimator.h"
#include "platform/scroll/ScrollbarTheme.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebScheduler.h"
+#include "public/platform/WebThread.h"
static const int kPixelsPerLineStep = 40;
static const float kMinFractionToStepWhenPaging = 0.875f;
@@ -577,8 +580,9 @@ void ScrollableArea::showOverlayScrollbars() {
return;
if (!m_fadeOverlayScrollbarsTimer) {
- m_fadeOverlayScrollbarsTimer.reset(new Timer<ScrollableArea>(
- this, &ScrollableArea::fadeOverlayScrollbarsTimerFired));
+ m_fadeOverlayScrollbarsTimer.reset(new TaskRunnerTimer<ScrollableArea>(
+ getTimerTaskRunner(), this,
+ &ScrollableArea::fadeOverlayScrollbarsTimerFired));
}
if (!m_scrollbarCaptured && !m_mouseOverScrollbar) {
@@ -657,6 +661,12 @@ FloatQuad ScrollableArea::localToVisibleContentQuad(const FloatQuad& quad,
return result;
}
+RefPtr<WebTaskRunner> ScrollableArea::getTimerTaskRunner() const {
haraken 2017/01/20 05:45:51 I'd prefer making this a pure virtual method and o
jbroman 2017/01/20 15:55:17 Done.
+ WebThread* thread = Platform::current()->mainThread();
+ DCHECK(thread->isCurrentThread());
+ return thread->scheduler()->timerTaskRunner();
+}
+
IntSize ScrollableArea::excludeScrollbars(const IntSize& size) const {
return IntSize(std::max(0, size.width() - verticalScrollbarWidth()),
std::max(0, size.height() - horizontalScrollbarHeight()));

Powered by Google App Engine
This is Rietveld 408576698