| 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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // Wrapper that gathers parameters to |on_start_completed_callback_| and then | 231 // Wrapper that gathers parameters to |on_start_completed_callback_| and then |
| 232 // calls it. | 232 // calls it. |
| 233 void OnStartCompleted() const; | 233 void OnStartCompleted() const; |
| 234 | 234 |
| 235 bool IsMainResourceLoad() const; | 235 bool IsMainResourceLoad() const; |
| 236 | 236 |
| 237 // For waiting for files sizes of request body files with unknown sizes. | 237 // For waiting for files sizes of request body files with unknown sizes. |
| 238 bool HasRequestBody(); | 238 bool HasRequestBody(); |
| 239 void RequestBodyFileSizesResolved(bool success); | 239 void RequestBodyFileSizesResolved(bool success); |
| 240 | 240 |
| 241 // Called back from |
| 242 // ServiceWorkerFetchEventDispatcher::MaybeStartNavigationPreload when the |
| 243 // navigation preload response starts. |
| 244 void OnNavigationPreloadResponse(); |
| 245 |
| 246 void MaybeReportNavigationPreloadMetrics(); |
| 247 |
| 241 // Not owned. | 248 // Not owned. |
| 242 Delegate* delegate_; | 249 Delegate* delegate_; |
| 243 | 250 |
| 244 // Timing info to show on the popup in Devtools' Network tab. | 251 // Timing info to show on the popup in Devtools' Network tab. |
| 245 net::LoadTimingInfo load_timing_info_; | 252 net::LoadTimingInfo load_timing_info_; |
| 253 |
| 254 // When the worker was asked to prepare for the fetch event. Preparation may |
| 255 // include activation and startup. |
| 246 base::TimeTicks worker_start_time_; | 256 base::TimeTicks worker_start_time_; |
| 257 |
| 258 // When the worker confirmed it's ready for the fetch event. If it was already |
| 259 // activated and running when asked to prepare, this should be nearly the same |
| 260 // as |worker_start_time_|). |
| 247 base::TimeTicks worker_ready_time_; | 261 base::TimeTicks worker_ready_time_; |
| 262 |
| 263 // When the response started. |
| 248 base::Time response_time_; | 264 base::Time response_time_; |
| 249 | 265 |
| 266 // When the navigation preload response started. |
| 267 base::TimeTicks navigation_preload_response_time_; |
| 268 |
| 269 // True if the worker was already in ACTIVATED status when asked to prepare |
| 270 // for the fetch event. |
| 271 bool worker_already_activated_ = false; |
| 272 |
| 273 // The status the worker was in when asked to prepare for the fetch event. |
| 274 EmbeddedWorkerStatus initial_worker_status_ = EmbeddedWorkerStatus::STOPPED; |
| 275 |
| 276 // If worker startup occurred during preparation, the situation that startup |
| 277 // occurred in. |
| 278 ServiceWorkerMetrics::StartSituation worker_start_situation_ = |
| 279 ServiceWorkerMetrics::StartSituation::UNKNOWN; |
| 280 |
| 281 // True if navigation preload was enabled. |
| 282 bool did_navigation_preload_ = false; |
| 283 |
| 284 // True if navigation preload metrics were reported. |
| 285 bool reported_navigation_preload_metrics_ = false; |
| 286 |
| 250 ResponseType response_type_; | 287 ResponseType response_type_; |
| 288 |
| 289 // True if URLRequestJob::Start() has been called. |
| 251 bool is_started_; | 290 bool is_started_; |
| 252 | 291 |
| 253 net::HttpByteRange byte_range_; | 292 net::HttpByteRange byte_range_; |
| 254 std::unique_ptr<net::HttpResponseInfo> range_response_info_; | 293 std::unique_ptr<net::HttpResponseInfo> range_response_info_; |
| 255 std::unique_ptr<net::HttpResponseInfo> http_response_info_; | 294 std::unique_ptr<net::HttpResponseInfo> http_response_info_; |
| 256 // Headers that have not yet been committed to |http_response_info_|. | 295 // Headers that have not yet been committed to |http_response_info_|. |
| 257 scoped_refptr<net::HttpResponseHeaders> http_response_headers_; | 296 scoped_refptr<net::HttpResponseHeaders> http_response_headers_; |
| 258 std::vector<GURL> response_url_list_; | 297 std::vector<GURL> response_url_list_; |
| 259 blink::WebServiceWorkerResponseType service_worker_response_type_; | 298 blink::WebServiceWorkerResponseType service_worker_response_type_; |
| 260 | 299 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 284 ResponseBodyType response_body_type_ = UNKNOWN; | 323 ResponseBodyType response_body_type_ = UNKNOWN; |
| 285 bool did_record_result_ = false; | 324 bool did_record_result_ = false; |
| 286 | 325 |
| 287 bool response_is_in_cache_storage_ = false; | 326 bool response_is_in_cache_storage_ = false; |
| 288 std::string response_cache_storage_cache_name_; | 327 std::string response_cache_storage_cache_name_; |
| 289 | 328 |
| 290 ServiceWorkerHeaderList cors_exposed_header_names_; | 329 ServiceWorkerHeaderList cors_exposed_header_names_; |
| 291 | 330 |
| 292 std::unique_ptr<FileSizeResolver> file_size_resolver_; | 331 std::unique_ptr<FileSizeResolver> file_size_resolver_; |
| 293 | 332 |
| 294 bool worker_already_activated_ = false; | |
| 295 EmbeddedWorkerStatus initial_worker_status_ = EmbeddedWorkerStatus::STOPPED; | |
| 296 bool did_navigation_preload_ = false; | |
| 297 | |
| 298 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 333 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
| 299 | 334 |
| 300 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 335 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
| 301 }; | 336 }; |
| 302 | 337 |
| 303 } // namespace content | 338 } // namespace content |
| 304 | 339 |
| 305 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 340 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| OLD | NEW |