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

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: update TestExpectations 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 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 OnTransferSizeUpdated(int32_t transfer_size_diff) override { 84 void OnTransferSizeUpdated(int32_t transfer_size_diff) override {
85 client_->OnTransferSizeUpdated(transfer_size_diff); 85 client_->OnTransferSizeUpdated(transfer_size_diff);
86 } 86 }
87 void OnUploadProgress(int64_t current_position,
nhiroki 2017/01/06 05:30:09 nit: Can you move this between OnDataDownloaded an
tzik 2017/01/18 12:56:43 Done.
88 int64_t total_size,
89 const base::Closure& ack_callback) override {
90 client_->OnUploadProgress(current_position, total_size, ack_callback);
91 }
87 void OnReceiveResponse( 92 void OnReceiveResponse(
88 const ResourceResponseHead& head, 93 const ResourceResponseHead& head,
89 mojom::DownloadedTempFilePtr downloaded_file) override { 94 mojom::DownloadedTempFilePtr downloaded_file) override {
90 client_->OnReceiveResponse(head, std::move(downloaded_file)); 95 client_->OnReceiveResponse(head, std::move(downloaded_file));
91 } 96 }
92 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, 97 void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
93 const ResourceResponseHead& head) override { 98 const ResourceResponseHead& head) override {
94 client_->OnReceiveRedirect(redirect_info, head); 99 client_->OnReceiveRedirect(redirect_info, head);
95 } 100 }
96 void OnStartLoadingResponseBody( 101 void OnStartLoadingResponseBody(
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 } 484 }
480 485
481 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() 486 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType()
482 const { 487 const {
483 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) 488 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH)
484 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; 489 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH;
485 return ResourceTypeToEventType(resource_type_); 490 return ResourceTypeToEventType(resource_type_);
486 } 491 }
487 492
488 } // namespace content 493 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698