OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 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 10 matching lines...) Expand all Loading... |
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
23 * THE POSSIBILITY OF SUCH DAMAGE. | 23 * THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "platform/UserGestureIndicator.h" | 26 #include "platform/UserGestureIndicator.h" |
27 | 27 |
28 #include "platform/Histogram.h" | 28 #include "platform/Histogram.h" |
29 #include "wtf/Assertions.h" | 29 #include "wtf/Assertions.h" |
30 #include "wtf/CurrentTime.h" | 30 #include "wtf/CurrentTime.h" |
| 31 #include "wtf/StdLibExtras.h" |
31 | 32 |
32 namespace blink { | 33 namespace blink { |
33 | 34 |
34 // User gestures timeout in 1 second. | 35 // User gestures timeout in 1 second. |
35 const double userGestureTimeout = 1.0; | 36 const double userGestureTimeout = 1.0; |
36 | 37 |
37 // For out of process tokens we allow a 10 second delay. | 38 // For out of process tokens we allow a 10 second delay. |
38 const double userGestureOutOfProcessTimeout = 10.0; | 39 const double userGestureOutOfProcessTimeout = 10.0; |
39 | 40 |
40 UserGestureToken::UserGestureToken(Status status) | 41 UserGestureToken::UserGestureToken(Status status) |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 UserGestureToken* UserGestureIndicator::currentToken() { | 179 UserGestureToken* UserGestureIndicator::currentToken() { |
179 DCHECK(isMainThread()); | 180 DCHECK(isMainThread()); |
180 return s_rootToken; | 181 return s_rootToken; |
181 } | 182 } |
182 | 183 |
183 UserGestureToken* UserGestureIndicator::currentTokenThreadSafe() { | 184 UserGestureToken* UserGestureIndicator::currentTokenThreadSafe() { |
184 return isMainThread() ? currentToken() : nullptr; | 185 return isMainThread() ? currentToken() : nullptr; |
185 } | 186 } |
186 | 187 |
187 } // namespace blink | 188 } // namespace blink |
OLD | NEW |