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

Side by Side Diff: Source/core/frame/DOMTimer.cpp

Issue 739813003: Revert of Changing setTimeout to not clamp delays to 1ms (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 DOMTimer::DOMTimer(ExecutionContext* context, PassOwnPtr<ScheduledAction> action , int interval, bool singleShot, int timeoutID) 92 DOMTimer::DOMTimer(ExecutionContext* context, PassOwnPtr<ScheduledAction> action , int interval, bool singleShot, int timeoutID)
93 : SuspendableTimer(context) 93 : SuspendableTimer(context)
94 , m_timeoutID(timeoutID) 94 , m_timeoutID(timeoutID)
95 , m_nestingLevel(timerNestingLevel + 1) 95 , m_nestingLevel(timerNestingLevel + 1)
96 , m_action(action) 96 , m_action(action)
97 { 97 {
98 ASSERT(timeoutID > 0); 98 ASSERT(timeoutID > 0);
99 if (shouldForwardUserGesture(interval, m_nestingLevel)) 99 if (shouldForwardUserGesture(interval, m_nestingLevel))
100 m_userGestureToken = UserGestureIndicator::currentToken(); 100 m_userGestureToken = UserGestureIndicator::currentToken();
101 101
102 double intervalMilliseconds = std::max(0.0, interval * oneMillisecond); 102 double intervalMilliseconds = std::max(oneMillisecond, interval * oneMillise cond);
103 if (intervalMilliseconds < minimumInterval && m_nestingLevel >= maxTimerNest ingLevel) 103 if (intervalMilliseconds < minimumInterval && m_nestingLevel >= maxTimerNest ingLevel)
104 intervalMilliseconds = minimumInterval; 104 intervalMilliseconds = minimumInterval;
105 if (singleShot) 105 if (singleShot)
106 startOneShot(intervalMilliseconds, FROM_HERE); 106 startOneShot(intervalMilliseconds, FROM_HERE);
107 else 107 else
108 startRepeating(intervalMilliseconds, FROM_HERE); 108 startRepeating(intervalMilliseconds, FROM_HERE);
109 } 109 }
110 110
111 DOMTimer::~DOMTimer() 111 DOMTimer::~DOMTimer()
112 { 112 {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if (fireTime - alignedTimeRoundedDown < minimumInterval) 207 if (fireTime - alignedTimeRoundedDown < minimumInterval)
208 return alignedTimeRoundedDown; 208 return alignedTimeRoundedDown;
209 209
210 return alignedTimeRoundedUp; 210 return alignedTimeRoundedUp;
211 } 211 }
212 212
213 return fireTime; 213 return fireTime;
214 } 214 }
215 215
216 } // namespace blink 216 } // 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