| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // The consumer should ensure that request_info points to a valid value till |
| 56 // final response headers are received; after that point, the HttpTransaction | 56 // final response headers are received; after that point, the HttpTransaction |
| 57 // will not access |*request_info| and it may be deleted. | 57 // will not access |*request_info| and it may be deleted. Note that in case of |
| 58 // range requests response headers may be received multiple times and the |
| 59 // HttpTransaction might access |*request_info| in all of those. |
| 58 // | 60 // |
| 59 // Returns OK if the transaction could be started synchronously, which means | 61 // 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 | 62 // 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 | 63 // 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 | 64 // available or if an IO error occurs. Any other return value indicates that |
| 63 // the transaction could not be started. | 65 // the transaction could not be started. |
| 64 // | 66 // |
| 65 // Regardless of the return value, the caller is expected to keep the | 67 // Regardless of the return value, the caller is expected to keep the |
| 66 // request_info object alive until Destroy is called on the transaction. | 68 // request_info object alive until Destroy is called on the transaction. |
| 67 // | 69 // |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 194 |
| 193 // Resumes the transaction after being deferred. | 195 // Resumes the transaction after being deferred. |
| 194 virtual int ResumeNetworkStart() = 0; | 196 virtual int ResumeNetworkStart() = 0; |
| 195 | 197 |
| 196 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; | 198 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; |
| 197 }; | 199 }; |
| 198 | 200 |
| 199 } // namespace net | 201 } // namespace net |
| 200 | 202 |
| 201 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 203 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
| OLD | NEW |