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

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

Issue 1845463002: Start implementing ForeignFetchEvent for foreign fetch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
Index: third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEvent.h
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEvent.h b/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..aac162e28b8e3cba8fb0271bf1660bf01af0b56a
--- /dev/null
+++ b/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEvent.h
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ForeignFetchEvent_h
+#define ForeignFetchEvent_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "modules/EventModules.h"
+#include "modules/ModulesExport.h"
+#include "modules/fetch/Request.h"
+#include "modules/serviceworkers/ExtendableEvent.h"
+#include "modules/serviceworkers/ForeignFetchEventInit.h"
+#include "modules/serviceworkers/ForeignFetchRespondWithObserver.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class ExceptionState;
+class Request;
+
+// A foreignfetch event is dispatched by the client to a service worker's script
+// context. ForeignFetchRespondWithObserver can be used to notify the client
+// about the service worker's response.
+class MODULES_EXPORT ForeignFetchEvent final : public ExtendableEvent {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static ForeignFetchEvent* create();
+ static ForeignFetchEvent* create(const AtomicString& type, const ForeignFetchEventInit&);
+ static ForeignFetchEvent* create(const AtomicString& type, const ForeignFetchEventInit&, ForeignFetchRespondWithObserver*);
+
+ Request* request() const;
+
+ void respondWith(ScriptState*, ScriptPromise, ExceptionState&);
+
+ const AtomicString& interfaceName() const override;
+
+ DECLARE_VIRTUAL_TRACE();
+
+protected:
+ ForeignFetchEvent();
+ ForeignFetchEvent(const AtomicString& type, const ForeignFetchEventInit&, ForeignFetchRespondWithObserver*);
+
+private:
+ Member<ForeignFetchRespondWithObserver> m_observer;
+ Member<Request> m_request;
+};
+
+} // namespace blink
+
+#endif // ForeignFetchEvent_h
« no previous file with comments | « third_party/WebKit/Source/modules/modules.gypi ('k') | third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698