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