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 // https://fetch.spec.whatwg.org/#request-class | 5 // https://fetch.spec.whatwg.org/#request-class |
6 | 6 |
7 typedef (Request or USVString) RequestInfo; | 7 typedef (Request or USVString) RequestInfo; |
8 | 8 |
9 enum RequestMode { "navigate", "same-origin", "no-cors", "cors" }; | 9 enum RequestMode { "navigate", "same-origin", "no-cors", "cors" }; |
10 enum RequestCredentials { "omit", "same-origin", "include" }; | 10 enum RequestCredentials { "omit", "same-origin", "include" }; |
11 enum RequestRedirect { "follow", "error", "manual" }; | 11 enum RequestRedirect { "follow", "error", "manual" }; |
| 12 enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", |
| 13 "only-if-cached" }; |
12 | 14 |
13 // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies | 15 // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies |
14 | 16 |
15 enum ReferrerPolicy { | 17 enum ReferrerPolicy { |
16 "", | 18 "", |
17 "no-referrer", | 19 "no-referrer", |
18 "no-referrer-when-downgrade", | 20 "no-referrer-when-downgrade", |
19 "origin", | 21 "origin", |
20 "origin-when-cross-origin", | 22 "origin-when-cross-origin", |
21 "unsafe-url" | 23 "unsafe-url" |
22 }; | 24 }; |
23 | 25 |
24 [ | 26 [ |
25 ActiveScriptWrappable, | 27 ActiveScriptWrappable, |
26 Constructor(RequestInfo input, optional Dictionary requestInitDict), | 28 Constructor(RequestInfo input, optional Dictionary requestInitDict), |
27 ConstructorCallWith=ScriptState, | 29 ConstructorCallWith=ScriptState, |
28 Exposed=(Window,Worker), | 30 Exposed=(Window,Worker), |
29 RaisesException=Constructor, | 31 RaisesException=Constructor, |
30 DependentLifetime, | 32 DependentLifetime, |
31 ] interface Request { | 33 ] interface Request { |
32 readonly attribute ByteString method; | 34 readonly attribute ByteString method; |
33 readonly attribute USVString url; | 35 readonly attribute USVString url; |
34 [ImplementedAs=getHeaders] readonly attribute Headers headers; | 36 [ImplementedAs=getHeaders] readonly attribute Headers headers; |
35 readonly attribute DOMString referrer; | 37 readonly attribute DOMString referrer; |
36 [ImplementedAs=getReferrerPolicy] readonly attribute ReferrerPolicy referrer
Policy; | 38 [ImplementedAs=getReferrerPolicy] readonly attribute ReferrerPolicy referrer
Policy; |
37 readonly attribute RequestMode mode; | 39 readonly attribute RequestMode mode; |
38 readonly attribute RequestCredentials credentials; | 40 readonly attribute RequestCredentials credentials; |
| 41 [RuntimeEnabled=FetchRequestCache]readonly attribute RequestCache cache; |
39 readonly attribute RequestRedirect redirect; | 42 readonly attribute RequestRedirect redirect; |
40 readonly attribute DOMString integrity; | 43 readonly attribute DOMString integrity; |
41 | 44 |
42 [RaisesException, CallWith=ScriptState] Request clone(); | 45 [RaisesException, CallWith=ScriptState] Request clone(); |
43 }; | 46 }; |
44 | 47 |
45 Request implements Body; | 48 Request implements Body; |
OLD | NEW |