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

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

Issue 180843003: Start to implement FetchEvent for ServiceWorker (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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: Source/modules/serviceworkers/FetchEvent.h
diff --git a/Source/modules/serviceworkers/FetchEvent.h b/Source/modules/serviceworkers/FetchEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..da51a171c0657c78b8daef4e87ae6b32ee571993
--- /dev/null
+++ b/Source/modules/serviceworkers/FetchEvent.h
@@ -0,0 +1,39 @@
+// Copyright 2014 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 FetchEvent_h
+#define FetchEvent_h
+
+#include "core/events/Event.h"
+#include "modules/serviceworkers/RespondWithObserver.h"
+
+namespace WebCore {
+
+class ExecutionContext;
+class RespondWithObserver;
+
+// A fetch event is dispatched by the client to a service worker's script
+// context. RespondWithObserver can be used to notify the client about the
+// service worker's response.
+class FetchEvent FINAL : public Event {
+public:
+ static PassRefPtr<FetchEvent> create();
+ static PassRefPtr<FetchEvent> create(PassRefPtr<RespondWithObserver>);
+ virtual ~FetchEvent() { }
+
+ void respondWith(const ScriptValue&);
+
+ virtual const AtomicString& interfaceName() const OVERRIDE;
+
+protected:
+ FetchEvent();
+ FetchEvent(PassRefPtr<RespondWithObserver>);
+
+private:
+ RefPtr<RespondWithObserver> m_observer;
+};
+
+} // namespace WebCore
+
+#endif // FetchEvent_h

Powered by Google App Engine
This is Rietveld 408576698