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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/Headers.idl

Issue 2691513002: Fetch: Make Headers' constructor match the current spec IDL. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
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 // https://fetch.spec.whatwg.org/#typedefdef-headersinit
6
7 // The actual typedef in the spec is
8 // (sequence<sequence<ByteString>> or record<ByteString,ByteString>)
9 // which also implicitly includes Headers since it is iterable.
10 // Blink's WebIDL code does not support record<K,V> yet, so we have to make do
11 // with the (Dictionary or Headers) part instead.
12 // See http://crbug.com/685754 and http://crbug.com/690428.
13 typedef (sequence<sequence<ByteString>> or Dictionary or Headers) HeadersInit;
14
5 // https://fetch.spec.whatwg.org/#headers-class 15 // https://fetch.spec.whatwg.org/#headers-class
6 16
7 typedef Dictionary OpenEndedDictionary;
8 [ 17 [
9 Constructor, 18 Constructor(optional HeadersInit init),
10 Constructor(Headers input),
11 Constructor(OpenEndedDictionary input),
12 Constructor(sequence<sequence<ByteString>> input),
13 Exposed=(Window,Worker), 19 Exposed=(Window,Worker),
14 RaisesException=Constructor, 20 RaisesException=Constructor,
15 ] interface Headers { 21 ] interface Headers {
16 [RaisesException] void append(ByteString name, ByteString value); 22 [RaisesException] void append(ByteString name, ByteString value);
17 [ImplementedAs=remove, RaisesException] void delete(ByteString key); 23 [ImplementedAs=remove, RaisesException] void delete(ByteString key);
18 [RaisesException] ByteString? get(ByteString key); 24 [RaisesException] ByteString? get(ByteString key);
19 [RaisesException, Measure] sequence<ByteString> getAll(ByteString name); 25 [RaisesException, Measure] sequence<ByteString> getAll(ByteString name);
20 [RaisesException] boolean has(ByteString key); 26 [RaisesException] boolean has(ByteString key);
21 [RaisesException] void set(ByteString key, ByteString value); 27 [RaisesException] void set(ByteString key, ByteString value);
22 iterable<ByteString, ByteString>; 28 iterable<ByteString, ByteString>;
23 }; 29 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698