| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "Response.h" |
| 7 |
| 8 #include "bindings/v8/Dictionary.h" |
| 9 #include "modules/serviceworkers/ResponseInit.h" |
| 10 #include "platform/NotImplemented.h" |
| 11 |
| 12 namespace WebCore { |
| 13 |
| 14 PassRefPtr<Response> Response::create() |
| 15 { |
| 16 return create(Dictionary()); |
| 17 } |
| 18 |
| 19 PassRefPtr<Response> Response::create(const Dictionary& responseInit) |
| 20 { |
| 21 return adoptRef(new Response(ResponseInit(responseInit))); |
| 22 } |
| 23 |
| 24 void Response::headers(const Dictionary& headers) |
| 25 { |
| 26 notImplemented(); |
| 27 } |
| 28 |
| 29 Dictionary* Response::headers() |
| 30 { |
| 31 // FIXME: Implement. Spec will eventually whitelist allowable headers. |
| 32 return &m_headers; |
| 33 } |
| 34 |
| 35 Response::Response(const ResponseInit& responseInit) |
| 36 : m_statusCode(responseInit.statusCode) |
| 37 , m_statusText(responseInit.statusText) |
| 38 , m_method(responseInit.method) |
| 39 , m_headers(responseInit.headers) |
| 40 { |
| 41 ScriptWrappable::init(this); |
| 42 } |
| 43 |
| 44 } // namespace WebCore |
| OLD | NEW |