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 { "navigate", "same-origin", "no-cors", "cors" }; | 16 enum RequestMode { "navigate", "same-origin", "no-cors", "cors" }; |
17 enum RequestCredentials { "omit", "same-origin", "include" }; | 17 enum RequestCredentials { "omit", "same-origin", "include" }; |
18 enum RequestRedirect { "follow", "error", "manual" }; | 18 enum RequestRedirect { "follow", "error", "manual" }; |
19 enum ReferrerPolicy { | |
20 "", | |
21 "no-referrer", | |
22 "no-referrer-when-downgrade", | |
23 "origin-only", | |
jochen (gone - plz use gerrit)
2016/04/15 12:04:19
should be "origin"
yhirano
2016/04/18 08:43:28
It's from https://fetch.spec.whatwg.org/#concept-r
| |
24 "origin-when-cross-origin", | |
25 "unsafe-url" | |
26 }; | |
19 | 27 |
20 [ | 28 [ |
21 Constructor(RequestInfo input, optional Dictionary requestInitDict), | 29 Constructor(RequestInfo input, optional Dictionary requestInitDict), |
22 ConstructorCallWith=ScriptState, | 30 ConstructorCallWith=ScriptState, |
23 Exposed=(Window,Worker), | 31 Exposed=(Window,Worker), |
24 RaisesException=Constructor, | 32 RaisesException=Constructor, |
25 DependentLifetime, | 33 DependentLifetime, |
26 ] interface Request { | 34 ] interface Request { |
27 readonly attribute ByteString method; | 35 readonly attribute ByteString method; |
28 readonly attribute USVString url; | 36 readonly attribute USVString url; |
29 [ImplementedAs=getHeaders] readonly attribute Headers headers; | 37 [ImplementedAs=getHeaders] readonly attribute Headers headers; |
30 readonly attribute DOMString referrer; | 38 readonly attribute DOMString referrer; |
39 readonly attribute ReferrerPolicy referrerPolicy; | |
31 readonly attribute RequestMode mode; | 40 readonly attribute RequestMode mode; |
32 readonly attribute RequestCredentials credentials; | 41 readonly attribute RequestCredentials credentials; |
33 readonly attribute RequestRedirect redirect; | 42 readonly attribute RequestRedirect redirect; |
34 readonly attribute DOMString integrity; | 43 readonly attribute DOMString integrity; |
35 | 44 |
36 [RaisesException] Request clone(); | 45 [RaisesException] Request clone(); |
37 }; | 46 }; |
38 | 47 |
39 Request implements Body; | 48 Request implements Body; |
OLD | NEW |