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 #include "content/browser/service_worker/service_worker_url_request_job.h" | 5 #include "content/browser/service_worker/service_worker_url_request_job.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/guid.h" | 12 #include "base/guid.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" | 14 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" |
15 #include "content/browser/service_worker/service_worker_provider_host.h" | 15 #include "content/browser/service_worker/service_worker_provider_host.h" |
16 #include "content/common/resource_request_body.h" | 16 #include "content/common/resource_request_body.h" |
17 #include "content/common/service_worker/service_worker_types.h" | 17 #include "content/common/service_worker/service_worker_types.h" |
18 #include "content/public/browser/blob_handle.h" | 18 #include "content/public/browser/blob_handle.h" |
19 #include "content/public/browser/resource_request_info.h" | 19 #include "content/public/browser/resource_request_info.h" |
20 #include "content/public/common/page_transition_types.h" | 20 #include "content/public/common/page_transition_types.h" |
21 #include "net/http/http_request_headers.h" | 21 #include "net/http/http_request_headers.h" |
22 #include "net/http/http_response_headers.h" | 22 #include "net/http/http_response_headers.h" |
23 #include "net/http/http_response_info.h" | 23 #include "net/http/http_response_info.h" |
24 #include "net/http/http_util.h" | 24 #include "net/http/http_util.h" |
25 #include "webkit/browser/blob/blob_data_handle.h" | 25 #include "storage/browser/blob/blob_data_handle.h" |
26 #include "webkit/browser/blob/blob_storage_context.h" | 26 #include "storage/browser/blob/blob_storage_context.h" |
27 #include "webkit/browser/blob/blob_url_request_job_factory.h" | 27 #include "storage/browser/blob/blob_url_request_job_factory.h" |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 ServiceWorkerURLRequestJob::ServiceWorkerURLRequestJob( | 31 ServiceWorkerURLRequestJob::ServiceWorkerURLRequestJob( |
32 net::URLRequest* request, | 32 net::URLRequest* request, |
33 net::NetworkDelegate* network_delegate, | 33 net::NetworkDelegate* network_delegate, |
34 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 34 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
35 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 35 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
36 scoped_refptr<ResourceRequestBody> body) | 36 scoped_refptr<ResourceRequestBody> body) |
37 : net::URLRequestJob(request, network_delegate), | 37 : net::URLRequestJob(request, network_delegate), |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 void ServiceWorkerURLRequestJob::DeliverErrorResponse() { | 417 void ServiceWorkerURLRequestJob::DeliverErrorResponse() { |
418 // TODO(falken): Print an error to the console of the ServiceWorker and of | 418 // TODO(falken): Print an error to the console of the ServiceWorker and of |
419 // the requesting page. | 419 // the requesting page. |
420 CreateResponseHeader(500, | 420 CreateResponseHeader(500, |
421 "Service Worker Response Error", | 421 "Service Worker Response Error", |
422 std::map<std::string, std::string>()); | 422 std::map<std::string, std::string>()); |
423 CommitResponseHeader(); | 423 CommitResponseHeader(); |
424 } | 424 } |
425 | 425 |
426 } // namespace content | 426 } // namespace content |
OLD | NEW |