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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // additional headers may be added to |request_headers|. | 45 // additional headers may be added to |request_headers|. |
46 typedef base::Callback<void(const ProxyInfo& proxy_info, | 46 typedef base::Callback<void(const ProxyInfo& proxy_info, |
47 HttpRequestHeaders* request_headers)> | 47 HttpRequestHeaders* request_headers)> |
48 BeforeHeadersSentCallback; | 48 BeforeHeadersSentCallback; |
49 | 49 |
50 // Stops any pending IO and destroys the transaction object. | 50 // Stops any pending IO and destroys the transaction object. |
51 virtual ~HttpTransaction() {} | 51 virtual ~HttpTransaction() {} |
52 | 52 |
53 // Starts the HTTP transaction (i.e., sends the HTTP request). | 53 // Starts the HTTP transaction (i.e., sends the HTTP request). |
54 // | 54 // |
55 // The consumer should ensure that request_info points to a valid value till | 55 // TODO(crbug.com/723786) The consumer should ensure that request_info points |
56 // final response headers are received; after that point, the HttpTransaction | 56 // to a valid value till final response headers are received; after that |
57 // will not access |*request_info| and it may be deleted. | 57 // point, the HttpTransaction will not access |*request_info| and it may be |
| 58 // deleted. |
58 // | 59 // |
59 // Returns OK if the transaction could be started synchronously, which means | 60 // Returns OK if the transaction could be started synchronously, which means |
60 // that the request was served from the cache. ERR_IO_PENDING is returned to | 61 // that the request was served from the cache. ERR_IO_PENDING is returned to |
61 // indicate that the CompletionCallback will be notified once response info is | 62 // indicate that the CompletionCallback will be notified once response info is |
62 // available or if an IO error occurs. Any other return value indicates that | 63 // available or if an IO error occurs. Any other return value indicates that |
63 // the transaction could not be started. | 64 // the transaction could not be started. |
64 // | 65 // |
65 // Regardless of the return value, the caller is expected to keep the | 66 // Regardless of the return value, the caller is expected to keep the |
66 // request_info object alive until Destroy is called on the transaction. | 67 // request_info object alive until Destroy is called on the transaction. |
67 // | 68 // |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 193 |
193 // Resumes the transaction after being deferred. | 194 // Resumes the transaction after being deferred. |
194 virtual int ResumeNetworkStart() = 0; | 195 virtual int ResumeNetworkStart() = 0; |
195 | 196 |
196 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; | 197 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; |
197 }; | 198 }; |
198 | 199 |
199 } // namespace net | 200 } // namespace net |
200 | 201 |
201 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 202 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
OLD | NEW |