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