| 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> |
| 11 #include <queue> | 11 #include <queue> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/ref_counted.h" | 14 #include "base/ref_counted.h" |
| 15 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
| 16 #include "net/base/load_states.h" | 16 #include "net/base/load_states.h" |
| 17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
| 18 #include "net/base/request_priority.h" | 18 #include "net/base/request_priority.h" |
| 19 #include "net/base/ssl_config_service.h" | 19 #include "net/base/ssl_config_service.h" |
| 20 #include "net/base/upload_data_stream.h" | 20 #include "net/base/upload_data_stream.h" |
| 21 #include "net/socket/client_socket.h" | 21 #include "net/socket/client_socket.h" |
| 22 #include "net/socket/client_socket_handle.h" | 22 #include "net/socket/client_socket_handle.h" |
| 23 #include "testing/platform_test.h" | 23 #include "net/socket/tcp_client_socket_pool.h" |
| 24 #include "net/spdy/spdy_framer.h" | 24 #include "net/spdy/spdy_framer.h" |
| 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 LoadLog; |
| 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 HostResolver::RequestInfo& host, | 48 const TCPSocketParams& destination, |
| 49 RequestPriority priority, | 49 RequestPriority priority, |
| 50 LoadLog* load_log); | 50 LoadLog* load_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, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 int streams_pushed_count_; | 227 int streams_pushed_count_; |
| 228 int streams_pushed_and_claimed_count_; | 228 int streams_pushed_and_claimed_count_; |
| 229 int streams_abandoned_count_; | 229 int streams_abandoned_count_; |
| 230 | 230 |
| 231 static bool use_ssl_; | 231 static bool use_ssl_; |
| 232 }; | 232 }; |
| 233 | 233 |
| 234 } // namespace net | 234 } // namespace net |
| 235 | 235 |
| 236 #endif // NET_SPDY_SPDY_SESSION_H_ | 236 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |