Index: third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h |
diff --git a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h |
index 85fd3a1fc13e205ef84835777b8ff367834c404f..960ae8633122410d43cdd741aaf36497d11fe8d9 100644 |
--- a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h |
+++ b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h |
@@ -54,10 +54,10 @@ class MODULES_EXPORT WaitUntilObserver final |
// These methods can be called when the lifecycle of ExtendableEvent |
// observed by this WaitUntilObserver should be extended by other reason |
// than ExtendableEvent.waitUntil. |
- // Note: There is no need to call decrementPendingActivity() after the context |
+ // Note: There is no need to call DecrementPendingPromise() after the context |
// is being destroyed. |
- void IncrementPendingActivity(); |
- void DecrementPendingActivity(); |
+ void IncrementPendingPromise(); |
+ void DecrementPendingPromise(); |
DECLARE_VIRTUAL_TRACE(); |
@@ -66,12 +66,14 @@ class MODULES_EXPORT WaitUntilObserver final |
class ThenFunction; |
enum class EventDispatchState { |
- // Event dispatch has not yet finished. |
+ // Event dispatch has not yet started. |
kInitial, |
+ // Event dispatch has started but not yet finished. |
+ kDispatching, |
// Event dispatch completed. There may still be outstanding waitUntil |
// promises that must settle before notifying ServiceWorkerGlobalScopeClient |
// that the event finished. |
- kCompleted, |
+ kDispatched, |
// Event dispatch failed. Any outstanding waitUntil promises are ignored. |
kFailed |
}; |
@@ -87,10 +89,12 @@ class MODULES_EXPORT WaitUntilObserver final |
void ConsumeWindowInteraction(TimerBase*); |
+ void MaybeCompleteEvent(); |
+ |
Member<ExecutionContext> execution_context_; |
EventType type_; |
int event_id_; |
- int pending_activity_ = 0; |
+ int pending_promises_ = 0; |
EventDispatchState event_dispatch_state_ = EventDispatchState::kInitial; |
bool has_rejected_promise_ = false; |
double event_dispatch_time_ = 0; |