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_SPDY_SPDY_SESSION_H_ | 5 #ifndef NET_SPDY_SPDY_SESSION_H_ |
6 #define NET_SPDY_SPDY_SESSION_H_ | 6 #define NET_SPDY_SPDY_SESSION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <list> | 10 #include <list> |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // Calls OnResponseReceived(). | 288 // Calls OnResponseReceived(). |
289 // Returns true if successful. | 289 // Returns true if successful. |
290 bool Respond(const spdy::SpdyHeaderBlock& headers, | 290 bool Respond(const spdy::SpdyHeaderBlock& headers, |
291 const scoped_refptr<SpdyStream> stream); | 291 const scoped_refptr<SpdyStream> stream); |
292 | 292 |
293 void RecordHistograms(); | 293 void RecordHistograms(); |
294 | 294 |
295 // Closes all streams. Used as part of shutdown. | 295 // Closes all streams. Used as part of shutdown. |
296 void CloseAllStreams(net::Error status); | 296 void CloseAllStreams(net::Error status); |
297 | 297 |
| 298 // Invokes a user callback for stream creation. We provide this method so it |
| 299 // can be deferred to the MessageLoop, so we avoid re-entrancy problems. |
| 300 void InvokeUserStreamCreationCallback(CompletionCallback* callback, int rv); |
| 301 |
298 // Callbacks for the Spdy session. | 302 // Callbacks for the Spdy session. |
299 CompletionCallbackImpl<SpdySession> read_callback_; | 303 CompletionCallbackImpl<SpdySession> read_callback_; |
300 CompletionCallbackImpl<SpdySession> write_callback_; | 304 CompletionCallbackImpl<SpdySession> write_callback_; |
301 | 305 |
302 // Used for posting asynchronous IO tasks. We use this even though | 306 // Used for posting asynchronous IO tasks. We use this even though |
303 // SpdySession is refcounted because we don't need to keep the SpdySession | 307 // SpdySession is refcounted because we don't need to keep the SpdySession |
304 // alive if the last reference is within a RunnableMethod. Just revoke the | 308 // alive if the last reference is within a RunnableMethod. Just revoke the |
305 // method. | 309 // method. |
306 ScopedRunnableMethodFactory<SpdySession> method_factory_; | 310 ScopedRunnableMethodFactory<SpdySession> method_factory_; |
307 | 311 |
308 // The domain this session is connected to. | 312 // The domain this session is connected to. |
309 const HostPortProxyPair host_port_proxy_pair_; | 313 const HostPortProxyPair host_port_proxy_pair_; |
310 | 314 |
311 // |spdy_session_pool_| owns us, therefore its lifetime must exceed ours. We | 315 // |spdy_session_pool_| owns us, therefore its lifetime must exceed ours. We |
312 // set this to NULL after we are removed from the pool. | 316 // set this to NULL after we are removed from the pool. |
313 SpdySessionPool* spdy_session_pool_; | 317 SpdySessionPool* spdy_session_pool_; |
314 SpdySettingsStorage* spdy_settings_; | 318 SpdySettingsStorage* const spdy_settings_; |
315 | 319 |
316 // The socket handle for this session. | 320 // The socket handle for this session. |
317 scoped_ptr<ClientSocketHandle> connection_; | 321 scoped_ptr<ClientSocketHandle> connection_; |
318 | 322 |
319 // The read buffer used to read data from the socket. | 323 // The read buffer used to read data from the socket. |
320 scoped_refptr<IOBuffer> read_buffer_; | 324 scoped_refptr<IOBuffer> read_buffer_; |
321 bool read_pending_; | 325 bool read_pending_; |
322 | 326 |
323 int stream_hi_water_mark_; // The next stream id to use. | 327 int stream_hi_water_mark_; // The next stream id to use. |
324 | 328 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 394 |
391 BoundNetLog net_log_; | 395 BoundNetLog net_log_; |
392 | 396 |
393 static bool use_ssl_; | 397 static bool use_ssl_; |
394 static bool use_flow_control_; | 398 static bool use_flow_control_; |
395 }; | 399 }; |
396 | 400 |
397 } // namespace net | 401 } // namespace net |
398 | 402 |
399 #endif // NET_SPDY_SPDY_SESSION_H_ | 403 #endif // NET_SPDY_SPDY_SESSION_H_ |
OLD | NEW |