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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // initiates a stream, it might already exist for a given path. The server | 64 // initiates a stream, it might already exist for a given path. The server |
65 // might also not have initiated the stream yet, but indicated it will via | 65 // might also not have initiated the stream yet, but indicated it will via |
66 // X-Associated-Content. | 66 // X-Associated-Content. |
67 // Returns the new or existing stream. Never returns NULL. | 67 // Returns the new or existing stream. Never returns NULL. |
68 scoped_refptr<SpdyHttpStream> GetOrCreateStream( | 68 scoped_refptr<SpdyHttpStream> GetOrCreateStream( |
69 const HttpRequestInfo& request, | 69 const HttpRequestInfo& request, |
70 const UploadDataStream* upload_data, | 70 const UploadDataStream* upload_data, |
71 const BoundNetLog& stream_net_log); | 71 const BoundNetLog& stream_net_log); |
72 | 72 |
73 // Used by SpdySessionPool to initialize with a pre-existing SSL socket. | 73 // Used by SpdySessionPool to initialize with a pre-existing SSL socket. |
74 void InitializeWithSSLSocket(ClientSocketHandle* connection); | 74 // Returns OK on success, or an error on failure. |
| 75 net::Error InitializeWithSSLSocket(ClientSocketHandle* connection); |
75 | 76 |
76 // Write a data frame to the stream. | 77 // Write a data frame to the stream. |
77 // Used to create and queue a data frame for the given stream. | 78 // Used to create and queue a data frame for the given stream. |
78 int WriteStreamData(spdy::SpdyStreamId stream_id, net::IOBuffer* data, | 79 int WriteStreamData(spdy::SpdyStreamId stream_id, net::IOBuffer* data, |
79 int len); | 80 int len); |
80 | 81 |
81 // Close a stream. | 82 // Close a stream. |
82 void CloseStream(spdy::SpdyStreamId stream_id, int status); | 83 void CloseStream(spdy::SpdyStreamId stream_id, int status); |
83 | 84 |
84 // Check if a stream is active. | 85 // Check if a stream is active. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // IO Callbacks | 135 // IO Callbacks |
135 void OnTCPConnect(int result); | 136 void OnTCPConnect(int result); |
136 void OnSSLConnect(int result); | 137 void OnSSLConnect(int result); |
137 void OnReadComplete(int result); | 138 void OnReadComplete(int result); |
138 void OnWriteComplete(int result); | 139 void OnWriteComplete(int result); |
139 | 140 |
140 // Send relevant SETTINGS. This is generally called on connection setup. | 141 // Send relevant SETTINGS. This is generally called on connection setup. |
141 void SendSettings(); | 142 void SendSettings(); |
142 | 143 |
143 // Start reading from the socket. | 144 // Start reading from the socket. |
144 void ReadSocket(); | 145 // Returns OK on success, or an error on failure. |
| 146 net::Error ReadSocket(); |
145 | 147 |
146 // Write current data to the socket. | 148 // Write current data to the socket. |
147 void WriteSocketLater(); | 149 void WriteSocketLater(); |
148 void WriteSocket(); | 150 void WriteSocket(); |
149 | 151 |
150 // Get a new stream id. | 152 // Get a new stream id. |
151 int GetNewStreamId(); | 153 int GetNewStreamId(); |
152 | 154 |
153 // Queue a frame for sending. | 155 // Queue a frame for sending. |
154 // |frame| is the frame to send. | 156 // |frame| is the frame to send. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 bool in_session_pool_; // True if the session is currently in the pool. | 263 bool in_session_pool_; // True if the session is currently in the pool. |
262 | 264 |
263 BoundNetLog net_log_; | 265 BoundNetLog net_log_; |
264 | 266 |
265 static bool use_ssl_; | 267 static bool use_ssl_; |
266 }; | 268 }; |
267 | 269 |
268 } // namespace net | 270 } // namespace net |
269 | 271 |
270 #endif // NET_SPDY_SPDY_SESSION_H_ | 272 #endif // NET_SPDY_SPDY_SESSION_H_ |
OLD | NEW |