OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ |
6 #define CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ | 6 #define CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 class TestURLLoaderClient final : public mojom::URLLoaderClient { | 26 class TestURLLoaderClient final : public mojom::URLLoaderClient { |
27 public: | 27 public: |
28 TestURLLoaderClient(); | 28 TestURLLoaderClient(); |
29 ~TestURLLoaderClient() override; | 29 ~TestURLLoaderClient() override; |
30 | 30 |
31 void OnReceiveResponse(const ResourceResponseHead& response_head, | 31 void OnReceiveResponse(const ResourceResponseHead& response_head, |
32 mojom::DownloadedTempFilePtr downloaded_file) override; | 32 mojom::DownloadedTempFilePtr downloaded_file) override; |
33 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, | 33 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, |
34 const ResourceResponseHead& response_head) override; | 34 const ResourceResponseHead& response_head) override; |
35 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override; | 35 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override; |
| 36 void OnUploadProgress(int64_t current_position, |
| 37 int64_t total_size, |
| 38 const base::Closure& ack_callback) override; |
36 void OnStartLoadingResponseBody( | 39 void OnStartLoadingResponseBody( |
37 mojo::ScopedDataPipeConsumerHandle body) override; | 40 mojo::ScopedDataPipeConsumerHandle body) override; |
38 void OnComplete(const ResourceRequestCompletionStatus& status) override; | 41 void OnComplete(const ResourceRequestCompletionStatus& status) override; |
39 | 42 |
40 bool has_received_response() const { return has_received_response_; } | 43 bool has_received_response() const { return has_received_response_; } |
41 bool has_received_redirect() const { return has_received_redirect_; } | 44 bool has_received_redirect() const { return has_received_redirect_; } |
42 bool has_data_downloaded() const { return has_data_downloaded_; } | 45 bool has_data_downloaded() const { return has_data_downloaded_; } |
43 bool has_received_completion() const { return has_received_completion_; } | 46 bool has_received_completion() const { return has_received_completion_; } |
44 const ResourceResponseHead& response_head() const { return response_head_; } | 47 const ResourceResponseHead& response_head() const { return response_head_; } |
45 const net::RedirectInfo& redirect_info() const { return redirect_info_; } | 48 const net::RedirectInfo& redirect_info() const { return redirect_info_; } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 mojom::URLLoaderFactoryPtr url_loader_factory_; | 88 mojom::URLLoaderFactoryPtr url_loader_factory_; |
86 int64_t download_data_length_ = 0; | 89 int64_t download_data_length_ = 0; |
87 int64_t encoded_download_data_length_ = 0; | 90 int64_t encoded_download_data_length_ = 0; |
88 | 91 |
89 DISALLOW_COPY_AND_ASSIGN(TestURLLoaderClient); | 92 DISALLOW_COPY_AND_ASSIGN(TestURLLoaderClient); |
90 }; | 93 }; |
91 | 94 |
92 } // namespace content | 95 } // namespace content |
93 | 96 |
94 #endif // CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ | 97 #endif // CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ |
OLD | NEW |