Chromium Code Reviews| Index: third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h |
| diff --git a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h |
| index 14fb995af0a9508798c9dd0cc8b31c07afe672ab..2c0787001ee63336f094309528c6f7de82d31f91 100644 |
| --- a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h |
| +++ b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h |
| @@ -9,12 +9,14 @@ |
| #include "bindings/core/v8/ScriptPromise.h" |
| #include "bindings/core/v8/ScriptPromiseProperty.h" |
| +#include "core/dom/ContextLifecycleObserver.h" |
| #include "modules/EventModules.h" |
| #include "modules/ModulesExport.h" |
| #include "modules/fetch/Request.h" |
| #include "modules/serviceworkers/ExtendableEvent.h" |
| #include "modules/serviceworkers/FetchEventInit.h" |
| #include "modules/serviceworkers/WaitUntilObserver.h" |
| +#include "platform/bindings/ActiveScriptWrappable.h" |
| #include "platform/heap/Handle.h" |
| #include "platform/loader/fetch/ResourceResponse.h" |
| @@ -33,8 +35,12 @@ class WorkerGlobalScope; |
| // A fetch event is dispatched by the client to a service worker's script |
| // context. FetchRespondWithObserver can be used to notify the client about the |
| // service worker's response. |
| -class MODULES_EXPORT FetchEvent final : public ExtendableEvent { |
| +class MODULES_EXPORT FetchEvent final |
| + : public ExtendableEvent, |
| + public ActiveScriptWrappable<FetchEvent>, |
| + public ContextClient { |
| DEFINE_WRAPPERTYPEINFO(); |
| + USING_GARBAGE_COLLECTED_MIXIN(FetchEvent); |
| public: |
| using PreloadResponseProperty = ScriptPromiseProperty<Member<FetchEvent>, |
| @@ -50,6 +56,8 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent { |
| WaitUntilObserver*, |
| bool navigation_preload_sent); |
| + ~FetchEvent() override; |
| + |
| Request* request() const; |
| String clientId() const; |
| bool isReload() const; |
| @@ -70,6 +78,9 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent { |
| const AtomicString& InterfaceName() const override; |
| + // ScriptWrappable |
| + bool HasPendingActivity() const override; |
| + |
| DECLARE_VIRTUAL_TRACE(); |
| protected: |
| @@ -85,6 +96,7 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent { |
| Member<Request> request_; |
| Member<PreloadResponseProperty> preload_response_property_; |
| std::unique_ptr<WebURLResponse> preload_response_; |
| + bool waiting_for_preload_response_; |
|
yhirano
2017/06/05 02:10:13
You can rely on preload_response_propty_->GetState
horo
2017/06/05 11:11:51
Done.
|
| String client_id_; |
| bool is_reload_; |
| }; |