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

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

Issue 2416843002: Implement FetchEvent.navigationPreload (Closed)
Patch Set: incorporated falken's comment Created 4 years, 2 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 98e7c440390a4af4310e155e1c9a1e787e4c4409..6c3ab85ffa44346cc8e0c090ba1fd4334089500e 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h
+++ b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h
@@ -6,6 +6,7 @@
#define FetchEvent_h
#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptPromiseProperty.h"
#include "modules/EventModules.h"
#include "modules/ModulesExport.h"
#include "modules/fetch/Request.h"
@@ -14,11 +15,13 @@
#include "modules/serviceworkers/RespondWithObserver.h"
#include "modules/serviceworkers/WaitUntilObserver.h"
#include "platform/heap/Handle.h"
+#include "public/platform/modules/serviceworker/WebServiceWorkerPreloadResponseCallbacks.h"
namespace blink {
class ExceptionState;
class Request;
+class Response;
class RespondWithObserver;
// A fetch event is dispatched by the client to a service worker's script
@@ -28,6 +31,10 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent {
DEFINE_WRAPPERTYPEINFO();
public:
+ typedef ScriptPromiseProperty<Member<FetchEvent>,
dcheng 2016/10/21 06:44:23 Nit: prefer `using A = B` over `typedef B A` in ne
horo 2016/10/21 10:56:40 Done.
+ Member<Response>,
+ Member<DOMException>>
+ PreloadResponseProperty;
static FetchEvent* create(ScriptState*,
const AtomicString& type,
const FetchEventInit&);
@@ -35,13 +42,18 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent {
const AtomicString& type,
const FetchEventInit&,
RespondWithObserver*,
- WaitUntilObserver*);
+ WaitUntilObserver*,
+ bool navigationPreloadSent);
Request* request() const;
String clientId() const;
bool isReload() const;
void respondWith(ScriptState*, ScriptPromise, ExceptionState&);
+ ScriptPromise navigationPreload(ScriptState*, bool& isNull);
+
+ std::unique_ptr<WebServiceWorkerPreloadResponseCallbacks>
+ createPreloadResponseCallback(ScriptState*);
const AtomicString& interfaceName() const override;
@@ -52,11 +64,15 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent {
const AtomicString& type,
const FetchEventInit&,
RespondWithObserver*,
- WaitUntilObserver*);
+ WaitUntilObserver*,
+ bool navigationPreloadSent);
private:
+ class PreloadResponseCallbackImpl;
+
Member<RespondWithObserver> m_observer;
Member<Request> m_request;
+ Member<PreloadResponseProperty> m_navigationPreloadProperty;
String m_clientId;
bool m_isReload;
};

Powered by Google App Engine
This is Rietveld 408576698