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

Unified Diff: Source/modules/serviceworkers/FetchEvent.cpp

Issue 1099073002: Introducing FetchEventInit Dictionary. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « Source/modules/serviceworkers/FetchEvent.h ('k') | Source/modules/serviceworkers/FetchEvent.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/FetchEvent.cpp
diff --git a/Source/modules/serviceworkers/FetchEvent.cpp b/Source/modules/serviceworkers/FetchEvent.cpp
index dbd4dc86d69a746de465820c9b8a28227bf7d32f..9de7ad7601773d2dbf5eada4e0c55203cc360226 100644
--- a/Source/modules/serviceworkers/FetchEvent.cpp
+++ b/Source/modules/serviceworkers/FetchEvent.cpp
@@ -16,9 +16,16 @@ PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create()
return adoptRefWillBeNoop(new FetchEvent());
}
-PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create(RespondWithObserver* observer, Request* request)
+PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create(const AtomicString& type, FetchEventInit& initializer)
{
- return adoptRefWillBeNoop(new FetchEvent(observer, request));
+ initializer.setCancelable(true);
+ return adoptRefWillBeNoop(new FetchEvent(type, initializer, nullptr));
+}
+
+PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create(const AtomicString& type, FetchEventInit& initializer, RespondWithObserver* observer)
+{
+ initializer.setCancelable(true);
+ return adoptRefWillBeNoop(new FetchEvent(type, initializer, observer));
}
Request* FetchEvent::request() const
@@ -42,22 +49,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)
+ : ExtendableEvent(type, initializer)
, m_observer(observer)
- , m_request(request)
- , m_isReload(false)
{
+ if (initializer.hasRequest())
+ m_request = initializer.request();
+ m_isReload = initializer.isReload();
}
DEFINE_TRACE(FetchEvent)
« no previous file with comments | « Source/modules/serviceworkers/FetchEvent.h ('k') | Source/modules/serviceworkers/FetchEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698