OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/serviceworkers/WaitUntilObserver.h" | 5 #include "modules/serviceworkers/WaitUntilObserver.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptFunction.h" | 7 #include "bindings/core/v8/ScriptFunction.h" |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
11 #include "core/dom/ExceptionCode.h" | 11 #include "core/dom/ExceptionCode.h" |
12 #include "core/dom/ExecutionContext.h" | 12 #include "core/dom/ExecutionContext.h" |
13 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" | 13 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" |
14 #include "platform/LayoutTestSupport.h" | 14 #include "platform/LayoutTestSupport.h" |
15 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" | 15 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" |
16 #include "wtf/Assertions.h" | 16 #include "wtf/Assertions.h" |
17 #include "wtf/RefCounted.h" | |
18 #include "wtf/RefPtr.h" | |
19 #include <v8.h> | 17 #include <v8.h> |
20 | 18 |
21 namespace blink { | 19 namespace blink { |
22 | 20 |
23 namespace { | 21 namespace { |
24 | 22 |
25 // Timeout before a service worker that was given window interaction | 23 // Timeout before a service worker that was given window interaction |
26 // permission loses them. The unit is seconds. | 24 // permission loses them. The unit is seconds. |
27 const unsigned kWindowInteractionTimeout = 10; | 25 const unsigned kWindowInteractionTimeout = 10; |
28 const unsigned kWindowInteractionTimeoutForTest = 1; | 26 const unsigned kWindowInteractionTimeoutForTest = 1; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 return; | 193 return; |
196 getExecutionContext()->consumeWindowInteraction(); | 194 getExecutionContext()->consumeWindowInteraction(); |
197 } | 195 } |
198 | 196 |
199 DEFINE_TRACE(WaitUntilObserver) | 197 DEFINE_TRACE(WaitUntilObserver) |
200 { | 198 { |
201 ContextLifecycleObserver::trace(visitor); | 199 ContextLifecycleObserver::trace(visitor); |
202 } | 200 } |
203 | 201 |
204 } // namespace blink | 202 } // namespace blink |
OLD | NEW |