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 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ | 5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ |
6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ | 6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 FETCH_REQUEST_MODE_LAST = FETCH_REQUEST_MODE_CORS_WITH_FORCED_PREFLIGHT | 85 FETCH_REQUEST_MODE_LAST = FETCH_REQUEST_MODE_CORS_WITH_FORCED_PREFLIGHT |
86 }; | 86 }; |
87 | 87 |
88 enum FetchCredentialsMode { | 88 enum FetchCredentialsMode { |
89 FETCH_CREDENTIALS_MODE_OMIT, | 89 FETCH_CREDENTIALS_MODE_OMIT, |
90 FETCH_CREDENTIALS_MODE_SAME_ORIGIN, | 90 FETCH_CREDENTIALS_MODE_SAME_ORIGIN, |
91 FETCH_CREDENTIALS_MODE_INCLUDE, | 91 FETCH_CREDENTIALS_MODE_INCLUDE, |
92 FETCH_CREDENTIALS_MODE_LAST = FETCH_CREDENTIALS_MODE_INCLUDE | 92 FETCH_CREDENTIALS_MODE_LAST = FETCH_CREDENTIALS_MODE_INCLUDE |
93 }; | 93 }; |
94 | 94 |
95 enum FetchRedirectMode { | |
dcheng
2015/08/14 19:03:04
How about using enum class here?
horo
2015/08/15 00:26:31
Sounds good.
Done.
| |
96 FETCH_REDIRECT_MODE_FOLLOW, | |
97 FETCH_REDIRECT_MODE_ERROR, | |
98 FETCH_REDIRECT_MODE_MANUAL, | |
99 FETCH_REDIRECT_MODE_LAST = FETCH_REDIRECT_MODE_MANUAL | |
100 }; | |
101 | |
95 // Indicates how the service worker handled a fetch event. | 102 // Indicates how the service worker handled a fetch event. |
96 enum ServiceWorkerFetchEventResult { | 103 enum ServiceWorkerFetchEventResult { |
97 // Browser should fallback to native fetch. | 104 // Browser should fallback to native fetch. |
98 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, | 105 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, |
99 // Service worker provided a ServiceWorkerResponse. | 106 // Service worker provided a ServiceWorkerResponse. |
100 SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE, | 107 SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE, |
101 SERVICE_WORKER_FETCH_EVENT_LAST = SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE | 108 SERVICE_WORKER_FETCH_EVENT_LAST = SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE |
102 }; | 109 }; |
103 | 110 |
104 struct ServiceWorkerCaseInsensitiveCompare { | 111 struct ServiceWorkerCaseInsensitiveCompare { |
(...skipping 18 matching lines...) Expand all Loading... | |
123 FetchRequestMode mode; | 130 FetchRequestMode mode; |
124 RequestContextType request_context_type; | 131 RequestContextType request_context_type; |
125 RequestContextFrameType frame_type; | 132 RequestContextFrameType frame_type; |
126 GURL url; | 133 GURL url; |
127 std::string method; | 134 std::string method; |
128 ServiceWorkerHeaderMap headers; | 135 ServiceWorkerHeaderMap headers; |
129 std::string blob_uuid; | 136 std::string blob_uuid; |
130 uint64 blob_size; | 137 uint64 blob_size; |
131 Referrer referrer; | 138 Referrer referrer; |
132 FetchCredentialsMode credentials_mode; | 139 FetchCredentialsMode credentials_mode; |
140 FetchRedirectMode redirect_mode; | |
133 bool is_reload; | 141 bool is_reload; |
134 }; | 142 }; |
135 | 143 |
136 // Represents a response to a fetch. | 144 // Represents a response to a fetch. |
137 struct CONTENT_EXPORT ServiceWorkerResponse { | 145 struct CONTENT_EXPORT ServiceWorkerResponse { |
138 ServiceWorkerResponse(); | 146 ServiceWorkerResponse(); |
139 ServiceWorkerResponse(const GURL& url, | 147 ServiceWorkerResponse(const GURL& url, |
140 int status_code, | 148 int status_code, |
141 const std::string& status_text, | 149 const std::string& status_text, |
142 blink::WebServiceWorkerResponseType response_type, | 150 blink::WebServiceWorkerResponseType response_type, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 | 214 |
207 struct ServiceWorkerClientQueryOptions { | 215 struct ServiceWorkerClientQueryOptions { |
208 ServiceWorkerClientQueryOptions(); | 216 ServiceWorkerClientQueryOptions(); |
209 blink::WebServiceWorkerClientType client_type; | 217 blink::WebServiceWorkerClientType client_type; |
210 bool include_uncontrolled; | 218 bool include_uncontrolled; |
211 }; | 219 }; |
212 | 220 |
213 } // namespace content | 221 } // namespace content |
214 | 222 |
215 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ | 223 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ |
OLD | NEW |