| 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 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) | 74 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) |
| 75 : binding_(this), client_(std::move(client)) {} | 75 : binding_(this), client_(std::move(client)) {} |
| 76 ~DelegatingURLLoaderClient() override {} | 76 ~DelegatingURLLoaderClient() override {} |
| 77 | 77 |
| 78 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { | 78 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { |
| 79 client_->OnDataDownloaded(data_length, encoded_length); | 79 client_->OnDataDownloaded(data_length, encoded_length); |
| 80 } | 80 } |
| 81 void OnReceiveResponse(const ResourceResponseHead& head) override { | 81 void OnReceiveResponse(const ResourceResponseHead& head) override { |
| 82 client_->OnReceiveResponse(head); | 82 client_->OnReceiveResponse(head); |
| 83 } | 83 } |
| 84 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, |
| 85 const ResourceResponseHead& head) override { |
| 86 client_->OnReceiveRedirect(redirect_info, head); |
| 87 } |
| 84 void OnStartLoadingResponseBody( | 88 void OnStartLoadingResponseBody( |
| 85 mojo::ScopedDataPipeConsumerHandle body) override { | 89 mojo::ScopedDataPipeConsumerHandle body) override { |
| 86 client_->OnStartLoadingResponseBody(std::move(body)); | 90 client_->OnStartLoadingResponseBody(std::move(body)); |
| 87 } | 91 } |
| 88 void OnComplete( | 92 void OnComplete( |
| 89 const ResourceRequestCompletionStatus& completion_status) override { | 93 const ResourceRequestCompletionStatus& completion_status) override { |
| 90 client_->OnComplete(completion_status); | 94 client_->OnComplete(completion_status); |
| 91 } | 95 } |
| 92 | 96 |
| 93 void Bind(mojom::URLLoaderClientAssociatedPtrInfo* ptr_info, | 97 void Bind(mojom::URLLoaderClientAssociatedPtrInfo* ptr_info, |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 } | 445 } |
| 442 | 446 |
| 443 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() | 447 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() |
| 444 const { | 448 const { |
| 445 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) | 449 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) |
| 446 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; | 450 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; |
| 447 return ResourceTypeToEventType(resource_type_); | 451 return ResourceTypeToEventType(resource_type_); |
| 448 } | 452 } |
| 449 | 453 |
| 450 } // namespace content | 454 } // namespace content |
| OLD | NEW |