OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
yhirano
2017/03/27 05:58:19
Is it better to rename this file?
Peter Beverloo
2017/03/27 22:22:31
I don't mind too much. It defines a fair number of
yhirano
2017/03/28 12:52:18
sgtm
Peter Beverloo
2017/03/28 14:07:53
Done
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 module blink.mojom; | |
6 | |
7 import "third_party/WebKit/public/platform/referrer.mojom"; | |
8 import "url/mojo/url.mojom"; | |
9 | |
10 // The mode associated with a request. | |
11 // https://fetch.spec.whatwg.org/#concept-request-mode | |
12 enum FetchRequestMode { | |
kinuko
2017/03/27 10:01:03
For the enums that are also used in WebURLRequest
Peter Beverloo
2017/03/27 22:22:30
Yeah, it'd be great to remove the duplication. The
| |
13 SAME_ORIGIN, | |
14 NO_CORS, | |
15 CORS, | |
16 CORS_WITH_FORCED_PREFLIGHT, | |
17 NAVIGATE, | |
18 }; | |
19 | |
20 // Type of the context associated with a request. | |
21 enum RequestContextType { | |
22 UNSPECIFIED, | |
23 AUDIO, | |
24 BEACON, | |
25 CSP_REPORT, | |
26 DOWNLOAD, | |
27 EMBED, | |
28 EVENT_SOURCE, | |
29 FAVICON, | |
30 FETCH, | |
31 FONT, | |
32 FORM, | |
33 FRAME, | |
34 HYPERLINK, | |
35 IFRAME, | |
36 IMAGE, | |
37 IMAGE_SET, | |
38 IMPORT, | |
39 INTERNAL, | |
40 LOCATION, | |
41 MANIFEST, | |
42 OBJECT, | |
43 PING, | |
44 PLUGIN, | |
45 PREFETCH, | |
46 SCRIPT, | |
47 SERVICE_WORKER, | |
48 SHARED_WORKER, | |
49 SUBRESOURCE, | |
50 STYLE, | |
51 TRACK, | |
52 VIDEO, | |
53 WORKER, | |
54 XML_HTTP_REQUEST, | |
55 XSLT, | |
56 }; | |
57 | |
58 // Frame type of the context associated with a request. | |
59 enum RequestContextFrameType { | |
60 AUXILIARY, | |
61 NESTED, | |
62 NONE, | |
63 TOP_LEVEL, | |
64 }; | |
65 | |
66 // Credentials mode indicating which credentials should be included with a | |
67 // request. | |
68 enum FetchCredentialsMode { | |
69 OMIT, | |
70 SAME_ORIGIN, | |
71 INCLUDE, | |
72 PASSWORD, | |
73 }; | |
74 | |
75 // The redirect mode indicating how redirects should be handled. | |
76 // https://fetch.spec.whatwg.org/#concept-request-redirect-mode | |
77 enum FetchRedirectMode { | |
78 FOLLOW, | |
79 ERROR, | |
horo
2017/03/27 05:52:02
This ERROR cause compile error in MSVC.
I think yo
Peter Beverloo
2017/03/27 22:22:31
Thanks for looking into the error! ERROR_MODE woul
| |
80 MANUAL, | |
81 }; | |
82 | |
83 // Whether this is a regular fetch, or a foreign fetch request. | |
84 enum ServiceWorkerFetchType { | |
85 FETCH, | |
86 FOREIGN_FETCH, | |
87 }; | |
88 | |
89 struct FetchAPIRequest { | |
90 FetchRequestMode mode; | |
91 bool is_main_resource_load; | |
92 RequestContextType request_context_type; | |
93 RequestContextFrameType frame_type; | |
94 url.mojom.Url url; | |
95 string method; | |
96 map<string, string> headers; | |
97 string? blob_uuid; | |
98 uint64 blob_size; | |
99 Referrer referrer; | |
100 FetchCredentialsMode credentials_mode; | |
101 FetchRedirectMode redirect_mode; | |
102 string? client_id; | |
103 bool is_reload; | |
104 ServiceWorkerFetchType fetch_type; | |
105 }; | |
OLD | NEW |