OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // http://fetch.spec.whatwg.org/#headers-class | 5 // http://fetch.spec.whatwg.org/#headers-class |
6 [ | 6 [ |
7 Constructor, | 7 Constructor, |
8 Constructor(Headers input), | 8 Constructor(Headers input), |
9 Constructor(Dictionary input), | 9 Constructor(Dictionary input), |
10 RuntimeEnabled=ServiceWorker, | 10 RuntimeEnabled=ServiceWorker, |
11 Exposed=ServiceWorker, | 11 Exposed=ServiceWorker, |
12 RaisesException=Constructor | 12 RaisesException=Constructor, |
| 13 WillBeGarbageCollected, |
13 ] interface Headers { | 14 ] interface Headers { |
14 [RaisesException] void append(ByteString name, ByteString value); | 15 [RaisesException] void append(ByteString name, ByteString value); |
15 [ImplementedAs=remove, RaisesException] void delete(ByteString key); | 16 [ImplementedAs=remove, RaisesException] void delete(ByteString key); |
16 [RaisesException] ByteString? get(ByteString key); | 17 [RaisesException] ByteString? get(ByteString key); |
17 [RaisesException] sequence<ByteString> getAll(ByteString name); | 18 [RaisesException] sequence<ByteString> getAll(ByteString name); |
18 [RaisesException] boolean has(ByteString key); | 19 [RaisesException] boolean has(ByteString key); |
19 [RaisesException] void set(ByteString key, ByteString value); | 20 [RaisesException] void set(ByteString key, ByteString value); |
20 | 21 |
21 // The following are not defined in the spec. | 22 // The following are not defined in the spec. |
22 // FIXME: We should implement Headers.prototype[Symbol.iterator] instead of | 23 // FIXME: We should implement Headers.prototype[Symbol.iterator] instead of |
23 // forEach and size. | 24 // forEach and size. |
24 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=26102 | 25 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=26102 |
25 readonly attribute unsigned long size; | 26 readonly attribute unsigned long size; |
26 void forEach(HeadersForEachCallback callback, optional any thisArg); | 27 void forEach(HeadersForEachCallback callback, optional any thisArg); |
27 }; | 28 }; |
OLD | NEW |