| 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_fetch_dispatcher.h" | 5 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // wrapped client. | 73 // wrapped client. |
| 74 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient { | 74 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient { |
| 75 public: | 75 public: |
| 76 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) | 76 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) |
| 77 : binding_(this), client_(std::move(client)) {} | 77 : binding_(this), client_(std::move(client)) {} |
| 78 ~DelegatingURLLoaderClient() override {} | 78 ~DelegatingURLLoaderClient() override {} |
| 79 | 79 |
| 80 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { | 80 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { |
| 81 client_->OnDataDownloaded(data_length, encoded_length); | 81 client_->OnDataDownloaded(data_length, encoded_length); |
| 82 } | 82 } |
| 83 void OnUploadProgress(int64_t current_position, |
| 84 int64_t total_size, |
| 85 const base::Closure& ack_callback) override { |
| 86 client_->OnUploadProgress(current_position, total_size, ack_callback); |
| 87 } |
| 83 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override { | 88 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override { |
| 84 client_->OnReceiveCachedMetadata(data); | 89 client_->OnReceiveCachedMetadata(data); |
| 85 } | 90 } |
| 86 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { | 91 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { |
| 87 client_->OnTransferSizeUpdated(transfer_size_diff); | 92 client_->OnTransferSizeUpdated(transfer_size_diff); |
| 88 } | 93 } |
| 89 void OnReceiveResponse( | 94 void OnReceiveResponse( |
| 90 const ResourceResponseHead& head, | 95 const ResourceResponseHead& head, |
| 91 mojom::DownloadedTempFilePtr downloaded_file) override { | 96 mojom::DownloadedTempFilePtr downloaded_file) override { |
| 92 client_->OnReceiveResponse(head, std::move(downloaded_file)); | 97 client_->OnReceiveResponse(head, std::move(downloaded_file)); |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 } | 482 } |
| 478 | 483 |
| 479 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() | 484 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() |
| 480 const { | 485 const { |
| 481 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) | 486 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) |
| 482 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; | 487 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; |
| 483 return ResourceTypeToEventType(resource_type_); | 488 return ResourceTypeToEventType(resource_type_); |
| 484 } | 489 } |
| 485 | 490 |
| 486 } // namespace content | 491 } // namespace content |
| OLD | NEW |