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_controllee_request_handl
er.h" | 5 #include "content/browser/service_worker/service_worker_controllee_request_handl
er.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
12 #include "content/browser/service_worker/service_worker_context_core.h" | 12 #include "content/browser/service_worker/service_worker_context_core.h" |
13 #include "content/browser/service_worker/service_worker_metrics.h" | 13 #include "content/browser/service_worker/service_worker_metrics.h" |
14 #include "content/browser/service_worker/service_worker_provider_host.h" | 14 #include "content/browser/service_worker/service_worker_provider_host.h" |
15 #include "content/browser/service_worker/service_worker_registration.h" | 15 #include "content/browser/service_worker/service_worker_registration.h" |
16 #include "content/browser/service_worker/service_worker_response_info.h" | 16 #include "content/browser/service_worker/service_worker_response_info.h" |
17 #include "content/browser/service_worker/service_worker_url_job_wrapper.h" | 17 #include "content/browser/service_worker/service_worker_url_job_wrapper.h" |
18 #include "content/browser/service_worker/service_worker_url_request_job.h" | 18 #include "content/browser/service_worker/service_worker_url_request_job.h" |
19 #include "content/common/resource_request_body_impl.h" | |
20 #include "content/common/service_worker/service_worker_types.h" | 19 #include "content/common/service_worker/service_worker_types.h" |
21 #include "content/common/service_worker/service_worker_utils.h" | 20 #include "content/common/service_worker/service_worker_utils.h" |
22 #include "content/public/browser/content_browser_client.h" | 21 #include "content/public/browser/content_browser_client.h" |
23 #include "content/public/browser/render_frame_host.h" | 22 #include "content/public/browser/render_frame_host.h" |
24 #include "content/public/browser/resource_request_info.h" | 23 #include "content/public/browser/resource_request_info.h" |
25 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
26 #include "content/public/common/browser_side_navigation_policy.h" | 25 #include "content/public/common/browser_side_navigation_policy.h" |
27 #include "content/public/common/content_client.h" | 26 #include "content/public/common/content_client.h" |
| 27 #include "content/public/common/resource_request_body.h" |
28 #include "content/public/common/resource_response_info.h" | 28 #include "content/public/common/resource_response_info.h" |
29 #include "net/base/load_flags.h" | 29 #include "net/base/load_flags.h" |
30 #include "net/base/url_util.h" | 30 #include "net/base/url_util.h" |
31 #include "net/url_request/url_request.h" | 31 #include "net/url_request/url_request.h" |
32 #include "ui/base/page_transition_types.h" | 32 #include "ui/base/page_transition_types.h" |
33 | 33 |
34 namespace content { | 34 namespace content { |
35 | 35 |
36 namespace { | 36 namespace { |
37 | 37 |
(...skipping 18 matching lines...) Expand all Loading... |
56 ServiceWorkerControlleeRequestHandler::ServiceWorkerControlleeRequestHandler( | 56 ServiceWorkerControlleeRequestHandler::ServiceWorkerControlleeRequestHandler( |
57 base::WeakPtr<ServiceWorkerContextCore> context, | 57 base::WeakPtr<ServiceWorkerContextCore> context, |
58 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 58 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
59 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 59 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
60 FetchRequestMode request_mode, | 60 FetchRequestMode request_mode, |
61 FetchCredentialsMode credentials_mode, | 61 FetchCredentialsMode credentials_mode, |
62 FetchRedirectMode redirect_mode, | 62 FetchRedirectMode redirect_mode, |
63 ResourceType resource_type, | 63 ResourceType resource_type, |
64 RequestContextType request_context_type, | 64 RequestContextType request_context_type, |
65 RequestContextFrameType frame_type, | 65 RequestContextFrameType frame_type, |
66 scoped_refptr<ResourceRequestBodyImpl> body) | 66 scoped_refptr<ResourceRequestBody> body) |
67 : ServiceWorkerRequestHandler(context, | 67 : ServiceWorkerRequestHandler(context, |
68 provider_host, | 68 provider_host, |
69 blob_storage_context, | 69 blob_storage_context, |
70 resource_type), | 70 resource_type), |
71 is_main_resource_load_( | 71 is_main_resource_load_( |
72 ServiceWorkerUtils::IsMainResourceType(resource_type)), | 72 ServiceWorkerUtils::IsMainResourceType(resource_type)), |
73 is_main_frame_load_(resource_type == RESOURCE_TYPE_MAIN_FRAME), | 73 is_main_frame_load_(resource_type == RESOURCE_TYPE_MAIN_FRAME), |
74 request_mode_(request_mode), | 74 request_mode_(request_mode), |
75 credentials_mode_(credentials_mode), | 75 credentials_mode_(credentials_mode), |
76 redirect_mode_(redirect_mode), | 76 redirect_mode_(redirect_mode), |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 497 |
498 void ServiceWorkerControlleeRequestHandler::ClearJob() { | 498 void ServiceWorkerControlleeRequestHandler::ClearJob() { |
499 url_job_.reset(); | 499 url_job_.reset(); |
500 } | 500 } |
501 | 501 |
502 bool ServiceWorkerControlleeRequestHandler::JobWasCanceled() const { | 502 bool ServiceWorkerControlleeRequestHandler::JobWasCanceled() const { |
503 return !url_job_ || url_job_->WasCanceled(); | 503 return !url_job_ || url_job_->WasCanceled(); |
504 } | 504 } |
505 | 505 |
506 } // namespace content | 506 } // namespace content |
OLD | NEW |