| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // A TestURLLoaderClient records URLLoaderClient function calls. It also calls | 23 // A TestURLLoaderClient records URLLoaderClient function calls. It also calls |
| 24 // the closure set via set_quit_closure if set, in order to make it possible to | 24 // the closure set via set_quit_closure if set, in order to make it possible to |
| 25 // create a base::RunLoop, set its quit closure to this client and then run the | 25 // create a base::RunLoop, set its quit closure to this client and then run the |
| 26 // RunLoop. | 26 // RunLoop. |
| 27 class TestURLLoaderClient final : public mojom::URLLoaderClient { | 27 class TestURLLoaderClient final : public mojom::URLLoaderClient { |
| 28 public: | 28 public: |
| 29 TestURLLoaderClient(); | 29 TestURLLoaderClient(); |
| 30 ~TestURLLoaderClient() override; | 30 ~TestURLLoaderClient() override; |
| 31 | 31 |
| 32 void OnReceiveResponse(const ResourceResponseHead& response_head, | 32 void OnReceiveResponse( |
| 33 mojom::DownloadedTempFilePtr downloaded_file) override; | 33 const ResourceResponseHead& response_head, |
| 34 mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file) override; |
| 34 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, | 35 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, |
| 35 const ResourceResponseHead& response_head) override; | 36 const ResourceResponseHead& response_head) override; |
| 36 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override; | 37 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override; |
| 37 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override; | 38 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override; |
| 38 void OnTransferSizeUpdated(int32_t transfer_size_diff) override; | 39 void OnTransferSizeUpdated(int32_t transfer_size_diff) override; |
| 39 void OnStartLoadingResponseBody( | 40 void OnStartLoadingResponseBody( |
| 40 mojo::ScopedDataPipeConsumerHandle body) override; | 41 mojo::ScopedDataPipeConsumerHandle body) override; |
| 41 void OnComplete(const ResourceRequestCompletionStatus& status) override; | 42 void OnComplete(const ResourceRequestCompletionStatus& status) override; |
| 42 | 43 |
| 43 bool has_received_response() const { return has_received_response_; } | 44 bool has_received_response() const { return has_received_response_; } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 int64_t download_data_length_ = 0; | 101 int64_t download_data_length_ = 0; |
| 101 int64_t encoded_download_data_length_ = 0; | 102 int64_t encoded_download_data_length_ = 0; |
| 102 int64_t body_transfer_size_ = 0; | 103 int64_t body_transfer_size_ = 0; |
| 103 | 104 |
| 104 DISALLOW_COPY_AND_ASSIGN(TestURLLoaderClient); | 105 DISALLOW_COPY_AND_ASSIGN(TestURLLoaderClient); |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 } // namespace content | 108 } // namespace content |
| 108 | 109 |
| 109 #endif // CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ | 110 #endif // CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ |
| OLD | NEW |