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.
8 #include "bindings/core/v8/Dictionary.h"
9 #include "modules/serviceworkers/Headers.h"
10 #include "platform/heap/Handle.h"
11 #include "wtf/RefPtr.h"
15 // FIXME: Use IDL dictionary instead of this class.
24 explicit ResponseInit(const Dictionary& options, ExceptionState& exceptionState)
28 DictionaryHelper::get(options, "status", status);
29 // FIXME: Spec uses ByteString for statusText. http://crbug.com/347426
30 DictionaryHelper::get(options, "statusText", statusText);
31 DictionaryHelper::get(options, "headers", headers);
33 Vector<Vector<String> > headersVector;
34 if (DictionaryHelper::get(options, "headers", headersVector, exceptionState))
35 headers = Headers::create(headersVector, exceptionState);
37 DictionaryHelper::get(options, "headers", headersDictionary);
41 unsigned short status;
43 Member<Headers> headers;
44 Dictionary headersDictionary;
49 #endif // ResponseInit_h