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 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // We can't do anything other than to fall back to network. | 173 // We can't do anything other than to fall back to network. |
174 std::move(callback).Run(StartLoaderCallback()); | 174 std::move(callback).Run(StartLoaderCallback()); |
175 return; | 175 return; |
176 } | 176 } |
177 | 177 |
178 // In fallback cases we basically 'forward' the request, so we should | 178 // In fallback cases we basically 'forward' the request, so we should |
179 // never see use_network_ gets true. | 179 // never see use_network_ gets true. |
180 DCHECK(!use_network_); | 180 DCHECK(!use_network_); |
181 | 181 |
182 url_job_ = base::MakeUnique<ServiceWorkerURLJobWrapper>( | 182 url_job_ = base::MakeUnique<ServiceWorkerURLJobWrapper>( |
183 std::move(callback), this, resource_request, blob_storage_context_); | 183 base::MakeUnique<ServiceWorkerURLLoaderJob>( |
| 184 std::move(callback), this, resource_request, blob_storage_context_)); |
184 | 185 |
185 resource_context_ = resource_context; | 186 resource_context_ = resource_context; |
186 | 187 |
187 PrepareForMainResource(resource_request.url, | 188 PrepareForMainResource(resource_request.url, |
188 resource_request.first_party_for_cookies); | 189 resource_request.first_party_for_cookies); |
189 | 190 |
190 if (url_job_->ShouldFallbackToNetwork()) { | 191 if (url_job_->ShouldFallbackToNetwork()) { |
191 // We're falling back to the next URLLoaderRequestHandler, forward | 192 // We're falling back to the next URLLoaderRequestHandler, forward |
192 // the request and clear job now. | 193 // the request and clear job now. |
193 url_job_->FallbackToNetwork(); | 194 url_job_->FallbackToNetwork(); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 | 499 |
499 void ServiceWorkerControlleeRequestHandler::ClearJob() { | 500 void ServiceWorkerControlleeRequestHandler::ClearJob() { |
500 url_job_.reset(); | 501 url_job_.reset(); |
501 } | 502 } |
502 | 503 |
503 bool ServiceWorkerControlleeRequestHandler::JobWasCanceled() const { | 504 bool ServiceWorkerControlleeRequestHandler::JobWasCanceled() const { |
504 return !url_job_ || url_job_->WasCanceled(); | 505 return !url_job_ || url_job_->WasCanceled(); |
505 } | 506 } |
506 | 507 |
507 } // namespace content | 508 } // namespace content |
OLD | NEW |