Changeset 188147 in webkit
- Timestamp:
- Aug 7, 2015, 12:34:13 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r188144 r188147 1 2015-08-07 Mark Lam <mark.lam@apple.com> 2 3 Rename some variables in the JSC watchdog implementation. 4 https://bugs.webkit.org/show_bug.cgi?id=147790 5 6 Rubber stamped by Benjamin Poulain. 7 8 This is just a refactoring patch to give the variable better names that describe their 9 intended use. There is no behavior change. 10 11 * runtime/Watchdog.cpp: 12 (JSC::Watchdog::Watchdog): 13 (JSC::Watchdog::setTimeLimit): 14 (JSC::Watchdog::didFire): 15 (JSC::Watchdog::isEnabled): 16 (JSC::Watchdog::fire): 17 (JSC::Watchdog::startCountdownIfNeeded): 18 * runtime/Watchdog.h: 19 1 20 2015-08-07 Saam barati <saambarati1@gmail.com> 2 21 -
trunk/Source/JavaScriptCore/runtime/Watchdog.cpp
r176973 r188147 38 38 : m_timerDidFire(false) 39 39 , m_didFire(false) 40 , m_ limit(NO_LIMIT)41 , m_start Time(0)42 , m_elapsed Time(0)40 , m_timeoutPeriod(NO_LIMIT) 41 , m_startCPUTime(0) 42 , m_elapsedCPUTime(0) 43 43 , m_reentryCount(0) 44 44 , m_isStopped(true) … … 67 67 m_didFire = false; // Reset the watchdog. 68 68 69 m_ limit= limit;69 m_timeoutPeriod = limit; 70 70 m_callback = callback; 71 71 m_callbackData1 = data1; … … 99 99 100 100 auto currentTime = currentCPUTime(); 101 auto delta Time = currentTime - m_startTime;102 auto totalElapsed Time = m_elapsedTime + deltaTime;103 if (totalElapsed Time > m_limit) {101 auto deltaCPUTime = currentTime - m_startCPUTime; 102 auto totalElapsedCPUTime = m_elapsedCPUTime + deltaCPUTime; 103 if (totalElapsedCPUTime > m_timeoutPeriod) { 104 104 // Case 1: the allowed CPU time has elapsed. 105 105 … … 122 122 // Tell the timer to alarm us again when it thinks we've reached the 123 123 // end of the allowed time. 124 auto remaining Time = m_limit - totalElapsedTime;125 m_elapsed Time = totalElapsedTime;126 m_start Time = currentTime;127 startCountdown(remaining Time);124 auto remainingCPUTime = m_timeoutPeriod - totalElapsedCPUTime; 125 m_elapsedCPUTime = totalElapsedCPUTime; 126 m_startCPUTime = currentTime; 127 startCountdown(remainingCPUTime); 128 128 } 129 129 … … 133 133 bool Watchdog::isEnabled() 134 134 { 135 return (m_ limit!= NO_LIMIT);135 return (m_timeoutPeriod != NO_LIMIT); 136 136 } 137 137 … … 165 165 166 166 if (isEnabled()) { 167 m_elapsed Time = std::chrono::microseconds::zero();168 m_start Time = currentCPUTime();169 startCountdown(m_ limit);167 m_elapsedCPUTime = std::chrono::microseconds::zero(); 168 m_startCPUTime = currentCPUTime(); 169 startCountdown(m_timeoutPeriod); 170 170 } 171 171 } -
trunk/Source/JavaScriptCore/runtime/Watchdog.h
r187587 r188147 83 83 bool m_didFire; 84 84 85 std::chrono::microseconds m_ limit;86 std::chrono::microseconds m_start Time;87 std::chrono::microseconds m_elapsed Time;85 std::chrono::microseconds m_timeoutPeriod; 86 std::chrono::microseconds m_startCPUTime; 87 std::chrono::microseconds m_elapsedCPUTime; 88 88 89 89 int m_reentryCount;
Note:
See TracChangeset
for help on using the changeset viewer.