Chromium Code Reviews| 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_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> |
| 11 #include <map> | 11 #include <map> |
| 12 #include <queue> | 12 #include <queue> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
|
mmenke
2012/01/23 20:07:56
nit: Remove this, too? Or update year, since it
eroman
2012/01/23 22:04:15
Are you referring to the copyright line? updated t
mmenke1
2012/01/23 22:09:05
Sorry, I just blindly compared the diffs. What I
| |
| 19 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
| 20 #include "net/base/load_states.h" | 20 #include "net/base/load_states.h" |
| 21 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
| 22 #include "net/base/net_log.h" | 22 #include "net/base/net_log.h" |
| 23 #include "net/base/request_priority.h" | 23 #include "net/base/request_priority.h" |
| 24 #include "net/base/ssl_config_service.h" | 24 #include "net/base/ssl_config_service.h" |
| 25 #include "net/base/upload_data_stream.h" | 25 #include "net/base/upload_data_stream.h" |
| 26 #include "net/socket/client_socket_handle.h" | 26 #include "net/socket/client_socket_handle.h" |
| 27 #include "net/socket/ssl_client_socket.h" | 27 #include "net/socket/ssl_client_socket.h" |
| 28 #include "net/socket/stream_socket.h" | 28 #include "net/socket/stream_socket.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 39 // ACKs quickly from TCP (because TCP tries to only ACK every other packet). | 39 // ACKs quickly from TCP (because TCP tries to only ACK every other packet). |
| 40 const int kMss = 1430; | 40 const int kMss = 1430; |
| 41 const int kMaxSpdyFrameChunkSize = (2 * kMss) - spdy::SpdyFrame::kHeaderSize; | 41 const int kMaxSpdyFrameChunkSize = (2 * kMss) - spdy::SpdyFrame::kHeaderSize; |
| 42 | 42 |
| 43 class BoundNetLog; | 43 class BoundNetLog; |
| 44 class SpdySettingsStorage; | 44 class SpdySettingsStorage; |
| 45 class SpdyStream; | 45 class SpdyStream; |
| 46 class SSLInfo; | 46 class SSLInfo; |
| 47 | 47 |
| 48 class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, | 48 class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, |
| 49 public spdy::BufferedSpdyFramerVisitorInterface, | 49 public spdy::BufferedSpdyFramerVisitorInterface { |
| 50 public LayeredPool { | |
| 51 public: | 50 public: |
| 52 // Create a new SpdySession. | 51 // Create a new SpdySession. |
| 53 // |host_port_proxy_pair| is the host/port that this session connects to, and | 52 // |host_port_proxy_pair| is the host/port that this session connects to, and |
| 54 // the proxy configuration settings that it's using. | 53 // the proxy configuration settings that it's using. |
| 55 // |spdy_session_pool| is the SpdySessionPool that owns us. Its lifetime must | 54 // |spdy_session_pool| is the SpdySessionPool that owns us. Its lifetime must |
| 56 // strictly be greater than |this|. | 55 // strictly be greater than |this|. |
| 57 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log | 56 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log |
| 58 // network events to. | 57 // network events to. |
| 59 SpdySession(const HostPortProxyPair& host_port_proxy_pair, | 58 SpdySession(const HostPortProxyPair& host_port_proxy_pair, |
| 60 SpdySessionPool* spdy_session_pool, | 59 SpdySessionPool* spdy_session_pool, |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 // Returns true if flow control is enabled for the session. | 229 // Returns true if flow control is enabled for the session. |
| 231 bool is_flow_control_enabled() const { | 230 bool is_flow_control_enabled() const { |
| 232 return flow_control_; | 231 return flow_control_; |
| 233 } | 232 } |
| 234 | 233 |
| 235 const BoundNetLog& net_log() const { return net_log_; } | 234 const BoundNetLog& net_log() const { return net_log_; } |
| 236 | 235 |
| 237 int GetPeerAddress(AddressList* address) const; | 236 int GetPeerAddress(AddressList* address) const; |
| 238 int GetLocalAddress(IPEndPoint* address) const; | 237 int GetLocalAddress(IPEndPoint* address) const; |
| 239 | 238 |
| 240 // LayeredPool implementation. | |
| 241 virtual bool CloseOneIdleConnection() OVERRIDE; | |
| 242 | |
| 243 private: | 239 private: |
| 244 friend class base::RefCounted<SpdySession>; | 240 friend class base::RefCounted<SpdySession>; |
| 245 | 241 |
| 246 // Allow tests to access our innards for testing purposes. | 242 // Allow tests to access our innards for testing purposes. |
| 247 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, Ping); | 243 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, Ping); |
| 248 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, FailedPing); | 244 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, FailedPing); |
| 249 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, GetActivePushStream); | 245 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, GetActivePushStream); |
| 250 | 246 |
| 251 struct PendingCreateStream { | 247 struct PendingCreateStream { |
| 252 PendingCreateStream(const GURL& url, RequestPriority priority, | 248 PendingCreateStream(const GURL& url, RequestPriority priority, |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 638 const spdy::SpdyControlFlags flags_; | 634 const spdy::SpdyControlFlags flags_; |
| 639 const spdy::SpdyStreamId id_; | 635 const spdy::SpdyStreamId id_; |
| 640 const spdy::SpdyStreamId associated_stream_; | 636 const spdy::SpdyStreamId associated_stream_; |
| 641 | 637 |
| 642 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); | 638 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); |
| 643 }; | 639 }; |
| 644 | 640 |
| 645 } // namespace net | 641 } // namespace net |
| 646 | 642 |
| 647 #endif // NET_SPDY_SPDY_SESSION_H_ | 643 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |