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

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

Issue 2629513003: Implement CachedMetadata handling on MojoAsyncResourceHandler (Closed)
Patch Set: fix 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
« no previous file with comments | « content/browser/loader/test_url_loader_client.cc ('k') | content/child/test_request_peer.h » ('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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // wrapped client. 73 // wrapped client.
74 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient { 74 class DelegatingURLLoaderClient final : public mojom::URLLoaderClient {
75 public: 75 public:
76 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client) 76 explicit DelegatingURLLoaderClient(mojom::URLLoaderClientPtr client)
77 : binding_(this), client_(std::move(client)) {} 77 : binding_(this), client_(std::move(client)) {}
78 ~DelegatingURLLoaderClient() override {} 78 ~DelegatingURLLoaderClient() override {}
79 79
80 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { 80 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override {
81 client_->OnDataDownloaded(data_length, encoded_length); 81 client_->OnDataDownloaded(data_length, encoded_length);
82 } 82 }
83 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override {
84 client_->OnReceiveCachedMetadata(data);
85 }
83 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { 86 void OnTransferSizeUpdated(int32_t transfer_size_diff) override {
84 client_->OnTransferSizeUpdated(transfer_size_diff); 87 client_->OnTransferSizeUpdated(transfer_size_diff);
85 } 88 }
86 void OnReceiveResponse( 89 void OnReceiveResponse(
87 const ResourceResponseHead& head, 90 const ResourceResponseHead& head,
88 mojom::DownloadedTempFilePtr downloaded_file) override { 91 mojom::DownloadedTempFilePtr downloaded_file) override {
89 client_->OnReceiveResponse(head, std::move(downloaded_file)); 92 client_->OnReceiveResponse(head, std::move(downloaded_file));
90 } 93 }
91 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, 94 void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
92 const ResourceResponseHead& head) override { 95 const ResourceResponseHead& head) override {
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 } 484 }
482 485
483 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() 486 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType()
484 const { 487 const {
485 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) 488 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH)
486 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; 489 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH;
487 return ResourceTypeToEventType(resource_type_); 490 return ResourceTypeToEventType(resource_type_);
488 } 491 }
489 492
490 } // namespace content 493 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/test_url_loader_client.cc ('k') | content/child/test_request_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698