| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 NET_HTTP_HTTP_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_TRANSACTION_H_ |
| 6 #define NET_HTTP_HTTP_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
| 9 #include "net/base/load_states.h" | 9 #include "net/base/load_states.h" |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // HTTP redirects are not followed and authentication challenges are not | 29 // HTTP redirects are not followed and authentication challenges are not |
| 30 // answered. Cookies are assumed to be managed by the caller. | 30 // answered. Cookies are assumed to be managed by the caller. |
| 31 class NET_EXPORT_PRIVATE HttpTransaction { | 31 class NET_EXPORT_PRIVATE HttpTransaction { |
| 32 public: | 32 public: |
| 33 // If |*defer| is set to true, the transaction will wait until | 33 // If |*defer| is set to true, the transaction will wait until |
| 34 // ResumeNetworkStart is called before establishing a connection. | 34 // ResumeNetworkStart is called before establishing a connection. |
| 35 typedef base::Callback<void(bool* defer)> BeforeNetworkStartCallback; | 35 typedef base::Callback<void(bool* defer)> BeforeNetworkStartCallback; |
| 36 | 36 |
| 37 // Provides an opportunity to add proxy-specific request headers. Called after | 37 // Provides an opportunity to add proxy-specific request headers. Called after |
| 38 // it is determined that a proxy is being used and before the request headers | 38 // it is determined that a proxy is being used and before the request headers |
| 39 // are sent. |proxy_info| contains information about the proxy being used. | 39 // are sent. |proxy_info| contains information about the proxy being used, |
| 40 // and additional headers may be added to |request_headers|. |
| 40 typedef base::Callback<void( | 41 typedef base::Callback<void( |
| 41 const ProxyInfo& proxy_info)> BeforeProxyHeadersSentCallback; | 42 const ProxyInfo& proxy_info, |
| 43 HttpRequestHeaders* request_headers)> BeforeProxyHeadersSentCallback; |
| 42 | 44 |
| 43 // Stops any pending IO and destroys the transaction object. | 45 // Stops any pending IO and destroys the transaction object. |
| 44 virtual ~HttpTransaction() {} | 46 virtual ~HttpTransaction() {} |
| 45 | 47 |
| 46 // Starts the HTTP transaction (i.e., sends the HTTP request). | 48 // Starts the HTTP transaction (i.e., sends the HTTP request). |
| 47 // | 49 // |
| 48 // Returns OK if the transaction could be started synchronously, which means | 50 // Returns OK if the transaction could be started synchronously, which means |
| 49 // that the request was served from the cache. ERR_IO_PENDING is returned to | 51 // that the request was served from the cache. ERR_IO_PENDING is returned to |
| 50 // indicate that the CompletionCallback will be notified once response info is | 52 // indicate that the CompletionCallback will be notified once response info is |
| 51 // available or if an IO error occurs. Any other return value indicates that | 53 // available or if an IO error occurs. Any other return value indicates that |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 virtual void SetBeforeProxyHeadersSentCallback( | 172 virtual void SetBeforeProxyHeadersSentCallback( |
| 171 const BeforeProxyHeadersSentCallback& callback) = 0; | 173 const BeforeProxyHeadersSentCallback& callback) = 0; |
| 172 | 174 |
| 173 // Resumes the transaction after being deferred. | 175 // Resumes the transaction after being deferred. |
| 174 virtual int ResumeNetworkStart() = 0; | 176 virtual int ResumeNetworkStart() = 0; |
| 175 }; | 177 }; |
| 176 | 178 |
| 177 } // namespace net | 179 } // namespace net |
| 178 | 180 |
| 179 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 181 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
| OLD | NEW |