| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_NETWORK_URL_LOADER_IMPL_H_ | 5 #ifndef CONTENT_NETWORK_URL_LOADER_IMPL_H_ |
| 6 #define CONTENT_NETWORK_URL_LOADER_IMPL_H_ | 6 #define CONTENT_NETWORK_URL_LOADER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 void OnReceivedRedirect(net::URLRequest* url_request, | 43 void OnReceivedRedirect(net::URLRequest* url_request, |
| 44 const net::RedirectInfo& redirect_info, | 44 const net::RedirectInfo& redirect_info, |
| 45 bool* defer_redirect) override; | 45 bool* defer_redirect) override; |
| 46 void OnResponseStarted(net::URLRequest* url_request, int net_error) override; | 46 void OnResponseStarted(net::URLRequest* url_request, int net_error) override; |
| 47 void OnReadCompleted(net::URLRequest* url_request, int bytes_read) override; | 47 void OnReadCompleted(net::URLRequest* url_request, int bytes_read) override; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 void ReadMore(); | 50 void ReadMore(); |
| 51 void DidRead(uint32_t num_bytes, bool completed_synchronously); | 51 void DidRead(uint32_t num_bytes, bool completed_synchronously); |
| 52 void NotifyCompleted(int error_code); | 52 void NotifyCompleted(int error_code); |
| 53 void SendDataPipeIfNecessary(); | |
| 54 void OnConnectionError(); | 53 void OnConnectionError(); |
| 55 void OnResponseBodyStreamClosed(MojoResult result); | 54 void OnResponseBodyStreamClosed(MojoResult result); |
| 56 void OnResponseBodyStreamReady(MojoResult result); | 55 void OnResponseBodyStreamReady(MojoResult result); |
| 57 void DeleteIfNeeded(); | 56 void DeleteIfNeeded(); |
| 58 | 57 |
| 59 NetworkContext* context_; | 58 NetworkContext* context_; |
| 60 int32_t options_; | 59 int32_t options_; |
| 61 bool connected_; | 60 bool connected_; |
| 62 std::unique_ptr<net::URLRequest> url_request_; | 61 std::unique_ptr<net::URLRequest> url_request_; |
| 63 mojo::AssociatedBinding<mojom::URLLoader> binding_; | 62 mojo::AssociatedBinding<mojom::URLLoader> binding_; |
| 64 mojom::URLLoaderClientPtr url_loader_client_; | 63 mojom::URLLoaderClientPtr url_loader_client_; |
| 65 | 64 |
| 66 mojo::ScopedDataPipeProducerHandle response_body_stream_; | 65 mojo::ScopedDataPipeProducerHandle response_body_stream_; |
| 67 mojo::ScopedDataPipeConsumerHandle response_body_consumer_handle_; | |
| 68 scoped_refptr<NetToMojoPendingBuffer> pending_write_; | 66 scoped_refptr<NetToMojoPendingBuffer> pending_write_; |
| 69 mojo::SimpleWatcher writable_handle_watcher_; | 67 mojo::SimpleWatcher writable_handle_watcher_; |
| 70 mojo::SimpleWatcher peer_closed_handle_watcher_; | 68 mojo::SimpleWatcher peer_closed_handle_watcher_; |
| 71 | 69 |
| 72 base::WeakPtrFactory<URLLoaderImpl> weak_ptr_factory_; | 70 base::WeakPtrFactory<URLLoaderImpl> weak_ptr_factory_; |
| 73 | 71 |
| 74 DISALLOW_COPY_AND_ASSIGN(URLLoaderImpl); | 72 DISALLOW_COPY_AND_ASSIGN(URLLoaderImpl); |
| 75 }; | 73 }; |
| 76 | 74 |
| 77 } // namespace content | 75 } // namespace content |
| 78 | 76 |
| 79 #endif // CONTENT_NETWORK_URL_LOADER_IMPL_H_ | 77 #endif // CONTENT_NETWORK_URL_LOADER_IMPL_H_ |
| OLD | NEW |