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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } // namespace net | 42 } // namespace net |
43 | 43 |
44 namespace storage { | 44 namespace storage { |
45 class BlobDataHandle; | 45 class BlobDataHandle; |
46 class BlobStorageContext; | 46 class BlobStorageContext; |
47 } // namespace storage | 47 } // namespace storage |
48 | 48 |
49 namespace content { | 49 namespace content { |
50 | 50 |
51 class ResourceContext; | 51 class ResourceContext; |
52 class ResourceRequestBodyImpl; | 52 class ResourceRequestBody; |
53 class ServiceWorkerBlobReader; | 53 class ServiceWorkerBlobReader; |
54 class ServiceWorkerDataPipeReader; | 54 class ServiceWorkerDataPipeReader; |
55 class ServiceWorkerFetchDispatcher; | 55 class ServiceWorkerFetchDispatcher; |
56 class ServiceWorkerVersion; | 56 class ServiceWorkerVersion; |
57 | 57 |
58 class CONTENT_EXPORT ServiceWorkerURLRequestJob : public net::URLRequestJob { | 58 class CONTENT_EXPORT ServiceWorkerURLRequestJob : public net::URLRequestJob { |
59 public: | 59 public: |
60 using Delegate = ServiceWorkerURLJobWrapper::Delegate; | 60 using Delegate = ServiceWorkerURLJobWrapper::Delegate; |
61 | 61 |
62 ServiceWorkerURLRequestJob( | 62 ServiceWorkerURLRequestJob( |
63 net::URLRequest* request, | 63 net::URLRequest* request, |
64 net::NetworkDelegate* network_delegate, | 64 net::NetworkDelegate* network_delegate, |
65 const std::string& client_id, | 65 const std::string& client_id, |
66 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 66 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
67 const ResourceContext* resource_context, | 67 const ResourceContext* resource_context, |
68 FetchRequestMode request_mode, | 68 FetchRequestMode request_mode, |
69 FetchCredentialsMode credentials_mode, | 69 FetchCredentialsMode credentials_mode, |
70 FetchRedirectMode redirect_mode, | 70 FetchRedirectMode redirect_mode, |
71 ResourceType resource_type, | 71 ResourceType resource_type, |
72 RequestContextType request_context_type, | 72 RequestContextType request_context_type, |
73 RequestContextFrameType frame_type, | 73 RequestContextFrameType frame_type, |
74 scoped_refptr<ResourceRequestBodyImpl> body, | 74 scoped_refptr<ResourceRequestBody> body, |
75 ServiceWorkerFetchType fetch_type, | 75 ServiceWorkerFetchType fetch_type, |
76 const base::Optional<base::TimeDelta>& timeout, | 76 const base::Optional<base::TimeDelta>& timeout, |
77 Delegate* delegate); | 77 Delegate* delegate); |
78 | 78 |
79 ~ServiceWorkerURLRequestJob() override; | 79 ~ServiceWorkerURLRequestJob() override; |
80 | 80 |
81 const ResourceContext* resource_context() const { return resource_context_; } | 81 const ResourceContext* resource_context() const { return resource_context_; } |
82 bool did_navigation_preload() const { return did_navigation_preload_; } | 82 bool did_navigation_preload() const { return did_navigation_preload_; } |
83 | 83 |
84 // When set, this job will pretend that navigation preload was triggered, but | 84 // When set, this job will pretend that navigation preload was triggered, but |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 299 |
300 FetchRequestMode request_mode_; | 300 FetchRequestMode request_mode_; |
301 FetchCredentialsMode credentials_mode_; | 301 FetchCredentialsMode credentials_mode_; |
302 FetchRedirectMode redirect_mode_; | 302 FetchRedirectMode redirect_mode_; |
303 const ResourceType resource_type_; | 303 const ResourceType resource_type_; |
304 RequestContextType request_context_type_; | 304 RequestContextType request_context_type_; |
305 RequestContextFrameType frame_type_; | 305 RequestContextFrameType frame_type_; |
306 bool fall_back_required_; | 306 bool fall_back_required_; |
307 // ResourceRequestBody has a collection of BlobDataHandles attached to it | 307 // ResourceRequestBody has a collection of BlobDataHandles attached to it |
308 // using the userdata mechanism. So we have to keep it not to free the blobs. | 308 // using the userdata mechanism. So we have to keep it not to free the blobs. |
309 scoped_refptr<ResourceRequestBodyImpl> body_; | 309 scoped_refptr<ResourceRequestBody> body_; |
310 std::unique_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; | 310 std::unique_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; |
311 ServiceWorkerFetchType fetch_type_; | 311 ServiceWorkerFetchType fetch_type_; |
312 base::Optional<base::TimeDelta> timeout_; | 312 base::Optional<base::TimeDelta> timeout_; |
313 | 313 |
314 ResponseBodyType response_body_type_ = UNKNOWN; | 314 ResponseBodyType response_body_type_ = UNKNOWN; |
315 bool did_record_result_ = false; | 315 bool did_record_result_ = false; |
316 | 316 |
317 bool response_is_in_cache_storage_ = false; | 317 bool response_is_in_cache_storage_ = false; |
318 std::string response_cache_storage_cache_name_; | 318 std::string response_cache_storage_cache_name_; |
319 | 319 |
320 ServiceWorkerHeaderList cors_exposed_header_names_; | 320 ServiceWorkerHeaderList cors_exposed_header_names_; |
321 | 321 |
322 std::unique_ptr<FileSizeResolver> file_size_resolver_; | 322 std::unique_ptr<FileSizeResolver> file_size_resolver_; |
323 | 323 |
324 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 324 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
325 | 325 |
326 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 326 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
327 }; | 327 }; |
328 | 328 |
329 } // namespace content | 329 } // namespace content |
330 | 330 |
331 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 331 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
OLD | NEW |