OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 enum State { | 88 enum State { |
89 STATE_CREATE_STREAM, | 89 STATE_CREATE_STREAM, |
90 STATE_CREATE_STREAM_COMPLETE, | 90 STATE_CREATE_STREAM_COMPLETE, |
91 STATE_INIT_STREAM, | 91 STATE_INIT_STREAM, |
92 STATE_INIT_STREAM_COMPLETE, | 92 STATE_INIT_STREAM_COMPLETE, |
93 STATE_GENERATE_PROXY_AUTH_TOKEN, | 93 STATE_GENERATE_PROXY_AUTH_TOKEN, |
94 STATE_GENERATE_PROXY_AUTH_TOKEN_COMPLETE, | 94 STATE_GENERATE_PROXY_AUTH_TOKEN_COMPLETE, |
95 STATE_GENERATE_SERVER_AUTH_TOKEN, | 95 STATE_GENERATE_SERVER_AUTH_TOKEN, |
96 STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE, | 96 STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE, |
| 97 STATE_BUILD_REQUEST, |
| 98 STATE_BUILD_REQUEST_COMPLETE, |
97 STATE_SEND_REQUEST, | 99 STATE_SEND_REQUEST, |
98 STATE_SEND_REQUEST_COMPLETE, | 100 STATE_SEND_REQUEST_COMPLETE, |
99 STATE_READ_HEADERS, | 101 STATE_READ_HEADERS, |
100 STATE_READ_HEADERS_COMPLETE, | 102 STATE_READ_HEADERS_COMPLETE, |
101 STATE_READ_BODY, | 103 STATE_READ_BODY, |
102 STATE_READ_BODY_COMPLETE, | 104 STATE_READ_BODY_COMPLETE, |
103 STATE_DRAIN_BODY_FOR_AUTH_RESTART, | 105 STATE_DRAIN_BODY_FOR_AUTH_RESTART, |
104 STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, | 106 STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, |
105 STATE_NONE | 107 STATE_NONE |
106 }; | 108 }; |
(...skipping 11 matching lines...) Expand all Loading... |
118 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the | 120 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the |
119 // next state method as the result arg. | 121 // next state method as the result arg. |
120 int DoCreateStream(); | 122 int DoCreateStream(); |
121 int DoCreateStreamComplete(int result); | 123 int DoCreateStreamComplete(int result); |
122 int DoInitStream(); | 124 int DoInitStream(); |
123 int DoInitStreamComplete(int result); | 125 int DoInitStreamComplete(int result); |
124 int DoGenerateProxyAuthToken(); | 126 int DoGenerateProxyAuthToken(); |
125 int DoGenerateProxyAuthTokenComplete(int result); | 127 int DoGenerateProxyAuthTokenComplete(int result); |
126 int DoGenerateServerAuthToken(); | 128 int DoGenerateServerAuthToken(); |
127 int DoGenerateServerAuthTokenComplete(int result); | 129 int DoGenerateServerAuthTokenComplete(int result); |
128 int DoSendRequest(); | 130 int DoBuildRequest(); |
| 131 int DoBuildRequestComplete(int result); |
| 132 int DoSendRequest(int result); |
129 int DoSendRequestComplete(int result); | 133 int DoSendRequestComplete(int result); |
130 int DoReadHeaders(); | 134 int DoReadHeaders(); |
131 int DoReadHeadersComplete(int result); | 135 int DoReadHeadersComplete(int result); |
132 int DoReadBody(); | 136 int DoReadBody(); |
133 int DoReadBodyComplete(int result); | 137 int DoReadBodyComplete(int result); |
134 int DoDrainBodyForAuthRestart(); | 138 int DoDrainBodyForAuthRestart(); |
135 int DoDrainBodyForAuthRestartComplete(int result); | 139 int DoDrainBodyForAuthRestartComplete(int result); |
136 | 140 |
137 // Record histogram of time until first byte of header is received. | 141 // Record histogram of time until first byte of header is received. |
138 void LogTransactionConnectedMetrics(); | 142 void LogTransactionConnectedMetrics(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 214 |
211 scoped_refptr<HttpAuthController> | 215 scoped_refptr<HttpAuthController> |
212 auth_controllers_[HttpAuth::AUTH_NUM_TARGETS]; | 216 auth_controllers_[HttpAuth::AUTH_NUM_TARGETS]; |
213 | 217 |
214 // Whether this transaction is waiting for proxy auth, server auth, or is | 218 // Whether this transaction is waiting for proxy auth, server auth, or is |
215 // not waiting for any auth at all. |pending_auth_target_| is read and | 219 // not waiting for any auth at all. |pending_auth_target_| is read and |
216 // cleared by RestartWithAuth(). | 220 // cleared by RestartWithAuth(). |
217 HttpAuth::Target pending_auth_target_; | 221 HttpAuth::Target pending_auth_target_; |
218 | 222 |
219 CompletionCallbackImpl<HttpNetworkTransaction> io_callback_; | 223 CompletionCallbackImpl<HttpNetworkTransaction> io_callback_; |
| 224 scoped_refptr<CancelableCompletionCallback<HttpNetworkTransaction> > |
| 225 delegate_callback_; |
220 CompletionCallback* user_callback_; | 226 CompletionCallback* user_callback_; |
| 227 scoped_ptr<UploadDataStream> request_body_; |
221 | 228 |
222 scoped_refptr<HttpNetworkSession> session_; | 229 scoped_refptr<HttpNetworkSession> session_; |
223 | 230 |
224 BoundNetLog net_log_; | 231 BoundNetLog net_log_; |
225 const HttpRequestInfo* request_; | 232 const HttpRequestInfo* request_; |
226 HttpResponseInfo response_; | 233 HttpResponseInfo response_; |
227 | 234 |
228 // |proxy_info_| is the ProxyInfo used by the HttpStreamRequest. | 235 // |proxy_info_| is the ProxyInfo used by the HttpStreamRequest. |
229 ProxyInfo proxy_info_; | 236 ProxyInfo proxy_info_; |
230 | 237 |
(...skipping 30 matching lines...) Expand all Loading... |
261 // True when the tunnel is in the process of being established - we can't | 268 // True when the tunnel is in the process of being established - we can't |
262 // read from the socket until the tunnel is done. | 269 // read from the socket until the tunnel is done. |
263 bool establishing_tunnel_; | 270 bool establishing_tunnel_; |
264 | 271 |
265 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); | 272 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); |
266 }; | 273 }; |
267 | 274 |
268 } // namespace net | 275 } // namespace net |
269 | 276 |
270 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 277 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
OLD | NEW |