OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 * | 24 * |
25 */ | 25 */ |
26 | 26 |
27 #include "core/frame/DOMTimer.h" | 27 #include "core/frame/DOMTimer.h" |
28 | 28 |
29 #include "core/dom/ExecutionContext.h" | 29 #include "core/dom/ExecutionContext.h" |
30 #include "core/dom/TaskRunnerHelper.h" | 30 #include "core/dom/TaskRunnerHelper.h" |
31 #include "core/inspector/InspectorTraceEvents.h" | 31 #include "core/inspector/InspectorTraceEvents.h" |
32 #include "core/probe/CoreProbes.h" | 32 #include "core/probe/CoreProbes.h" |
33 #include "platform/instrumentation/tracing/TraceEvent.h" | 33 #include "platform/instrumentation/tracing/TraceEvent.h" |
34 #include "wtf/CurrentTime.h" | 34 #include "platform/wtf/CurrentTime.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 static const int kMaxIntervalForUserGestureForwarding = | 38 static const int kMaxIntervalForUserGestureForwarding = |
39 1000; // One second matches Gecko. | 39 1000; // One second matches Gecko. |
40 static const int kMaxTimerNestingLevel = 5; | 40 static const int kMaxTimerNestingLevel = 5; |
41 static const double kOneMillisecond = 0.001; | 41 static const double kOneMillisecond = 0.001; |
42 // Chromium uses a minimum timer interval of 4ms. We'd like to go | 42 // Chromium uses a minimum timer interval of 4ms. We'd like to go |
43 // lower; however, there are poorly coded websites out there which do | 43 // lower; however, there are poorly coded websites out there which do |
44 // create CPU-spinning loops. Using 4ms prevents the CPU from | 44 // create CPU-spinning loops. Using 4ms prevents the CPU from |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 RefPtr<WebTaskRunner> DOMTimer::TimerTaskRunner() const { | 188 RefPtr<WebTaskRunner> DOMTimer::TimerTaskRunner() const { |
189 return GetExecutionContext()->Timers()->TimerTaskRunner(); | 189 return GetExecutionContext()->Timers()->TimerTaskRunner(); |
190 } | 190 } |
191 | 191 |
192 DEFINE_TRACE(DOMTimer) { | 192 DEFINE_TRACE(DOMTimer) { |
193 visitor->Trace(action_); | 193 visitor->Trace(action_); |
194 SuspendableTimer::Trace(visitor); | 194 SuspendableTimer::Trace(visitor); |
195 } | 195 } |
196 | 196 |
197 } // namespace blink | 197 } // namespace blink |
OLD | NEW |