| 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 23 matching lines...) Expand all Loading... |
| 34 void OnComplete(const ResourceRequestCompletionStatus& status) override; | 34 void OnComplete(const ResourceRequestCompletionStatus& status) override; |
| 35 | 35 |
| 36 bool has_received_response() const { return has_received_response_; } | 36 bool has_received_response() const { return has_received_response_; } |
| 37 bool has_data_downloaded() const { return has_data_downloaded_; } | 37 bool has_data_downloaded() const { return has_data_downloaded_; } |
| 38 bool has_received_completion() const { return has_received_completion_; } | 38 bool has_received_completion() const { return has_received_completion_; } |
| 39 const ResourceResponseHead& response_head() const { return response_head_; } | 39 const ResourceResponseHead& response_head() const { return response_head_; } |
| 40 mojo::DataPipeConsumerHandle response_body() { return response_body_.get(); } | 40 mojo::DataPipeConsumerHandle response_body() { return response_body_.get(); } |
| 41 const ResourceRequestCompletionStatus& completion_status() const { | 41 const ResourceRequestCompletionStatus& completion_status() const { |
| 42 return completion_status_; | 42 return completion_status_; |
| 43 } | 43 } |
| 44 // Creates an AssociatedPtrInfo which is a proxy for |*this| and returns it. | |
| 45 // The returned PtrInfo is marked as local, i.e., expected to be bound | |
| 46 // locally. | |
| 47 mojom::URLLoaderClientAssociatedPtrInfo CreateLocalAssociatedPtrInfo(); | |
| 48 | |
| 49 int64_t download_data_length() const { return download_data_length_; } | 44 int64_t download_data_length() const { return download_data_length_; } |
| 50 int64_t encoded_download_data_length() const { | 45 int64_t encoded_download_data_length() const { |
| 51 return encoded_download_data_length_; | 46 return encoded_download_data_length_; |
| 52 } | 47 } |
| 53 | 48 |
| 54 // Creates an AssociatedPtrInfo, binds it to |*this| and returns it. The | 49 // Creates an AssociatedPtrInfo, binds it to |*this| and returns it. The |
| 55 // returned PtrInfo is marked as remote, i.e., expected to be passed to the | 50 // returned PtrInfo is marked as remote, i.e., expected to be passed to the |
| 56 // remote endpoint. | 51 // remote endpoint. |
| 57 mojom::URLLoaderClientAssociatedPtrInfo CreateRemoteAssociatedPtrInfo( | 52 mojom::URLLoaderClientAssociatedPtrInfo CreateRemoteAssociatedPtrInfo( |
| 58 mojo::AssociatedGroup* associated_group); | 53 mojo::AssociatedGroup* associated_group); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 79 mojom::URLLoaderFactoryPtr url_loader_factory_; | 74 mojom::URLLoaderFactoryPtr url_loader_factory_; |
| 80 int64_t download_data_length_ = 0; | 75 int64_t download_data_length_ = 0; |
| 81 int64_t encoded_download_data_length_ = 0; | 76 int64_t encoded_download_data_length_ = 0; |
| 82 | 77 |
| 83 DISALLOW_COPY_AND_ASSIGN(TestURLLoaderClient); | 78 DISALLOW_COPY_AND_ASSIGN(TestURLLoaderClient); |
| 84 }; | 79 }; |
| 85 | 80 |
| 86 } // namespace content | 81 } // namespace content |
| 87 | 82 |
| 88 #endif // CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ | 83 #endif // CONTENT_BROWSER_LOADER_TEST_URL_LOADER_CLIENT_H_ |
| OLD | NEW |