| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_loader_job.h" | 5 #include "content/browser/service_worker/service_worker_url_loader_job.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "content/browser/blob_storage/blob_url_loader_factory.h" | 8 #include "content/browser/blob_storage/blob_url_loader_factory.h" |
| 9 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" | 9 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" |
| 10 #include "content/browser/service_worker/service_worker_version.h" | 10 #include "content/browser/service_worker/service_worker_version.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 CommitResponseHeaders(); | 285 CommitResponseHeaders(); |
| 286 url_loader_client_->OnStartLoadingResponseBody( | 286 url_loader_client_->OnStartLoadingResponseBody( |
| 287 std::move(body_as_stream->stream)); | 287 std::move(body_as_stream->stream)); |
| 288 CommitCompleted(net::OK); | 288 CommitCompleted(net::OK); |
| 289 return; | 289 return; |
| 290 } | 290 } |
| 291 | 291 |
| 292 if (!response.blob_uuid.empty() && blob_storage_context_) { | 292 if (!response.blob_uuid.empty() && blob_storage_context_) { |
| 293 std::unique_ptr<storage::BlobDataHandle> blob_data_handle = | 293 std::unique_ptr<storage::BlobDataHandle> blob_data_handle = |
| 294 blob_storage_context_->GetBlobDataFromUUID(response.blob_uuid); | 294 blob_storage_context_->GetBlobDataFromUUID(response.blob_uuid); |
| 295 mojom::URLLoaderAssociatedRequest request; | 295 mojom::URLLoaderRequest request; |
| 296 mojom::URLLoaderClientPtr client; | 296 mojom::URLLoaderClientPtr client; |
| 297 blob_client_binding_.Bind(mojo::MakeRequest(&client)); | 297 blob_client_binding_.Bind(mojo::MakeRequest(&client)); |
| 298 BlobURLLoaderFactory::CreateLoaderAndStart( | 298 BlobURLLoaderFactory::CreateLoaderAndStart( |
| 299 std::move(request), resource_request_, std::move(client), | 299 std::move(request), resource_request_, std::move(client), |
| 300 std::move(blob_data_handle), nullptr /* file_system_context */); | 300 std::move(blob_data_handle), nullptr /* file_system_context */); |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 // URLLoader implementation---------------------------------------- | 304 // URLLoader implementation---------------------------------------- |
| 305 | 305 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } | 360 } |
| 361 | 361 |
| 362 void ServiceWorkerURLLoaderJob::OnComplete( | 362 void ServiceWorkerURLLoaderJob::OnComplete( |
| 363 const ResourceRequestCompletionStatus& status) { | 363 const ResourceRequestCompletionStatus& status) { |
| 364 DCHECK_EQ(Status::kSentHeader, status_); | 364 DCHECK_EQ(Status::kSentHeader, status_); |
| 365 status_ = Status::kCompleted; | 365 status_ = Status::kCompleted; |
| 366 url_loader_client_->OnComplete(status); | 366 url_loader_client_->OnComplete(status); |
| 367 } | 367 } |
| 368 | 368 |
| 369 } // namespace content | 369 } // namespace content |
| OLD | NEW |