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

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: patch for landing 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
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/serviceworkers/FetchEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5f5bccf7c30b92fafbe9ead121a8c9bc37fd9e64
--- /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();
+ explicit FetchEvent(PassRefPtr<RespondWithObserver>);
+
+private:
+ RefPtr<RespondWithObserver> m_observer;
+};
+
+} // namespace WebCore
+
+#endif // FetchEvent_h
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/serviceworkers/FetchEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698