| 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 OnUploadProgress(int64_t current_position, |
| 85 int64_t total_size, |
| 86 const base::Closure& ack_callback) override { |
| 87 client_->OnUploadProgress(current_position, total_size, ack_callback); |
| 88 } |
| 84 void OnReceiveResponse( | 89 void OnReceiveResponse( |
| 85 const ResourceResponseHead& head, | 90 const ResourceResponseHead& head, |
| 86 mojom::DownloadedTempFilePtr downloaded_file) override { | 91 mojom::DownloadedTempFilePtr downloaded_file) override { |
| 87 client_->OnReceiveResponse(head, std::move(downloaded_file)); | 92 client_->OnReceiveResponse(head, std::move(downloaded_file)); |
| 88 } | 93 } |
| 89 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, | 94 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, |
| 90 const ResourceResponseHead& head) override { | 95 const ResourceResponseHead& head) override { |
| 91 client_->OnReceiveRedirect(redirect_info, head); | 96 client_->OnReceiveRedirect(redirect_info, head); |
| 92 } | 97 } |
| 93 void OnStartLoadingResponseBody( | 98 void OnStartLoadingResponseBody( |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 } | 471 } |
| 467 | 472 |
| 468 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() | 473 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() |
| 469 const { | 474 const { |
| 470 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) | 475 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) |
| 471 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; | 476 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; |
| 472 return ResourceTypeToEventType(resource_type_); | 477 return ResourceTypeToEventType(resource_type_); |
| 473 } | 478 } |
| 474 | 479 |
| 475 } // namespace content | 480 } // namespace content |
| OLD | NEW |