Chromium Code Reviews| 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..3b9b831616e1062f0cfc0650de1ca0a9fe17cf3e 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_promise_ = 0; |
|
falken
2017/05/24 08:24:18
pending_promises_
leonhsl(Using Gerrit)
2017/05/25 00:16:40
Done.
|
| EventDispatchState event_dispatch_state_ = EventDispatchState::kInitial; |
| bool has_rejected_promise_ = false; |
| double event_dispatch_time_ = 0; |