| 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 "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
| 9 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" | 9 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" |
| 10 #include "platform/Timer.h" | 10 #include "platform/Timer.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 enum EventType { | 25 enum EventType { |
| 26 Activate, | 26 Activate, |
| 27 Fetch, | 27 Fetch, |
| 28 Install, | 28 Install, |
| 29 Message, | 29 Message, |
| 30 NotificationClick, | 30 NotificationClick, |
| 31 NotificationClose, | 31 NotificationClose, |
| 32 PaymentRequest, | 32 PaymentRequest, |
| 33 Push, | 33 Push, |
| 34 Sync | 34 Sync, |
| 35 BackgroundFetchAbort, |
| 36 BackgroundFetchClick |
| 35 }; | 37 }; |
| 36 | 38 |
| 37 static WaitUntilObserver* create(ExecutionContext*, EventType, int eventID); | 39 static WaitUntilObserver* create(ExecutionContext*, EventType, int eventID); |
| 38 | 40 |
| 39 // Must be called before and after dispatching the event. | 41 // Must be called before and after dispatching the event. |
| 40 void willDispatchEvent(); | 42 void willDispatchEvent(); |
| 41 void didDispatchEvent(bool errorOccurred); | 43 void didDispatchEvent(bool errorOccurred); |
| 42 | 44 |
| 43 // Observes the promise and delays calling the continuation until | 45 // Observes the promise and delays calling the continuation until |
| 44 // the given promise is resolved or rejected. | 46 // the given promise is resolved or rejected. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 70 int m_pendingActivity = 0; | 72 int m_pendingActivity = 0; |
| 71 bool m_hasError = false; | 73 bool m_hasError = false; |
| 72 bool m_eventDispatched = false; | 74 bool m_eventDispatched = false; |
| 73 double m_eventDispatchTime = 0; | 75 double m_eventDispatchTime = 0; |
| 74 TaskRunnerTimer<WaitUntilObserver> m_consumeWindowInteractionTimer; | 76 TaskRunnerTimer<WaitUntilObserver> m_consumeWindowInteractionTimer; |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace blink | 79 } // namespace blink |
| 78 | 80 |
| 79 #endif // WaitUntilObserver_h | 81 #endif // WaitUntilObserver_h |
| OLD | NEW |