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

Unified Diff: Source/modules/serviceworkers/Response.cpp

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/serviceworkers/Response.h ('k') | Source/modules/serviceworkers/Response.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/Response.cpp
diff --git a/Source/modules/serviceworkers/Response.cpp b/Source/modules/serviceworkers/Response.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1b0243374fc99a7f759ce4dd2d2e917a116b6d0e
--- /dev/null
+++ b/Source/modules/serviceworkers/Response.cpp
@@ -0,0 +1,44 @@
+// 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.
+
+#include "config.h"
+#include "Response.h"
+
+#include "bindings/v8/Dictionary.h"
+#include "modules/serviceworkers/ResponseInit.h"
+#include "platform/NotImplemented.h"
+
+namespace WebCore {
+
+PassRefPtr<Response> Response::create()
+{
+ return create(Dictionary());
+}
+
+PassRefPtr<Response> Response::create(const Dictionary& responseInit)
+{
+ return adoptRef(new Response(ResponseInit(responseInit)));
+}
+
+void Response::headers(const Dictionary& headers)
+{
+ notImplemented();
+}
+
+Dictionary* Response::headers()
+{
+ // FIXME: Implement. Spec will eventually whitelist allowable headers.
+ return &m_headers;
+}
+
+Response::Response(const ResponseInit& responseInit)
+ : m_statusCode(responseInit.statusCode)
+ , m_statusText(responseInit.statusText)
+ , m_method(responseInit.method)
+ , m_headers(responseInit.headers)
+{
+ ScriptWrappable::init(this);
+}
+
+} // namespace WebCore
« no previous file with comments | « Source/modules/serviceworkers/Response.h ('k') | Source/modules/serviceworkers/Response.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698