OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_SERVICES_NETWORK_URL_LOADER_IMPL_H_ | 5 #ifndef MOJO_SERVICES_NETWORK_URL_LOADER_IMPL_H_ |
6 #define MOJO_SERVICES_NETWORK_URL_LOADER_IMPL_H_ | 6 #define MOJO_SERVICES_NETWORK_URL_LOADER_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 virtual void Start( | 34 virtual void Start( |
35 URLRequestPtr request, | 35 URLRequestPtr request, |
36 const Callback<void(URLResponsePtr)>& callback) OVERRIDE; | 36 const Callback<void(URLResponsePtr)>& callback) OVERRIDE; |
37 virtual void FollowRedirect( | 37 virtual void FollowRedirect( |
38 const Callback<void(URLResponsePtr)>& callback) OVERRIDE; | 38 const Callback<void(URLResponsePtr)>& callback) OVERRIDE; |
39 virtual void QueryStatus( | 39 virtual void QueryStatus( |
40 const Callback<void(URLLoaderStatusPtr)>& callback) OVERRIDE; | 40 const Callback<void(URLLoaderStatusPtr)>& callback) OVERRIDE; |
41 | 41 |
42 // net::URLRequest::Delegate methods: | 42 // net::URLRequest::Delegate methods: |
43 virtual void OnReceivedRedirect(net::URLRequest* url_request, | 43 virtual void OnReceivedRedirect(net::URLRequest* url_request, |
44 const GURL& new_url, | 44 const net::RedirectInfo& redirect_info, |
45 bool* defer_redirect) OVERRIDE; | 45 bool* defer_redirect) OVERRIDE; |
46 virtual void OnResponseStarted(net::URLRequest* url_request) OVERRIDE; | 46 virtual void OnResponseStarted(net::URLRequest* url_request) OVERRIDE; |
47 virtual void OnReadCompleted(net::URLRequest* url_request, int bytes_read) | 47 virtual void OnReadCompleted(net::URLRequest* url_request, int bytes_read) |
48 OVERRIDE; | 48 OVERRIDE; |
49 | 49 |
50 void SendError( | 50 void SendError( |
51 int error, | 51 int error, |
52 const Callback<void(URLResponsePtr)>& callback); | 52 const Callback<void(URLResponsePtr)>& callback); |
53 void SendResponse(URLResponsePtr response); | 53 void SendResponse(URLResponsePtr response); |
54 void OnResponseBodyStreamReady(MojoResult result); | 54 void OnResponseBodyStreamReady(MojoResult result); |
55 void WaitToReadMore(); | 55 void WaitToReadMore(); |
56 void ReadMore(); | 56 void ReadMore(); |
57 void DidRead(uint32_t num_bytes, bool completed_synchronously); | 57 void DidRead(uint32_t num_bytes, bool completed_synchronously); |
58 | 58 |
59 NetworkContext* context_; | 59 NetworkContext* context_; |
60 scoped_ptr<net::URLRequest> url_request_; | 60 scoped_ptr<net::URLRequest> url_request_; |
61 Callback<void(URLResponsePtr)> callback_; | 61 Callback<void(URLResponsePtr)> callback_; |
62 ScopedDataPipeProducerHandle response_body_stream_; | 62 ScopedDataPipeProducerHandle response_body_stream_; |
63 scoped_refptr<PendingWriteToDataPipe> pending_write_; | 63 scoped_refptr<PendingWriteToDataPipe> pending_write_; |
64 common::HandleWatcher handle_watcher_; | 64 common::HandleWatcher handle_watcher_; |
65 uint32 response_body_buffer_size_; | 65 uint32 response_body_buffer_size_; |
66 bool auto_follow_redirects_; | 66 bool auto_follow_redirects_; |
67 | 67 |
68 base::WeakPtrFactory<URLLoaderImpl> weak_ptr_factory_; | 68 base::WeakPtrFactory<URLLoaderImpl> weak_ptr_factory_; |
69 }; | 69 }; |
70 | 70 |
71 } // namespace mojo | 71 } // namespace mojo |
72 | 72 |
73 #endif // MOJO_SERVICES_NETWORK_URL_LOADER_IMPL_H_ | 73 #endif // MOJO_SERVICES_NETWORK_URL_LOADER_IMPL_H_ |
OLD | NEW |