| 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 RespondWithObserver_h | 5 #ifndef RespondWithObserver_h |
| 6 #define RespondWithObserver_h | 6 #define RespondWithObserver_h |
| 7 | 7 |
| 8 #include "core/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
| 9 #include "core/events/EventTarget.h" | 9 #include "core/events/EventTarget.h" |
| 10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 static RespondWithObserver* create(ExecutionContext*, | 34 static RespondWithObserver* create(ExecutionContext*, |
| 35 int fetchEventID, | 35 int fetchEventID, |
| 36 const KURL& requestURL, | 36 const KURL& requestURL, |
| 37 WebURLRequest::FetchRequestMode, | 37 WebURLRequest::FetchRequestMode, |
| 38 WebURLRequest::FetchRedirectMode, | 38 WebURLRequest::FetchRedirectMode, |
| 39 WebURLRequest::FrameType, | 39 WebURLRequest::FrameType, |
| 40 WebURLRequest::RequestContext, | 40 WebURLRequest::RequestContext, |
| 41 WaitUntilObserver*); | 41 WaitUntilObserver*); |
| 42 | 42 |
| 43 void contextDestroyed() override; | 43 void contextDestroyed(ExecutionContext*) override; |
| 44 | 44 |
| 45 void willDispatchEvent(); | 45 void willDispatchEvent(); |
| 46 void didDispatchEvent(DispatchEventResult dispatchResult); | 46 void didDispatchEvent(DispatchEventResult dispatchResult); |
| 47 | 47 |
| 48 // Observes the promise and delays calling didHandleFetchEvent() until the | 48 // Observes the promise and delays calling didHandleFetchEvent() until the |
| 49 // given promise is resolved or rejected. | 49 // given promise is resolved or rejected. |
| 50 void respondWith(ScriptState*, ScriptPromise, ExceptionState&); | 50 void respondWith(ScriptState*, ScriptPromise, ExceptionState&); |
| 51 | 51 |
| 52 void responseWasRejected(WebServiceWorkerResponseError); | 52 void responseWasRejected(WebServiceWorkerResponseError); |
| 53 virtual void responseWasFulfilled(const ScriptValue&); | 53 virtual void responseWasFulfilled(const ScriptValue&); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 83 // passed to RespondWith is resolved. The lifecycle of the ExtendableEvent | 83 // passed to RespondWith is resolved. The lifecycle of the ExtendableEvent |
| 84 // is controlled by WaitUntilObserver, so not only | 84 // is controlled by WaitUntilObserver, so not only |
| 85 // WaitUntilObserver::ThenFunction but RespondWith needs to have a strong | 85 // WaitUntilObserver::ThenFunction but RespondWith needs to have a strong |
| 86 // reference to the WaitUntilObserver. | 86 // reference to the WaitUntilObserver. |
| 87 Member<WaitUntilObserver> m_observer; | 87 Member<WaitUntilObserver> m_observer; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace blink | 90 } // namespace blink |
| 91 | 91 |
| 92 #endif // RespondWithObserver_h | 92 #endif // RespondWithObserver_h |
| OLD | NEW |