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/#request-class | 5 // http://fetch.spec.whatwg.org/#request-class |
6 | 6 |
7 typedef (Request or USVString) RequestInfo; | 7 typedef (Request or USVString) RequestInfo; |
8 | 8 |
9 enum RequestContext { | 9 enum RequestContext { |
10 "", "audio", "beacon", "cspreport", "download", "embed", "eventsource", "fav
icon", | 10 "", "audio", "beacon", "cspreport", "download", "embed", "eventsource", "fav
icon", |
11 "fetch", "font", "form", "frame", "hyperlink", "iframe", "image", "imageset"
, "import", | 11 "fetch", "font", "form", "frame", "hyperlink", "iframe", "image", "imageset"
, "import", |
12 "internal", "location", "manifest", "metarefresh", "object", "ping", "plugin
", | 12 "internal", "location", "manifest", "metarefresh", "object", "ping", "plugin
", |
13 "prefetch", "script", "serviceworker", "sharedworker", | 13 "prefetch", "script", "serviceworker", "sharedworker", |
14 "subresource", "style", "track", "video", "worker", "xmlhttprequest", "xslt" | 14 "subresource", "style", "track", "video", "worker", "xmlhttprequest", "xslt" |
15 }; | 15 }; |
16 enum RequestMode { "same-origin", "no-cors", "cors" }; | 16 enum RequestMode { "same-origin", "no-cors", "cors" }; |
17 enum RequestCredentials { "omit", "same-origin", "include" }; | 17 enum RequestCredentials { "omit", "same-origin", "include" }; |
| 18 // TODO(horo): Support RequestRedirect when the chromium side patch land. |
| 19 // enum RequestRedirect { "follow", "error", "manual" }; |
18 | 20 |
19 [ | 21 [ |
20 Constructor(RequestInfo input, optional Dictionary requestInitDict), | 22 Constructor(RequestInfo input, optional Dictionary requestInitDict), |
21 ConstructorCallWith=ScriptState, | 23 ConstructorCallWith=ScriptState, |
22 Exposed=(Window,Worker), | 24 Exposed=(Window,Worker), |
23 RaisesException=Constructor, | 25 RaisesException=Constructor, |
24 ActiveDOMObject, | 26 ActiveDOMObject, |
25 GarbageCollected, | 27 GarbageCollected, |
26 TypeChecking=Interface, | 28 TypeChecking=Interface, |
27 ] interface Request { | 29 ] interface Request { |
28 readonly attribute ByteString method; | 30 readonly attribute ByteString method; |
29 readonly attribute USVString url; | 31 readonly attribute USVString url; |
30 readonly attribute Headers headers; | 32 readonly attribute Headers headers; |
31 readonly attribute RequestContext context; | 33 readonly attribute RequestContext context; |
32 readonly attribute DOMString referrer; | 34 readonly attribute DOMString referrer; |
33 readonly attribute RequestMode mode; | 35 readonly attribute RequestMode mode; |
34 readonly attribute RequestCredentials credentials; | 36 readonly attribute RequestCredentials credentials; |
| 37 // TODO(horo): Support redirect attribute when the chromium side patch land. |
| 38 // readonly attribute RequestRedirect redirect; |
35 | 39 |
36 [RaisesException] Request clone(); | 40 [RaisesException] Request clone(); |
37 }; | 41 }; |
38 | 42 |
39 Request implements Body; | 43 Request implements Body; |
OLD | NEW |