| 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_MOJO_ASYNC_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 bool has_checked_for_sufficient_resources_ = false; | 132 bool has_checked_for_sufficient_resources_ = false; |
| 133 bool sent_received_response_message_ = false; | 133 bool sent_received_response_message_ = false; |
| 134 bool is_using_io_buffer_not_from_writer_ = false; | 134 bool is_using_io_buffer_not_from_writer_ = false; |
| 135 // True if OnWillRead was deferred, in order to wait to be able to allocate a | 135 // True if OnWillRead was deferred, in order to wait to be able to allocate a |
| 136 // buffer. | 136 // buffer. |
| 137 bool did_defer_on_will_read_ = false; | 137 bool did_defer_on_will_read_ = false; |
| 138 bool did_defer_on_writing_ = false; | 138 bool did_defer_on_writing_ = false; |
| 139 bool did_defer_on_redirect_ = false; | 139 bool did_defer_on_redirect_ = false; |
| 140 base::TimeTicks response_started_ticks_; | 140 base::TimeTicks response_started_ticks_; |
| 141 int64_t reported_total_received_bytes_ = 0; | 141 int64_t reported_total_received_bytes_ = 0; |
| 142 int64_t total_written_bytes_ = 0; |
| 142 | 143 |
| 143 // Pointer to parent's information about the read buffer. Only non-null while | 144 // Pointer to parent's information about the read buffer. Only non-null while |
| 144 // OnWillRead is deferred. | 145 // OnWillRead is deferred. |
| 145 scoped_refptr<net::IOBuffer>* parent_buffer_ = nullptr; | 146 scoped_refptr<net::IOBuffer>* parent_buffer_ = nullptr; |
| 146 int* parent_buffer_size_ = nullptr; | 147 int* parent_buffer_size_ = nullptr; |
| 147 | 148 |
| 148 mojo::SimpleWatcher handle_watcher_; | 149 mojo::SimpleWatcher handle_watcher_; |
| 149 std::unique_ptr<mojom::URLLoader> url_loader_; | 150 std::unique_ptr<mojom::URLLoader> url_loader_; |
| 150 mojom::URLLoaderClientPtr url_loader_client_; | 151 mojom::URLLoaderClientPtr url_loader_client_; |
| 151 scoped_refptr<net::IOBufferWithSize> buffer_; | 152 scoped_refptr<net::IOBufferWithSize> buffer_; |
| 152 size_t buffer_offset_ = 0; | 153 size_t buffer_offset_ = 0; |
| 153 size_t buffer_bytes_read_ = 0; | 154 size_t buffer_bytes_read_ = 0; |
| 154 scoped_refptr<SharedWriter> shared_writer_; | 155 scoped_refptr<SharedWriter> shared_writer_; |
| 155 mojo::ScopedDataPipeConsumerHandle response_body_consumer_handle_; | 156 mojo::ScopedDataPipeConsumerHandle response_body_consumer_handle_; |
| 156 | 157 |
| 157 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_; | 158 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_; |
| 158 | 159 |
| 159 base::WeakPtrFactory<MojoAsyncResourceHandler> weak_factory_; | 160 base::WeakPtrFactory<MojoAsyncResourceHandler> weak_factory_; |
| 160 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler); | 161 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler); |
| 161 }; | 162 }; |
| 162 | 163 |
| 163 } // namespace content | 164 } // namespace content |
| 164 | 165 |
| 165 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ | 166 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ |
| OLD | NEW |