| 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 03d806ca926ca46c675939ae6de4eec3dee427b8..f35ceb48309405059eb8dc970506d4dad59e21b5 100644
|
| --- a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h
|
| +++ b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h
|
| @@ -9,7 +9,9 @@
|
| #include "modules/ModulesExport.h"
|
| #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
|
| #include "platform/Timer.h"
|
| +#include "public/platform/modules/serviceworker/service_worker_event_status.mojom-shared.h"
|
| #include "wtf/Forward.h"
|
| +#include <memory>
|
|
|
| namespace blink {
|
|
|
| @@ -24,6 +26,8 @@ class MODULES_EXPORT WaitUntilObserver final
|
| : public GarbageCollectedFinalized<WaitUntilObserver>,
|
| public ContextLifecycleObserver {
|
| USING_GARBAGE_COLLECTED_MIXIN(WaitUntilObserver);
|
| + using Callback = WTF::Function<void(blink::mojom::ServiceWorkerEventStatus,
|
| + const double&)>;
|
|
|
| public:
|
| enum EventType {
|
| @@ -38,6 +42,9 @@ class MODULES_EXPORT WaitUntilObserver final
|
| };
|
|
|
| static WaitUntilObserver* create(ExecutionContext*, EventType, int eventID);
|
| + static WaitUntilObserver* create(ExecutionContext*,
|
| + EventType,
|
| + std::unique_ptr<Callback>);
|
|
|
| // Must be called before and after dispatching the event.
|
| void willDispatchEvent();
|
| @@ -55,13 +62,19 @@ class MODULES_EXPORT WaitUntilObserver final
|
| void incrementPendingActivity();
|
| void decrementPendingActivity();
|
|
|
| + // Overriden from LifecycleObserver
|
| + void contextDestroyed() override;
|
| +
|
| DECLARE_VIRTUAL_TRACE();
|
|
|
| private:
|
| friend class InternalsServiceWorker;
|
| class ThenFunction;
|
|
|
| - WaitUntilObserver(ExecutionContext*, EventType, int eventID);
|
| + WaitUntilObserver(ExecutionContext*,
|
| + EventType,
|
| + int eventID,
|
| + std::unique_ptr<Callback>);
|
|
|
| void reportError(const ScriptValue&);
|
|
|
| @@ -74,6 +87,7 @@ class MODULES_EXPORT WaitUntilObserver final
|
| bool m_eventDispatched = false;
|
| double m_eventDispatchTime = 0;
|
| Timer<WaitUntilObserver> m_consumeWindowInteractionTimer;
|
| + std::unique_ptr<Callback> m_callback;
|
| };
|
|
|
| } // namespace blink
|
|
|