| 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 <v8.h> |
| 7 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptValue.h" | 10 #include "bindings/core/v8/ScriptValue.h" |
| 10 #include "bindings/core/v8/V8Binding.h" | 11 #include "bindings/core/v8/V8Binding.h" |
| 11 #include "core/dom/ExceptionCode.h" | 12 #include "core/dom/ExceptionCode.h" |
| 12 #include "core/dom/ExecutionContext.h" | 13 #include "core/dom/ExecutionContext.h" |
| 13 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" | 14 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" |
| 14 #include "platform/LayoutTestSupport.h" | 15 #include "platform/LayoutTestSupport.h" |
| 15 #include "public/platform/Platform.h" | 16 #include "public/platform/Platform.h" |
| 16 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" | 17 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" |
| 17 #include "wtf/Assertions.h" | 18 #include "wtf/Assertions.h" |
| 18 #include <v8.h> | |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Timeout before a service worker that was given window interaction | 24 // Timeout before a service worker that was given window interaction |
| 25 // permission loses them. The unit is seconds. | 25 // permission loses them. The unit is seconds. |
| 26 const unsigned kWindowInteractionTimeout = 10; | 26 const unsigned kWindowInteractionTimeout = 10; |
| 27 const unsigned kWindowInteractionTimeoutForTest = 1; | 27 const unsigned kWindowInteractionTimeoutForTest = 1; |
| 28 | 28 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 if (!m_executionContext) | 205 if (!m_executionContext) |
| 206 return; | 206 return; |
| 207 m_executionContext->consumeWindowInteraction(); | 207 m_executionContext->consumeWindowInteraction(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 DEFINE_TRACE(WaitUntilObserver) { | 210 DEFINE_TRACE(WaitUntilObserver) { |
| 211 visitor->trace(m_executionContext); | 211 visitor->trace(m_executionContext); |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace blink | 214 } // namespace blink |
| OLD | NEW |