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

Unified Diff: public/web/WebServiceWorkerFetchResponse.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: public/web/WebServiceWorkerFetchResponse.h
diff --git a/public/web/WebServiceWorkerFetchResponse.h b/public/web/WebServiceWorkerFetchResponse.h
new file mode 100644
index 0000000000000000000000000000000000000000..d7c5dfd536620c225a4dbcccff7a24163398a968
--- /dev/null
+++ b/public/web/WebServiceWorkerFetchResponse.h
@@ -0,0 +1,51 @@
+// 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 WebServiceWorkerFetchResponse_h
+#define WebServiceWorkerFetchResponse_h
+
+#include "public/platform/WebPrivatePtr.h"
+#include "public/platform/WebString.h"
+#include "public/platform/WebVector.h"
+
+#if BLINK_IMPLEMENTATION
+namespace WTF { template <typename T> class PassRefPtr; }
+#endif
+
+namespace WebCore { class Response; }
+
+namespace blink {
+
+// Represents a response to a fetch event.
+class WebServiceWorkerFetchResponse {
kinuko 2014/02/26 05:42:49 It's a bit questionable if we want to share this i
falken 2014/02/27 06:45:09 As you once suggested, let me kick the web/ stuff
+public:
+ enum Type { FallbackToNative, Response };
+
+ ~WebServiceWorkerFetchResponse();
+ BLINK_EXPORT Type type() const { return m_type; }
+ BLINK_EXPORT unsigned short statusCode() const;
+ BLINK_EXPORT WebString statusText() const;
+ BLINK_EXPORT WebString method() const;
+
+ // FIXME: Eventually this should have additional methods like:
+ // BLINK_EXPORT WebVector<WebString> headerKeys();
+ // BLINK_EXPORT WebString header(WebString key);
+ // BLINK_EXPORT WebBlob toBlob();
+
+#if BLINK_IMPLEMENTATION
+ WebServiceWorkerFetchResponse(Type);
+ WebServiceWorkerFetchResponse(const WTF::PassRefPtr<WebCore::Response>&);
+#endif
+
+private:
+ Type m_type;
+
+#if BLINK_IMPLEMENTATION
+ WebPrivatePtr<WebCore::Response> m_private;
+#endif
+};
+
+} // namespace blink
+
+#endif // WebServiceWorkerFetchResponse_h
« Source/modules/serviceworkers/Response.idl ('K') | « public/web/WebServiceWorkerContextProxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698