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

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

Issue 2574143003: Implement upload progress handling in Mojo loading (Closed)
Patch Set: android build 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
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 OnUploadProgress(int64_t current_position,
84 int64_t total_size,
85 const base::Closure& ack_callback) override {
86 client_->OnUploadProgress(current_position, total_size, ack_callback);
87 }
83 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override { 88 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override {
84 client_->OnReceiveCachedMetadata(data); 89 client_->OnReceiveCachedMetadata(data);
85 } 90 }
86 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { 91 void OnTransferSizeUpdated(int32_t transfer_size_diff) override {
87 client_->OnTransferSizeUpdated(transfer_size_diff); 92 client_->OnTransferSizeUpdated(transfer_size_diff);
88 } 93 }
89 void OnReceiveResponse( 94 void OnReceiveResponse(
90 const ResourceResponseHead& head, 95 const ResourceResponseHead& head,
91 mojom::DownloadedTempFilePtr downloaded_file) override { 96 mojom::DownloadedTempFilePtr downloaded_file) override {
92 client_->OnReceiveResponse(head, std::move(downloaded_file)); 97 client_->OnReceiveResponse(head, std::move(downloaded_file));
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 } 483 }
479 484
480 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() 485 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType()
481 const { 486 const {
482 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) 487 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH)
483 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; 488 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH;
484 return ResourceTypeToEventType(resource_type_); 489 return ResourceTypeToEventType(resource_type_);
485 } 490 }
486 491
487 } // namespace content 492 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698