OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "platform/PlatformThreadData.h" | 30 #include "platform/PlatformThreadData.h" |
31 #include "platform/SharedTimer.h" | 31 #include "platform/SharedTimer.h" |
32 #include "platform/Timer.h" | 32 #include "platform/Timer.h" |
33 #include "platform/TraceEvent.h" | 33 #include "platform/TraceEvent.h" |
34 #include "platform/scheduler/Scheduler.h" | 34 #include "platform/scheduler/Scheduler.h" |
35 #include "wtf/CurrentTime.h" | 35 #include "wtf/CurrentTime.h" |
36 #include "wtf/MainThread.h" | 36 #include "wtf/MainThread.h" |
37 | 37 |
38 using namespace std; | 38 using namespace std; |
39 | 39 |
40 namespace WebCore { | 40 namespace blink { |
41 | 41 |
42 // Fire timers for this length of time, and then quit to let the run loop proces
s user input events. | 42 // Fire timers for this length of time, and then quit to let the run loop proces
s user input events. |
43 // 100ms is about a perceptable delay in UI, so use a half of that as a threshol
d. | 43 // 100ms is about a perceptable delay in UI, so use a half of that as a threshol
d. |
44 // This is to prevent UI freeze when there are too many timers or machine perfor
mance is low. | 44 // This is to prevent UI freeze when there are too many timers or machine perfor
mance is low. |
45 static const double maxDurationOfFiringTimers = 0.050; | 45 static const double maxDurationOfFiringTimers = 0.050; |
46 | 46 |
47 // Timers are created, started and fired on the same thread, and each thread has
its own ThreadTimers | 47 // Timers are created, started and fired on the same thread, and each thread has
its own ThreadTimers |
48 // copy to keep the heap and a set of currently firing timers. | 48 // copy to keep the heap and a set of currently firing timers. |
49 | 49 |
50 static MainThreadSharedTimer* mainThreadSharedTimer() | 50 static MainThreadSharedTimer* mainThreadSharedTimer() |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 updateSharedTimer(); | 148 updateSharedTimer(); |
149 } | 149 } |
150 | 150 |
151 void ThreadTimers::fireTimersInNestedEventLoop() | 151 void ThreadTimers::fireTimersInNestedEventLoop() |
152 { | 152 { |
153 // Reset the reentrancy guard so the timers can fire again. | 153 // Reset the reentrancy guard so the timers can fire again. |
154 m_firingTimers = false; | 154 m_firingTimers = false; |
155 updateSharedTimer(); | 155 updateSharedTimer(); |
156 } | 156 } |
157 | 157 |
158 } // namespace WebCore | 158 } // namespace blink |
159 | 159 |
OLD | NEW |