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

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

Issue 2503813002: Fix and refactor downloaded file handling in the loading stack (Closed)
Patch Set: move to dtor Created 4 years 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
« no previous file with comments | « content/browser/loader/test_url_loader_client.cc ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 OnReceiveResponse(const ResourceResponseHead& head) override { 84 void OnReceiveResponse(
85 client_->OnReceiveResponse(head); 85 const ResourceResponseHead& head,
86 mojom::DownloadedTempFilePtr downloaded_file) override {
87 client_->OnReceiveResponse(head, std::move(downloaded_file));
86 } 88 }
87 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, 89 void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
88 const ResourceResponseHead& head) override { 90 const ResourceResponseHead& head) override {
89 client_->OnReceiveRedirect(redirect_info, head); 91 client_->OnReceiveRedirect(redirect_info, head);
90 } 92 }
91 void OnStartLoadingResponseBody( 93 void OnStartLoadingResponseBody(
92 mojo::ScopedDataPipeConsumerHandle body) override { 94 mojo::ScopedDataPipeConsumerHandle body) override {
93 client_->OnStartLoadingResponseBody(std::move(body)); 95 client_->OnStartLoadingResponseBody(std::move(body));
94 } 96 }
95 void OnComplete( 97 void OnComplete(
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 450 }
449 451
450 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() 452 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType()
451 const { 453 const {
452 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) 454 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH)
453 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; 455 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH;
454 return ResourceTypeToEventType(resource_type_); 456 return ResourceTypeToEventType(resource_type_);
455 } 457 }
456 458
457 } // namespace content 459 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/test_url_loader_client.cc ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698