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

Unified Diff: sky/engine/core/frame/DOMTimer.cpp

Issue 868933003: Remove user gesture tracking (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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: sky/engine/core/frame/DOMTimer.cpp
diff --git a/sky/engine/core/frame/DOMTimer.cpp b/sky/engine/core/frame/DOMTimer.cpp
index a2b8385bc588ff469e0bf4d9fcfd076e382ac86b..b1465a8e204902bed5d5012dc4bdcf9e768bac78 100644
--- a/sky/engine/core/frame/DOMTimer.cpp
+++ b/sky/engine/core/frame/DOMTimer.cpp
@@ -35,7 +35,6 @@
namespace blink {
-static const int maxIntervalForUserGestureForwarding = 1000; // One second matches Gecko.
static const int maxTimerNestingLevel = 5;
static const double oneMillisecond = 0.001;
// Chromium uses a minimum timer interval of 4ms. We'd like to go
@@ -47,13 +46,6 @@ static const double minimumInterval = 0.004;
static int timerNestingLevel = 0;
-static inline bool shouldForwardUserGesture(int interval, int nestingLevel)
-{
- return UserGestureIndicator::processingUserGesture()
- && interval <= maxIntervalForUserGestureForwarding
- && nestingLevel == 1; // Gestures should not be forwarded to nested timers.
-}
-
double DOMTimer::hiddenPageAlignmentInterval()
{
// Timers on hidden pages are aligned so that they fire once per
@@ -91,8 +83,6 @@ DOMTimer::DOMTimer(ExecutionContext* context, PassOwnPtr<ScheduledAction> action
, m_action(action)
{
ASSERT(timeoutID > 0);
- if (shouldForwardUserGesture(interval, m_nestingLevel))
- m_userGestureToken = UserGestureIndicator::currentToken();
double intervalMilliseconds = std::max(oneMillisecond, interval * oneMillisecond);
if (intervalMilliseconds < minimumInterval && m_nestingLevel >= maxTimerNestingLevel)
@@ -117,8 +107,6 @@ void DOMTimer::fired()
ExecutionContext* context = executionContext();
timerNestingLevel = m_nestingLevel;
ASSERT(!context->activeDOMObjectsAreSuspended());
- // Only the first execution of a multi-shot timer should get an affirmative user gesture indicator.
- UserGestureIndicator gestureIndicator(m_userGestureToken.release());
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "TimerFire", "data", InspectorTimerFireEvent::data(context, m_timeoutID));

Powered by Google App Engine
This is Rietveld 408576698