| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "net/spdy/spdy_io_buffer.h" | 25 #include "net/spdy/spdy_io_buffer.h" |
| 26 #include "net/spdy/spdy_protocol.h" | 26 #include "net/spdy/spdy_protocol.h" |
| 27 #include "net/spdy/spdy_session_pool.h" | 27 #include "net/spdy/spdy_session_pool.h" |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 | 30 |
| 31 class SpdyStream; | 31 class SpdyStream; |
| 32 class HttpNetworkSession; | 32 class HttpNetworkSession; |
| 33 class HttpRequestInfo; | 33 class HttpRequestInfo; |
| 34 class HttpResponseInfo; | 34 class HttpResponseInfo; |
| 35 class LoadLog; | 35 class BoundNetLog; |
| 36 class SSLInfo; | 36 class SSLInfo; |
| 37 | 37 |
| 38 class SpdySession : public base::RefCounted<SpdySession>, | 38 class SpdySession : public base::RefCounted<SpdySession>, |
| 39 public spdy::SpdyFramerVisitorInterface { | 39 public spdy::SpdyFramerVisitorInterface { |
| 40 public: | 40 public: |
| 41 const HostPortPair& host_port_pair() const { return host_port_pair_; } | 41 const HostPortPair& host_port_pair() const { return host_port_pair_; } |
| 42 | 42 |
| 43 // Connect the Spdy Socket. | 43 // Connect the Spdy Socket. |
| 44 // Returns net::Error::OK on success. | 44 // Returns net::Error::OK on success. |
| 45 // Note that this call does not wait for the connect to complete. Callers can | 45 // Note that this call does not wait for the connect to complete. Callers can |
| 46 // immediately start using the SpdySession while it connects. | 46 // immediately start using the SpdySession while it connects. |
| 47 net::Error Connect(const std::string& group_name, | 47 net::Error Connect(const std::string& group_name, |
| 48 const TCPSocketParams& destination, | 48 const TCPSocketParams& destination, |
| 49 RequestPriority priority, | 49 RequestPriority priority, |
| 50 LoadLog* load_log); | 50 const BoundNetLog& net_log); |
| 51 | 51 |
| 52 // Get a stream for a given |request|. In the typical case, this will involve | 52 // Get a stream for a given |request|. In the typical case, this will involve |
| 53 // the creation of a new stream (and will send the SYN frame). If the server | 53 // the creation of a new stream (and will send the SYN frame). If the server |
| 54 // initiates a stream, it might already exist for a given path. The server | 54 // initiates a stream, it might already exist for a given path. The server |
| 55 // might also not have initiated the stream yet, but indicated it will via | 55 // might also not have initiated the stream yet, but indicated it will via |
| 56 // X-Associated-Content. | 56 // X-Associated-Content. |
| 57 // Returns the new or existing stream. Never returns NULL. | 57 // Returns the new or existing stream. Never returns NULL. |
| 58 scoped_refptr<SpdyStream> GetOrCreateStream(const HttpRequestInfo& request, | 58 scoped_refptr<SpdyStream> GetOrCreateStream(const HttpRequestInfo& request, |
| 59 const UploadDataStream* upload_data, LoadLog* log); | 59 const UploadDataStream* upload_data, const BoundNetLog& log); |
| 60 | 60 |
| 61 // Write a data frame to the stream. | 61 // Write a data frame to the stream. |
| 62 // Used to create and queue a data frame for the given stream. | 62 // Used to create and queue a data frame for the given stream. |
| 63 int WriteStreamData(spdy::SpdyStreamId stream_id, net::IOBuffer* data, | 63 int WriteStreamData(spdy::SpdyStreamId stream_id, net::IOBuffer* data, |
| 64 int len); | 64 int len); |
| 65 | 65 |
| 66 // Cancel a stream. | 66 // Cancel a stream. |
| 67 bool CancelStream(spdy::SpdyStreamId stream_id); | 67 bool CancelStream(spdy::SpdyStreamId stream_id); |
| 68 | 68 |
| 69 // Check if a stream is active. | 69 // Check if a stream is active. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 int streams_pushed_count_; | 228 int streams_pushed_count_; |
| 229 int streams_pushed_and_claimed_count_; | 229 int streams_pushed_and_claimed_count_; |
| 230 int streams_abandoned_count_; | 230 int streams_abandoned_count_; |
| 231 | 231 |
| 232 static bool use_ssl_; | 232 static bool use_ssl_; |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 } // namespace net | 235 } // namespace net |
| 236 | 236 |
| 237 #endif // NET_SPDY_SPDY_SESSION_H_ | 237 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |