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 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 namespace storage { | 38 namespace storage { |
39 class BlobDataHandle; | 39 class BlobDataHandle; |
40 class BlobStorageContext; | 40 class BlobStorageContext; |
41 } | 41 } |
42 | 42 |
43 namespace content { | 43 namespace content { |
44 | 44 |
45 class ResourceContext; | 45 class ResourceContext; |
46 class ResourceRequestBody; | 46 class ResourceRequestBodyImpl; |
47 class ServiceWorkerContextCore; | 47 class ServiceWorkerContextCore; |
48 class ServiceWorkerFetchDispatcher; | 48 class ServiceWorkerFetchDispatcher; |
49 class ServiceWorkerProviderHost; | 49 class ServiceWorkerProviderHost; |
50 class ServiceWorkerVersion; | 50 class ServiceWorkerVersion; |
51 class Stream; | 51 class Stream; |
52 | 52 |
53 class CONTENT_EXPORT ServiceWorkerURLRequestJob | 53 class CONTENT_EXPORT ServiceWorkerURLRequestJob |
54 : public net::URLRequestJob, | 54 : public net::URLRequestJob, |
55 public net::URLRequest::Delegate, | 55 public net::URLRequest::Delegate, |
56 public StreamReadObserver, | 56 public StreamReadObserver, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 net::NetworkDelegate* network_delegate, | 88 net::NetworkDelegate* network_delegate, |
89 const std::string& client_id, | 89 const std::string& client_id, |
90 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 90 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
91 const ResourceContext* resource_context, | 91 const ResourceContext* resource_context, |
92 FetchRequestMode request_mode, | 92 FetchRequestMode request_mode, |
93 FetchCredentialsMode credentials_mode, | 93 FetchCredentialsMode credentials_mode, |
94 FetchRedirectMode redirect_mode, | 94 FetchRedirectMode redirect_mode, |
95 ResourceType resource_type, | 95 ResourceType resource_type, |
96 RequestContextType request_context_type, | 96 RequestContextType request_context_type, |
97 RequestContextFrameType frame_type, | 97 RequestContextFrameType frame_type, |
98 scoped_refptr<ResourceRequestBody> body, | 98 scoped_refptr<ResourceRequestBodyImpl> body, |
99 ServiceWorkerFetchType fetch_type, | 99 ServiceWorkerFetchType fetch_type, |
100 Delegate* delegate); | 100 Delegate* delegate); |
101 | 101 |
102 ~ServiceWorkerURLRequestJob() override; | 102 ~ServiceWorkerURLRequestJob() override; |
103 | 103 |
104 // Sets the response type. | 104 // Sets the response type. |
105 void FallbackToNetwork(); | 105 void FallbackToNetwork(); |
106 void ForwardToServiceWorker(); | 106 void ForwardToServiceWorker(); |
107 | 107 |
108 bool ShouldFallbackToNetwork() const { | 108 bool ShouldFallbackToNetwork() const { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 FetchRequestMode request_mode_; | 259 FetchRequestMode request_mode_; |
260 FetchCredentialsMode credentials_mode_; | 260 FetchCredentialsMode credentials_mode_; |
261 FetchRedirectMode redirect_mode_; | 261 FetchRedirectMode redirect_mode_; |
262 const ResourceType resource_type_; | 262 const ResourceType resource_type_; |
263 RequestContextType request_context_type_; | 263 RequestContextType request_context_type_; |
264 RequestContextFrameType frame_type_; | 264 RequestContextFrameType frame_type_; |
265 bool fall_back_required_; | 265 bool fall_back_required_; |
266 // ResourceRequestBody has a collection of BlobDataHandles attached to it | 266 // ResourceRequestBody has a collection of BlobDataHandles attached to it |
267 // using the userdata mechanism. So we have to keep it not to free the blobs. | 267 // using the userdata mechanism. So we have to keep it not to free the blobs. |
268 scoped_refptr<ResourceRequestBody> body_; | 268 scoped_refptr<ResourceRequestBodyImpl> body_; |
269 std::unique_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; | 269 std::unique_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; |
270 scoped_refptr<ServiceWorkerVersion> streaming_version_; | 270 scoped_refptr<ServiceWorkerVersion> streaming_version_; |
271 ServiceWorkerFetchType fetch_type_; | 271 ServiceWorkerFetchType fetch_type_; |
272 | 272 |
273 ResponseBodyType response_body_type_ = UNKNOWN; | 273 ResponseBodyType response_body_type_ = UNKNOWN; |
274 bool did_record_result_ = false; | 274 bool did_record_result_ = false; |
275 | 275 |
276 bool response_is_in_cache_storage_ = false; | 276 bool response_is_in_cache_storage_ = false; |
277 std::string response_cache_storage_cache_name_; | 277 std::string response_cache_storage_cache_name_; |
278 | 278 |
279 ServiceWorkerHeaderList cors_exposed_header_names_; | 279 ServiceWorkerHeaderList cors_exposed_header_names_; |
280 | 280 |
281 std::unique_ptr<BlobConstructionWaiter> blob_construction_waiter_; | 281 std::unique_ptr<BlobConstructionWaiter> blob_construction_waiter_; |
282 | 282 |
283 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 283 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
284 | 284 |
285 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 285 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
286 }; | 286 }; |
287 | 287 |
288 } // namespace content | 288 } // namespace content |
289 | 289 |
290 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 290 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
OLD | NEW |