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_PIPELINED_CONNECTION_IMPL_H_ | 5 #ifndef NET_HTTP_HTTP_PIPELINED_CONNECTION_IMPL_H_ |
6 #define NET_HTTP_HTTP_PIPELINED_CONNECTION_IMPL_H_ | 6 #define NET_HTTP_HTTP_PIPELINED_CONNECTION_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // Cleans up the state associated with the active request. Invokes | 244 // Cleans up the state associated with the active request. Invokes |
245 // DoReadNextHeaders() in a new task to start the next response. This is | 245 // DoReadNextHeaders() in a new task to start the next response. This is |
246 // called after the active request's HttpPipelinedSocket calls Close(). | 246 // called after the active request's HttpPipelinedSocket calls Close(). |
247 int DoReadStreamClosed(); | 247 int DoReadStreamClosed(); |
248 | 248 |
249 // Removes all pending ReadResponseHeaders() requests from the queue. This may | 249 // Removes all pending ReadResponseHeaders() requests from the queue. This may |
250 // happen if there is an error with the pipeline or one of our | 250 // happen if there is an error with the pipeline or one of our |
251 // HttpPipelinedSockets indicates the connection was suddenly closed. | 251 // HttpPipelinedSockets indicates the connection was suddenly closed. |
252 int DoEvictPendingReadHeaders(int result); | 252 int DoEvictPendingReadHeaders(int result); |
253 | 253 |
| 254 // Reports back to |delegate_| whether pipelining will work. This is called |
| 255 // every time we receive headers. |
| 256 void CheckHeadersForPipelineCompatibility(int result, int pipeline_id); |
| 257 |
254 // Posts a task to fire the user's callback in response to SendRequest() or | 258 // Posts a task to fire the user's callback in response to SendRequest() or |
255 // ReadResponseHeaders() completing on an underlying parser. This might be | 259 // ReadResponseHeaders() completing on an underlying parser. This might be |
256 // invoked in response to our own IO callbacks, or it may be invoked if the | 260 // invoked in response to our own IO callbacks, or it may be invoked if the |
257 // underlying parser completes SendRequest() or ReadResponseHeaders() | 261 // underlying parser completes SendRequest() or ReadResponseHeaders() |
258 // synchronously, but we've already returned ERR_IO_PENDING to the user's | 262 // synchronously, but we've already returned ERR_IO_PENDING to the user's |
259 // SendRequest() or ReadResponseHeaders() call into us. | 263 // SendRequest() or ReadResponseHeaders() call into us. |
260 void QueueUserCallback(int pipeline_id, | 264 void QueueUserCallback(int pipeline_id, |
261 OldCompletionCallback* callback, | 265 OldCompletionCallback* callback, |
262 int rv, | 266 int rv, |
263 const tracked_objects::Location& from_here); | 267 const tracked_objects::Location& from_here); |
(...skipping 28 matching lines...) Expand all Loading... |
292 int active_read_id_; | 296 int active_read_id_; |
293 bool read_still_on_call_stack_; | 297 bool read_still_on_call_stack_; |
294 OldCompletionCallbackImpl<HttpPipelinedConnectionImpl> read_io_callback_; | 298 OldCompletionCallbackImpl<HttpPipelinedConnectionImpl> read_io_callback_; |
295 | 299 |
296 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedConnectionImpl); | 300 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedConnectionImpl); |
297 }; | 301 }; |
298 | 302 |
299 } // namespace net | 303 } // namespace net |
300 | 304 |
301 #endif // NET_HTTP_HTTP_PIPELINED_CONNECTION_IMPL_H_ | 305 #endif // NET_HTTP_HTTP_PIPELINED_CONNECTION_IMPL_H_ |
OLD | NEW |