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 // The consumer should ensure that request_info points to a valid value till |
Randy Smith (Not in Mondays)
2017/05/09 23:20:32
nit: "till" -> "while"
shivanisha
2017/05/10 14:46:03
done
| |
56 // final response headers are received; after that point, the HttpTransaction | 56 // the consumer is alive; after that point, the HttpTransaction will not |
Randy Smith (Not in Mondays)
2017/05/09 23:20:32
How does the HttpTransaction know when its consume
shivanisha
2017/05/10 14:46:03
In that case, I think this requirement translates
Randy Smith (Not in Mondays)
2017/05/10 21:34:26
Ok, I think we're using terminology differently: W
shivanisha
2017/05/11 19:58:24
Agree with consumer being the immediate consumer w
Randy Smith (Not in Mondays)
2017/05/11 21:47:09
First of all, remind me what the intended use case
| |
57 // will not access |*request_info| and it may be deleted. | 57 // access |*request_info|. |
58 // | 58 // |
59 // Returns OK if the transaction could be started synchronously, which means | 59 // 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 | 60 // 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 | 61 // 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 | 62 // available or if an IO error occurs. Any other return value indicates that |
63 // the transaction could not be started. | 63 // the transaction could not be started. |
64 // | 64 // |
65 // Regardless of the return value, the caller is expected to keep the | 65 // Regardless of the return value, the caller is expected to keep the |
66 // request_info object alive until Destroy is called on the transaction. | 66 // request_info object alive until Destroy is called on the transaction. |
67 // | 67 // |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
192 | 192 |
193 // Resumes the transaction after being deferred. | 193 // Resumes the transaction after being deferred. |
194 virtual int ResumeNetworkStart() = 0; | 194 virtual int ResumeNetworkStart() = 0; |
195 | 195 |
196 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; | 196 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; |
197 }; | 197 }; |
198 | 198 |
199 } // namespace net | 199 } // namespace net |
200 | 200 |
201 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 201 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
OLD | NEW |