| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // wrapped client. | 75 // wrapped client. |
| 76 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient { | 76 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient { |
| 77 public: | 77 public: |
| 78 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) | 78 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) |
| 79 : binding_(this), client_(std::move(client)) {} | 79 : binding_(this), client_(std::move(client)) {} |
| 80 ~DelegatingURLLoaderClient() override {} | 80 ~DelegatingURLLoaderClient() override {} |
| 81 | 81 |
| 82 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { | 82 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { |
| 83 client_->OnDataDownloaded(data_length, encoded_length); | 83 client_->OnDataDownloaded(data_length, encoded_length); |
| 84 } | 84 } |
| 85 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override { |
| 86 client_->OnReceiveCachedMetadata(data); |
| 87 } |
| 85 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { | 88 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { |
| 86 client_->OnTransferSizeUpdated(transfer_size_diff); | 89 client_->OnTransferSizeUpdated(transfer_size_diff); |
| 87 } | 90 } |
| 88 void OnReceiveResponse( | 91 void OnReceiveResponse( |
| 89 const ResourceResponseHead& head, | 92 const ResourceResponseHead& head, |
| 90 mojom::DownloadedTempFilePtr downloaded_file) override { | 93 mojom::DownloadedTempFilePtr downloaded_file) override { |
| 91 client_->OnReceiveResponse(head, std::move(downloaded_file)); | 94 client_->OnReceiveResponse(head, std::move(downloaded_file)); |
| 92 } | 95 } |
| 93 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, | 96 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, |
| 94 const ResourceResponseHead& head) override { | 97 const ResourceResponseHead& head) override { |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 } | 485 } |
| 483 | 486 |
| 484 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() | 487 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() |
| 485 const { | 488 const { |
| 486 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) | 489 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) |
| 487 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; | 490 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; |
| 488 return ResourceTypeToEventType(resource_type_); | 491 return ResourceTypeToEventType(resource_type_); |
| 489 } | 492 } |
| 490 | 493 |
| 491 } // namespace content | 494 } // namespace content |
| OLD | NEW |