Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h

Issue 2933463002: [Merge to M59] Keep the wrapper of FetchEvent alive while waiting for the preload response. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c47e6844df10e3c4cfea28fbadaa6d69f656b28a..cf0ef6e2a9aef1327f85e6650d41c6eadc840a53 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h
+++ b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h
@@ -5,8 +5,10 @@
#ifndef FetchEvent_h
#define FetchEvent_h
+#include "bindings/core/v8/ActiveScriptWrappable.h"
#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"
@@ -29,8 +31,12 @@ class WebURLResponse;
// 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>,
@@ -46,6 +52,8 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent {
WaitUntilObserver*,
bool navigation_preload_sent);
+ ~FetchEvent() override;
+
Request* request() const;
String clientId() const;
bool isReload() const;
@@ -61,6 +69,9 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent {
const AtomicString& InterfaceName() const override;
+ // ScriptWrappable
+ bool HasPendingActivity() const override;
+
DECLARE_VIRTUAL_TRACE();
protected:

Powered by Google App Engine
This is Rietveld 408576698