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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
11 #include <string> | 12 #include <string> |
12 | 13 |
13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
15 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
16 #include "content/common/service_worker/service_worker_client_info.h" | 17 #include "content/common/service_worker/service_worker_client_info.h" |
17 #include "content/public/common/referrer.h" | 18 #include "content/public/common/referrer.h" |
18 #include "content/public/common/request_context_frame_type.h" | 19 #include "content/public/common/request_context_frame_type.h" |
19 #include "content/public/common/request_context_type.h" | 20 #include "content/public/common/request_context_type.h" |
20 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 21 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 FetchRedirectMode redirect_mode; | 164 FetchRedirectMode redirect_mode; |
164 std::string client_id; | 165 std::string client_id; |
165 bool is_reload; | 166 bool is_reload; |
166 ServiceWorkerFetchType fetch_type; | 167 ServiceWorkerFetchType fetch_type; |
167 }; | 168 }; |
168 | 169 |
169 // Represents a response to a fetch. | 170 // Represents a response to a fetch. |
170 struct CONTENT_EXPORT ServiceWorkerResponse { | 171 struct CONTENT_EXPORT ServiceWorkerResponse { |
171 ServiceWorkerResponse(); | 172 ServiceWorkerResponse(); |
172 ServiceWorkerResponse( | 173 ServiceWorkerResponse( |
173 const GURL& url, | 174 std::unique_ptr<std::vector<GURL>> url_list, |
174 int status_code, | 175 int status_code, |
175 const std::string& status_text, | 176 const std::string& status_text, |
176 blink::WebServiceWorkerResponseType response_type, | 177 blink::WebServiceWorkerResponseType response_type, |
177 const ServiceWorkerHeaderMap& headers, | 178 std::unique_ptr<ServiceWorkerHeaderMap> headers, |
178 const std::string& blob_uuid, | 179 const std::string& blob_uuid, |
179 uint64_t blob_size, | 180 uint64_t blob_size, |
180 const GURL& stream_url, | 181 const GURL& stream_url, |
181 blink::WebServiceWorkerResponseError error, | 182 blink::WebServiceWorkerResponseError error, |
182 base::Time response_time, | 183 base::Time response_time, |
183 bool is_in_cache_storage, | 184 bool is_in_cache_storage, |
184 const std::string& cache_storage_cache_name, | 185 const std::string& cache_storage_cache_name, |
185 const ServiceWorkerHeaderList& cors_exposed_header_names); | 186 std::unique_ptr<ServiceWorkerHeaderList> cors_exposed_header_names); |
186 ServiceWorkerResponse(const ServiceWorkerResponse& other); | 187 ServiceWorkerResponse(const ServiceWorkerResponse& other); |
187 ~ServiceWorkerResponse(); | 188 ~ServiceWorkerResponse(); |
188 size_t EstimatedStructSize(); | 189 size_t EstimatedStructSize(); |
189 | 190 |
190 // Be sure to update EstimatedSize() when adding members. | 191 // Be sure to update EstimatedSize() when adding members. |
191 GURL url; | 192 std::vector<GURL> url_list; |
192 int status_code; | 193 int status_code; |
193 std::string status_text; | 194 std::string status_text; |
194 blink::WebServiceWorkerResponseType response_type; | 195 blink::WebServiceWorkerResponseType response_type; |
195 ServiceWorkerHeaderMap headers; | 196 ServiceWorkerHeaderMap headers; |
196 std::string blob_uuid; | 197 std::string blob_uuid; |
197 uint64_t blob_size; | 198 uint64_t blob_size; |
198 GURL stream_url; | 199 GURL stream_url; |
199 blink::WebServiceWorkerResponseError error; | 200 blink::WebServiceWorkerResponseError error; |
200 base::Time response_time; | 201 base::Time response_time; |
201 bool is_in_cache_storage = false; | 202 bool is_in_cache_storage = false; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 NavigationPreloadState(); | 277 NavigationPreloadState(); |
277 NavigationPreloadState(bool enabled, std::string header); | 278 NavigationPreloadState(bool enabled, std::string header); |
278 NavigationPreloadState(const NavigationPreloadState& other); | 279 NavigationPreloadState(const NavigationPreloadState& other); |
279 bool enabled; | 280 bool enabled; |
280 std::string header; | 281 std::string header; |
281 }; | 282 }; |
282 | 283 |
283 } // namespace content | 284 } // namespace content |
284 | 285 |
285 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ | 286 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ |
OLD | NEW |