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

Unified Diff: content/browser/loader/test_url_loader_client.h

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 side-by-side diff with in-line comments
Download patch
Index: content/browser/loader/test_url_loader_client.h
diff --git a/content/browser/loader/test_url_loader_client.h b/content/browser/loader/test_url_loader_client.h
index b7d5ce488a56a9259228eaadbca491771fea2ec5..8d5647aff5549124fa57ccf927cd48ca0f6ea503 100644
--- a/content/browser/loader/test_url_loader_client.h
+++ b/content/browser/loader/test_url_loader_client.h
@@ -36,6 +36,9 @@ class TestURLLoaderClient final : public mojom::URLLoaderClient {
void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override;
void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override;
void OnTransferSizeUpdated(int32_t transfer_size_diff) override;
+ void OnUploadProgress(int64_t current_position,
+ int64_t total_size,
+ const base::Closure& ack_callback) override;
void OnStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle body) override;
void OnComplete(const ResourceRequestCompletionStatus& status) override;
@@ -43,6 +46,9 @@ class TestURLLoaderClient final : public mojom::URLLoaderClient {
bool has_received_response() const { return has_received_response_; }
bool has_received_redirect() const { return has_received_redirect_; }
bool has_data_downloaded() const { return has_data_downloaded_; }
+ bool has_received_upload_progress() const {
+ return has_received_upload_progress_;
+ }
bool has_received_cached_metadata() const {
return has_received_cached_metadata_;
}
@@ -61,6 +67,12 @@ class TestURLLoaderClient final : public mojom::URLLoaderClient {
return encoded_download_data_length_;
}
int64_t body_transfer_size() const { return body_transfer_size_; }
+ int64_t current_upload_position() const { return current_upload_position_; }
+ int64_t total_upload_size() const { return total_upload_size_; }
+
+ void reset_has_received_upload_progress() {
+ has_received_upload_progress_ = false;
+ }
void ClearHasReceivedRedirect();
// Creates an AssociatedPtrInfo, binds it to |*this| and returns it. The
@@ -88,6 +100,7 @@ class TestURLLoaderClient final : public mojom::URLLoaderClient {
bool has_received_response_ = false;
bool has_received_redirect_ = false;
bool has_data_downloaded_ = false;
+ bool has_received_upload_progress_ = false;
bool has_received_cached_metadata_ = false;
bool has_received_completion_ = false;
base::Closure quit_closure_for_on_receive_response_;
@@ -100,6 +113,8 @@ class TestURLLoaderClient final : public mojom::URLLoaderClient {
int64_t download_data_length_ = 0;
int64_t encoded_download_data_length_ = 0;
int64_t body_transfer_size_ = 0;
+ int64_t current_upload_position_ = 0;
+ int64_t total_upload_size_ = 0;
DISALLOW_COPY_AND_ASSIGN(TestURLLoaderClient);
};

Powered by Google App Engine
This is Rietveld 408576698