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

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

Issue 2629513003: Implement CachedMetadata handling on MojoAsyncResourceHandler (Closed)
Patch Set: rebase Created 3 years, 11 months 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // wrapped client. 75 // wrapped client.
76 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient { 76 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient {
77 public: 77 public:
78 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) 78 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client)
79 : binding_(this), client_(std::move(client)) {} 79 : binding_(this), client_(std::move(client)) {}
80 ~DelegatingURLLoaderClient() override {} 80 ~DelegatingURLLoaderClient() override {}
81 81
82 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { 82 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override {
83 client_->OnDataDownloaded(data_length, encoded_length); 83 client_->OnDataDownloaded(data_length, encoded_length);
84 } 84 }
85 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override {
86 client_->OnReceiveCachedMetadata(data);
87 }
85 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { 88 void OnTransferSizeUpdated(int32_t transfer_size_diff) override {
86 client_->OnTransferSizeUpdated(transfer_size_diff); 89 client_->OnTransferSizeUpdated(transfer_size_diff);
87 } 90 }
88 void OnReceiveResponse( 91 void OnReceiveResponse(
89 const ResourceResponseHead& head, 92 const ResourceResponseHead& head,
90 mojom::DownloadedTempFilePtr downloaded_file) override { 93 mojom::DownloadedTempFilePtr downloaded_file) override {
91 client_->OnReceiveResponse(head, std::move(downloaded_file)); 94 client_->OnReceiveResponse(head, std::move(downloaded_file));
92 } 95 }
93 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, 96 void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
94 const ResourceResponseHead& head) override { 97 const ResourceResponseHead& head) override {
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 } 485 }
483 486
484 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() 487 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType()
485 const { 488 const {
486 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) 489 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH)
487 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; 490 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH;
488 return ResourceTypeToEventType(resource_type_); 491 return ResourceTypeToEventType(resource_type_);
489 } 492 }
490 493
491 } // namespace content 494 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698