Index: Source/modules/serviceworkers/FetchEvent.cpp |
diff --git a/Source/modules/serviceworkers/FetchEvent.cpp b/Source/modules/serviceworkers/FetchEvent.cpp |
index dbd4dc86d69a746de465820c9b8a28227bf7d32f..928be30555f6ad60c0688d7460d690915fc1c8b7 100644 |
--- a/Source/modules/serviceworkers/FetchEvent.cpp |
+++ b/Source/modules/serviceworkers/FetchEvent.cpp |
@@ -16,9 +16,14 @@ PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create() |
return adoptRefWillBeNoop(new FetchEvent()); |
} |
-PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create(RespondWithObserver* observer, Request* request) |
+PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create(const AtomicString& type, const FetchEventInit& initializer) |
{ |
- return adoptRefWillBeNoop(new FetchEvent(observer, request)); |
+ return adoptRefWillBeNoop(new FetchEvent(type, initializer, nullptr)); |
+} |
+ |
+PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create(const AtomicString& type, const FetchEventInit& initializer, RespondWithObserver* observer) |
+{ |
+ return adoptRefWillBeNoop(new FetchEvent(type, initializer, observer)); |
} |
Request* FetchEvent::request() const |
@@ -42,22 +47,18 @@ const AtomicString& FetchEvent::interfaceName() const |
return EventNames::FetchEvent; |
} |
-void FetchEvent::setIsReload(bool isReload) |
-{ |
- m_isReload = isReload; |
-} |
- |
FetchEvent::FetchEvent() |
: m_isReload(false) |
{ |
} |
-FetchEvent::FetchEvent(RespondWithObserver* observer, Request* request) |
- : Event(EventTypeNames::fetch, /*canBubble=*/false, /*cancelable=*/true) |
+FetchEvent::FetchEvent(const AtomicString& type, const FetchEventInit& initializer, RespondWithObserver* observer) |
+ : Event(type, /*canBubble=*/false, /*cancelable=*/true) |
, m_observer(observer) |
- , m_request(request) |
- , m_isReload(false) |
{ |
+ if (initializer.hasRequest()) |
+ m_request = initializer.request(); |
+ m_isReload = initializer.isReload(); |
} |
DEFINE_TRACE(FetchEvent) |