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

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

Issue 1079073003: 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..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)
« 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