| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // wrapped client. | 74 // wrapped client. |
| 75 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient { | 75 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient { |
| 76 public: | 76 public: |
| 77 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) | 77 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) |
| 78 : binding_(this), client_(std::move(client)) {} | 78 : binding_(this), client_(std::move(client)) {} |
| 79 ~DelegatingURLLoaderClient() override {} | 79 ~DelegatingURLLoaderClient() override {} |
| 80 | 80 |
| 81 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { | 81 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { |
| 82 client_->OnDataDownloaded(data_length, encoded_length); | 82 client_->OnDataDownloaded(data_length, encoded_length); |
| 83 } | 83 } |
| 84 void OnTransferSizeUpdated(int64_t transfer_size_diff) override { |
| 85 client_->OnTransferSizeUpdated(transfer_size_diff); |
| 86 } |
| 84 void OnReceiveResponse( | 87 void OnReceiveResponse( |
| 85 const ResourceResponseHead& head, | 88 const ResourceResponseHead& head, |
| 86 mojom::DownloadedTempFilePtr downloaded_file) override { | 89 mojom::DownloadedTempFilePtr downloaded_file) override { |
| 87 client_->OnReceiveResponse(head, std::move(downloaded_file)); | 90 client_->OnReceiveResponse(head, std::move(downloaded_file)); |
| 88 } | 91 } |
| 89 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, | 92 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, |
| 90 const ResourceResponseHead& head) override { | 93 const ResourceResponseHead& head) override { |
| 91 client_->OnReceiveRedirect(redirect_info, head); | 94 client_->OnReceiveRedirect(redirect_info, head); |
| 92 } | 95 } |
| 93 void OnStartLoadingResponseBody( | 96 void OnStartLoadingResponseBody( |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 } | 469 } |
| 467 | 470 |
| 468 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() | 471 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() |
| 469 const { | 472 const { |
| 470 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) | 473 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) |
| 471 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; | 474 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; |
| 472 return ResourceTypeToEventType(resource_type_); | 475 return ResourceTypeToEventType(resource_type_); |
| 473 } | 476 } |
| 474 | 477 |
| 475 } // namespace content | 478 } // namespace content |
| OLD | NEW |