| Index: third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h
|
| diff --git a/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h b/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h
|
| index 194402fda7f9365f9634ccea5889ad217e3299a7..388a870ab753e13aefb70f29fba1e405ff291f86 100644
|
| --- a/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h
|
| +++ b/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h
|
| @@ -8,9 +8,7 @@
|
| #include "core/dom/ContextLifecycleObserver.h"
|
| #include "core/events/EventTarget.h"
|
| #include "modules/ModulesExport.h"
|
| -#include "modules/serviceworkers/WaitUntilObserver.h"
|
| #include "platform/heap/Handle.h"
|
| -#include "public/platform/WebURLRequest.h"
|
| #include "public/platform/modules/serviceworker/WebServiceWorkerResponseError.h"
|
|
|
| namespace blink {
|
| @@ -20,9 +18,10 @@ class ExecutionContext;
|
| class ScriptPromise;
|
| class ScriptState;
|
| class ScriptValue;
|
| +class WaitUntilObserver;
|
|
|
| -// This class observes the service worker's handling of a FetchEvent and
|
| -// notifies the client.
|
| +// This class observes the service worker's handling of events which have
|
| +// respondWith(), and notifies the client.
|
| class MODULES_EXPORT RespondWithObserver
|
| : public GarbageCollectedFinalized<RespondWithObserver>,
|
| public ContextLifecycleObserver {
|
| @@ -32,48 +31,28 @@ class MODULES_EXPORT RespondWithObserver
|
| virtual ~RespondWithObserver();
|
|
|
| static RespondWithObserver* create(ExecutionContext*,
|
| - int fetchEventID,
|
| - const KURL& requestURL,
|
| - WebURLRequest::FetchRequestMode,
|
| - WebURLRequest::FetchRedirectMode,
|
| - WebURLRequest::FrameType,
|
| - WebURLRequest::RequestContext,
|
| + int eventID,
|
| WaitUntilObserver*);
|
|
|
| void contextDestroyed(ExecutionContext*) override;
|
|
|
| void willDispatchEvent();
|
| - void didDispatchEvent(DispatchEventResult dispatchResult);
|
| + virtual void didDispatchEvent(DispatchEventResult dispatchResult);
|
|
|
| - // Observes the promise and delays calling didHandleFetchEvent() until the
|
| - // given promise is resolved or rejected.
|
| + // Observes the promise and delays calling didHandle*Event() until the given
|
| + // promise is resolved or rejected.
|
| void respondWith(ScriptState*, ScriptPromise, ExceptionState&);
|
|
|
| - void responseWasRejected(WebServiceWorkerResponseError);
|
| + virtual void responseWasRejected(WebServiceWorkerResponseError);
|
| virtual void responseWasFulfilled(const ScriptValue&);
|
|
|
| DECLARE_VIRTUAL_TRACE();
|
|
|
| protected:
|
| - RespondWithObserver(ExecutionContext*,
|
| - int fetchEventID,
|
| - const KURL& requestURL,
|
| - WebURLRequest::FetchRequestMode,
|
| - WebURLRequest::FetchRedirectMode,
|
| - WebURLRequest::FrameType,
|
| - WebURLRequest::RequestContext,
|
| - WaitUntilObserver*);
|
| -
|
| - private:
|
| class ThenFunction;
|
|
|
| - const int m_fetchEventID;
|
| - const KURL m_requestURL;
|
| - const WebURLRequest::FetchRequestMode m_requestMode;
|
| - const WebURLRequest::FetchRedirectMode m_redirectMode;
|
| - const WebURLRequest::FrameType m_frameType;
|
| - const WebURLRequest::RequestContext m_requestContext;
|
| -
|
| + RespondWithObserver(ExecutionContext*, int eventID, WaitUntilObserver*);
|
| + const int m_eventID;
|
| double m_eventDispatchTime = 0;
|
|
|
| enum State { Initial, Pending, Done };
|
|
|