| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/foreign_fetch_request_handler.h" | 5 #include "content/browser/service_worker/foreign_fetch_request_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 11 #include "content/browser/service_worker/service_worker_response_info.h" | 11 #include "content/browser/service_worker/service_worker_response_info.h" |
| 12 #include "content/browser/service_worker/service_worker_url_request_job.h" | 12 #include "content/browser/service_worker/service_worker_url_request_job.h" |
| 13 #include "content/common/resource_request_body.h" | 13 #include "content/common/resource_request_body_impl.h" |
| 14 #include "content/common/service_worker/service_worker_utils.h" | 14 #include "content/common/service_worker/service_worker_utils.h" |
| 15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
| 16 #include "net/url_request/url_request_interceptor.h" | 16 #include "net/url_request/url_request_interceptor.h" |
| 17 #include "storage/browser/blob/blob_storage_context.h" | 17 #include "storage/browser/blob/blob_storage_context.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 int kUserDataKey; // Only address is used. | 23 int kUserDataKey; // Only address is used. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 51 storage::BlobStorageContext* blob_storage_context, | 51 storage::BlobStorageContext* blob_storage_context, |
| 52 int process_id, | 52 int process_id, |
| 53 int provider_id, | 53 int provider_id, |
| 54 bool skip_service_worker, | 54 bool skip_service_worker, |
| 55 FetchRequestMode request_mode, | 55 FetchRequestMode request_mode, |
| 56 FetchCredentialsMode credentials_mode, | 56 FetchCredentialsMode credentials_mode, |
| 57 FetchRedirectMode redirect_mode, | 57 FetchRedirectMode redirect_mode, |
| 58 ResourceType resource_type, | 58 ResourceType resource_type, |
| 59 RequestContextType request_context_type, | 59 RequestContextType request_context_type, |
| 60 RequestContextFrameType frame_type, | 60 RequestContextFrameType frame_type, |
| 61 scoped_refptr<ResourceRequestBody> body, | 61 scoped_refptr<ResourceRequestBodyImpl> body, |
| 62 bool initiated_in_secure_context) { | 62 bool initiated_in_secure_context) { |
| 63 if (!context_wrapper) { | 63 if (!context_wrapper) { |
| 64 return; | 64 return; |
| 65 } | 65 } |
| 66 | 66 |
| 67 if (!initiated_in_secure_context) | 67 if (!initiated_in_secure_context) |
| 68 return; | 68 return; |
| 69 | 69 |
| 70 if (!context_wrapper->OriginHasForeignFetchRegistrations( | 70 if (!context_wrapper->OriginHasForeignFetchRegistrations( |
| 71 request->url().GetOrigin())) { | 71 request->url().GetOrigin())) { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 ForeignFetchRequestHandler::ForeignFetchRequestHandler( | 151 ForeignFetchRequestHandler::ForeignFetchRequestHandler( |
| 152 ServiceWorkerContextWrapper* context, | 152 ServiceWorkerContextWrapper* context, |
| 153 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 153 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
| 154 FetchRequestMode request_mode, | 154 FetchRequestMode request_mode, |
| 155 FetchCredentialsMode credentials_mode, | 155 FetchCredentialsMode credentials_mode, |
| 156 FetchRedirectMode redirect_mode, | 156 FetchRedirectMode redirect_mode, |
| 157 ResourceType resource_type, | 157 ResourceType resource_type, |
| 158 RequestContextType request_context_type, | 158 RequestContextType request_context_type, |
| 159 RequestContextFrameType frame_type, | 159 RequestContextFrameType frame_type, |
| 160 scoped_refptr<ResourceRequestBody> body) | 160 scoped_refptr<ResourceRequestBodyImpl> body) |
| 161 : context_(context), | 161 : context_(context), |
| 162 blob_storage_context_(blob_storage_context), | 162 blob_storage_context_(blob_storage_context), |
| 163 resource_type_(resource_type), | 163 resource_type_(resource_type), |
| 164 request_mode_(request_mode), | 164 request_mode_(request_mode), |
| 165 credentials_mode_(credentials_mode), | 165 credentials_mode_(credentials_mode), |
| 166 redirect_mode_(redirect_mode), | 166 redirect_mode_(redirect_mode), |
| 167 request_context_type_(request_context_type), | 167 request_context_type_(request_context_type), |
| 168 frame_type_(frame_type), | 168 frame_type_(frame_type), |
| 169 body_(body), | 169 body_(body), |
| 170 weak_factory_(this) {} | 170 weak_factory_(this) {} |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 226 } |
| 227 return target_worker_.get(); | 227 return target_worker_.get(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void ForeignFetchRequestHandler::ClearJob() { | 230 void ForeignFetchRequestHandler::ClearJob() { |
| 231 job_.reset(); | 231 job_.reset(); |
| 232 target_worker_ = nullptr; | 232 target_worker_ = nullptr; |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace content | 235 } // namespace content |
| OLD | NEW |