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 15 matching lines...) Expand all Loading... |
26 #include "net/http/http_byte_range.h" | 26 #include "net/http/http_byte_range.h" |
27 #include "net/url_request/url_request.h" | 27 #include "net/url_request/url_request.h" |
28 #include "net/url_request/url_request_job.h" | 28 #include "net/url_request/url_request_job.h" |
29 #include "net/url_request/url_request_status.h" | 29 #include "net/url_request/url_request_status.h" |
30 #include "storage/common/blob_storage/blob_storage_constants.h" | 30 #include "storage/common/blob_storage/blob_storage_constants.h" |
31 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponseType.h" | 31 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponseType.h" |
32 #include "url/gurl.h" | 32 #include "url/gurl.h" |
33 | 33 |
34 namespace net { | 34 namespace net { |
35 class IOBuffer; | 35 class IOBuffer; |
36 } | 36 } // namespace net |
37 | 37 |
38 namespace storage { | 38 namespace storage { |
39 class BlobDataHandle; | 39 class BlobDataHandle; |
40 class BlobStorageContext; | 40 class BlobStorageContext; |
41 } | 41 } // namespace storage |
42 | 42 |
43 namespace content { | 43 namespace content { |
44 | 44 |
45 class ResourceContext; | 45 class ResourceContext; |
46 class ResourceRequestBodyImpl; | 46 class ResourceRequestBodyImpl; |
47 class ServiceWorkerBlobReader; | 47 class ServiceWorkerBlobReader; |
48 class ServiceWorkerStreamReader; | 48 class ServiceWorkerStreamReader; |
49 class ServiceWorkerContextCore; | 49 class ServiceWorkerContextCore; |
50 class ServiceWorkerFetchDispatcher; | 50 class ServiceWorkerFetchDispatcher; |
51 class ServiceWorkerProviderHost; | 51 class ServiceWorkerProviderHost; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 88 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
89 const ResourceContext* resource_context, | 89 const ResourceContext* resource_context, |
90 FetchRequestMode request_mode, | 90 FetchRequestMode request_mode, |
91 FetchCredentialsMode credentials_mode, | 91 FetchCredentialsMode credentials_mode, |
92 FetchRedirectMode redirect_mode, | 92 FetchRedirectMode redirect_mode, |
93 ResourceType resource_type, | 93 ResourceType resource_type, |
94 RequestContextType request_context_type, | 94 RequestContextType request_context_type, |
95 RequestContextFrameType frame_type, | 95 RequestContextFrameType frame_type, |
96 scoped_refptr<ResourceRequestBodyImpl> body, | 96 scoped_refptr<ResourceRequestBodyImpl> body, |
97 ServiceWorkerFetchType fetch_type, | 97 ServiceWorkerFetchType fetch_type, |
| 98 const MojoURLLoaderFactoryGetter& url_loader_factory_getter, |
98 Delegate* delegate); | 99 Delegate* delegate); |
99 | 100 |
100 ~ServiceWorkerURLRequestJob() override; | 101 ~ServiceWorkerURLRequestJob() override; |
101 | 102 |
102 const ResourceContext* resource_context() const { return resource_context_; } | 103 const ResourceContext* resource_context() const { return resource_context_; } |
103 | 104 |
104 // Sets the response type. | 105 // Sets the response type. |
105 // When an in-flight request possibly needs CORS check, use | 106 // When an in-flight request possibly needs CORS check, use |
106 // FallbackToNetworkOrRenderer. This method will decide whether the request | 107 // FallbackToNetworkOrRenderer. This method will decide whether the request |
107 // can directly go to the network or should fallback to a renderer to send | 108 // can directly go to the network or should fallback to a renderer to send |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 bool response_is_in_cache_storage_ = false; | 278 bool response_is_in_cache_storage_ = false; |
278 std::string response_cache_storage_cache_name_; | 279 std::string response_cache_storage_cache_name_; |
279 | 280 |
280 ServiceWorkerHeaderList cors_exposed_header_names_; | 281 ServiceWorkerHeaderList cors_exposed_header_names_; |
281 | 282 |
282 std::unique_ptr<BlobConstructionWaiter> blob_construction_waiter_; | 283 std::unique_ptr<BlobConstructionWaiter> blob_construction_waiter_; |
283 | 284 |
284 bool worker_already_activated_ = false; | 285 bool worker_already_activated_ = false; |
285 EmbeddedWorkerStatus initial_worker_status_ = EmbeddedWorkerStatus::STOPPED; | 286 EmbeddedWorkerStatus initial_worker_status_ = EmbeddedWorkerStatus::STOPPED; |
286 | 287 |
| 288 const MojoURLLoaderFactoryGetter url_loader_factory_getter_; |
287 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 289 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
288 | 290 |
289 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 291 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
290 }; | 292 }; |
291 | 293 |
292 } // namespace content | 294 } // namespace content |
293 | 295 |
294 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 296 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
OLD | NEW |