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 #ifndef WaitUntilObserver_h | 5 #ifndef WaitUntilObserver_h |
6 #define WaitUntilObserver_h | 6 #define WaitUntilObserver_h |
7 | 7 |
8 #include "core/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
9 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" | 9 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" |
10 #include "platform/Timer.h" | 10 #include "platform/Timer.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 void willDispatchEvent(); | 35 void willDispatchEvent(); |
36 void didDispatchEvent(bool errorOccurred); | 36 void didDispatchEvent(bool errorOccurred); |
37 | 37 |
38 // Observes the promise and delays calling the continuation until | 38 // Observes the promise and delays calling the continuation until |
39 // the given promise is resolved or rejected. | 39 // the given promise is resolved or rejected. |
40 void waitUntil(ScriptState*, const ScriptValue&, ExceptionState&); | 40 void waitUntil(ScriptState*, const ScriptValue&, ExceptionState&); |
41 | 41 |
42 DECLARE_VIRTUAL_TRACE(); | 42 DECLARE_VIRTUAL_TRACE(); |
43 | 43 |
44 private: | 44 private: |
| 45 friend class InternalsServiceWorker; |
45 class ThenFunction; | 46 class ThenFunction; |
46 | 47 |
47 WaitUntilObserver(ExecutionContext*, EventType, int eventID); | 48 WaitUntilObserver(ExecutionContext*, EventType, int eventID); |
48 | 49 |
49 void reportError(const ScriptValue&); | 50 void reportError(const ScriptValue&); |
50 | 51 |
51 void incrementPendingActivity(); | 52 void incrementPendingActivity(); |
52 void decrementPendingActivity(); | 53 void decrementPendingActivity(); |
53 | 54 |
54 void consumeWindowInteraction(Timer<WaitUntilObserver>*); | 55 void consumeWindowInteraction(Timer<WaitUntilObserver>*); |
55 | 56 |
56 EventType m_type; | 57 EventType m_type; |
57 int m_eventID; | 58 int m_eventID; |
58 int m_pendingActivity; | 59 int m_pendingActivity; |
59 bool m_hasError; | 60 bool m_hasError; |
60 bool m_eventDispatched; | 61 bool m_eventDispatched; |
61 Timer<WaitUntilObserver> m_consumeWindowInteractionTimer; | 62 Timer<WaitUntilObserver> m_consumeWindowInteractionTimer; |
62 }; | 63 }; |
63 | 64 |
64 } // namespace blink | 65 } // namespace blink |
65 | 66 |
66 #endif // WaitUntilObserver_h | 67 #endif // WaitUntilObserver_h |
OLD | NEW |