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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 class BlobStorageContext; | 34 class BlobStorageContext; |
35 } | 35 } |
36 | 36 |
37 namespace content { | 37 namespace content { |
38 | 38 |
39 class ResourceContext; | 39 class ResourceContext; |
40 class ResourceRequestBody; | 40 class ResourceRequestBody; |
41 class ServiceWorkerContextCore; | 41 class ServiceWorkerContextCore; |
42 class ServiceWorkerFetchDispatcher; | 42 class ServiceWorkerFetchDispatcher; |
43 class ServiceWorkerProviderHost; | 43 class ServiceWorkerProviderHost; |
| 44 class ServiceWorkerVersion; |
44 class Stream; | 45 class Stream; |
45 | 46 |
46 class CONTENT_EXPORT ServiceWorkerURLRequestJob | 47 class CONTENT_EXPORT ServiceWorkerURLRequestJob |
47 : public net::URLRequestJob, | 48 : public net::URLRequestJob, |
48 public net::URLRequest::Delegate, | 49 public net::URLRequest::Delegate, |
49 public StreamReadObserver, | 50 public StreamReadObserver, |
50 public StreamRegisterObserver { | 51 public StreamRegisterObserver { |
51 public: | 52 public: |
52 ServiceWorkerURLRequestJob( | 53 ServiceWorkerURLRequestJob( |
53 net::URLRequest* request, | 54 net::URLRequest* request, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 const std::string& status_text, | 153 const std::string& status_text, |
153 const ServiceWorkerHeaderMap& headers); | 154 const ServiceWorkerHeaderMap& headers); |
154 | 155 |
155 // Creates |http_response_info_| using |http_response_headers_| and calls | 156 // Creates |http_response_info_| using |http_response_headers_| and calls |
156 // NotifyHeadersComplete. | 157 // NotifyHeadersComplete. |
157 void CommitResponseHeader(); | 158 void CommitResponseHeader(); |
158 | 159 |
159 // Creates and commits a response header indicating error. | 160 // Creates and commits a response header indicating error. |
160 void DeliverErrorResponse(); | 161 void DeliverErrorResponse(); |
161 | 162 |
| 163 // Releases the resources for streaming. |
| 164 void ClearStream(); |
| 165 |
162 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; | 166 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; |
163 | 167 |
164 // Timing info to show on the popup in Devtools' Network tab. | 168 // Timing info to show on the popup in Devtools' Network tab. |
165 net::LoadTimingInfo load_timing_info_; | 169 net::LoadTimingInfo load_timing_info_; |
166 base::TimeTicks fetch_start_time_; | 170 base::TimeTicks fetch_start_time_; |
167 base::TimeTicks fetch_ready_time_; | 171 base::TimeTicks fetch_ready_time_; |
168 base::TimeTicks fetch_end_time_; | 172 base::TimeTicks fetch_end_time_; |
169 base::Time response_time_; | 173 base::Time response_time_; |
170 | 174 |
171 ResponseType response_type_; | 175 ResponseType response_type_; |
(...skipping 19 matching lines...) Expand all Loading... |
191 | 195 |
192 FetchRequestMode request_mode_; | 196 FetchRequestMode request_mode_; |
193 FetchCredentialsMode credentials_mode_; | 197 FetchCredentialsMode credentials_mode_; |
194 RequestContextType request_context_type_; | 198 RequestContextType request_context_type_; |
195 RequestContextFrameType frame_type_; | 199 RequestContextFrameType frame_type_; |
196 bool fall_back_required_; | 200 bool fall_back_required_; |
197 // ResourceRequestBody has a collection of BlobDataHandles attached to it | 201 // ResourceRequestBody has a collection of BlobDataHandles attached to it |
198 // using the userdata mechanism. So we have to keep it not to free the blobs. | 202 // using the userdata mechanism. So we have to keep it not to free the blobs. |
199 scoped_refptr<ResourceRequestBody> body_; | 203 scoped_refptr<ResourceRequestBody> body_; |
200 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; | 204 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; |
| 205 scoped_refptr<ServiceWorkerVersion> streaming_version_; |
201 | 206 |
202 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 207 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
203 | 208 |
204 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 209 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
205 }; | 210 }; |
206 | 211 |
207 } // namespace content | 212 } // namespace content |
208 | 213 |
209 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 214 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
OLD | NEW |