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