Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: content/browser/service_worker/service_worker_fetch_dispatcher.cc

Issue 2467833002: Implement redirect handling on MojoAsyncResourceHandler (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(const ResourceResponseHead& head) override { 84 void OnReceiveResponse(const ResourceResponseHead& head) override {
85 client_->OnReceiveResponse(head); 85 client_->OnReceiveResponse(head);
86 } 86 }
87 void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
88 const ResourceResponseHead& head) override {
89 client_->OnReceiveRedirect(redirect_info, head);
90 }
87 void OnStartLoadingResponseBody( 91 void OnStartLoadingResponseBody(
88 mojo::ScopedDataPipeConsumerHandle body) override { 92 mojo::ScopedDataPipeConsumerHandle body) override {
89 client_->OnStartLoadingResponseBody(std::move(body)); 93 client_->OnStartLoadingResponseBody(std::move(body));
90 } 94 }
91 void OnComplete( 95 void OnComplete(
92 const ResourceRequestCompletionStatus& completion_status) override { 96 const ResourceRequestCompletionStatus& completion_status) override {
93 client_->OnComplete(completion_status); 97 client_->OnComplete(completion_status);
94 } 98 }
95 99
96 void Bind(mojom::URLLoaderClientAssociatedPtrInfo* ptr_info, 100 void Bind(mojom::URLLoaderClientAssociatedPtrInfo* ptr_info,
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } 448 }
445 449
446 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() 450 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType()
447 const { 451 const {
448 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) 452 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH)
449 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; 453 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH;
450 return ResourceTypeToEventType(resource_type_); 454 return ResourceTypeToEventType(resource_type_);
451 } 455 }
452 456
453 } // namespace content 457 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_browsertest.cc ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698