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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 //---------------------------------------------------------------------------- | 134 //---------------------------------------------------------------------------- |
135 // The following are intended for use by ServiceWorker(Blob|Stream)Reader. | 135 // The following are intended for use by ServiceWorker(Blob|Stream)Reader. |
136 void OnResponseStarted(); | 136 void OnResponseStarted(); |
137 void OnReadRawDataComplete(int bytes_read); | 137 void OnReadRawDataComplete(int bytes_read); |
138 void RecordResult(ServiceWorkerMetrics::URLRequestJobResult result); | 138 void RecordResult(ServiceWorkerMetrics::URLRequestJobResult result); |
139 //---------------------------------------------------------------------------- | 139 //---------------------------------------------------------------------------- |
140 | 140 |
141 base::WeakPtr<ServiceWorkerURLRequestJob> GetWeakPtr(); | 141 base::WeakPtr<ServiceWorkerURLRequestJob> GetWeakPtr(); |
142 | 142 |
143 private: | 143 private: |
144 class BlobConstructionWaiter; | 144 class FileSizeResolver; |
145 | 145 |
146 enum ResponseType { | 146 enum ResponseType { |
147 NOT_DETERMINED, | 147 NOT_DETERMINED, |
148 FALLBACK_TO_NETWORK, | 148 FALLBACK_TO_NETWORK, |
149 FALLBACK_TO_RENDERER, // Use this when falling back with CORS check | 149 FALLBACK_TO_RENDERER, // Use this when falling back with CORS check |
150 FORWARD_TO_SERVICE_WORKER, | 150 FORWARD_TO_SERVICE_WORKER, |
151 }; | 151 }; |
152 | 152 |
153 enum ResponseBodyType { | 153 enum ResponseBodyType { |
154 UNKNOWN, | 154 UNKNOWN, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 ServiceWorkerFetchType fetch_type_; | 270 ServiceWorkerFetchType fetch_type_; |
271 | 271 |
272 ResponseBodyType response_body_type_ = UNKNOWN; | 272 ResponseBodyType response_body_type_ = UNKNOWN; |
273 bool did_record_result_ = false; | 273 bool did_record_result_ = false; |
274 | 274 |
275 bool response_is_in_cache_storage_ = false; | 275 bool response_is_in_cache_storage_ = false; |
276 std::string response_cache_storage_cache_name_; | 276 std::string response_cache_storage_cache_name_; |
277 | 277 |
278 ServiceWorkerHeaderList cors_exposed_header_names_; | 278 ServiceWorkerHeaderList cors_exposed_header_names_; |
279 | 279 |
280 std::unique_ptr<BlobConstructionWaiter> blob_construction_waiter_; | 280 std::unique_ptr<FileSizeResolver> file_size_resolver_; |
281 | 281 |
282 bool worker_already_activated_ = false; | 282 bool worker_already_activated_ = false; |
283 EmbeddedWorkerStatus initial_worker_status_ = EmbeddedWorkerStatus::STOPPED; | 283 EmbeddedWorkerStatus initial_worker_status_ = EmbeddedWorkerStatus::STOPPED; |
284 | 284 |
285 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 285 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
286 | 286 |
287 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 287 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
288 }; | 288 }; |
289 | 289 |
290 } // namespace content | 290 } // namespace content |
291 | 291 |
292 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 292 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
OLD | NEW |