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_SOCKET_STREAM_SOCKET_STREAM_H_ | 5 #ifndef NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 }; | 213 }; |
214 | 214 |
215 typedef std::deque< scoped_refptr<IOBufferWithSize> > PendingDataQueue; | 215 typedef std::deque< scoped_refptr<IOBufferWithSize> > PendingDataQueue; |
216 | 216 |
217 friend class WebSocketThrottleTest; | 217 friend class WebSocketThrottleTest; |
218 | 218 |
219 // Copies the given addrinfo list in |addresses_|. | 219 // Copies the given addrinfo list in |addresses_|. |
220 // Used for WebSocketThrottleTest. | 220 // Used for WebSocketThrottleTest. |
221 void CopyAddrInfo(struct addrinfo* head); | 221 void CopyAddrInfo(struct addrinfo* head); |
222 | 222 |
| 223 void DoClose(); |
| 224 |
223 // Finishes the job. | 225 // Finishes the job. |
224 // Calls OnError and OnClose of delegate, and no more | 226 // Calls OnError and OnClose of delegate, and no more |
225 // notifications will be sent to delegate. | 227 // notifications will be sent to delegate. |
226 void Finish(int result); | 228 void Finish(int result); |
227 | 229 |
228 int DidEstablishConnection(); | 230 int DidEstablishConnection(); |
229 int DidReceiveData(int result); | 231 int DidReceiveData(int result); |
230 int DidSendData(int result); | 232 int DidSendData(int result); |
231 | 233 |
232 void OnIOCompleted(int result); | 234 void OnIOCompleted(int result); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 // |write_buf_| holds requested data and |current_write_buf_| is used | 316 // |write_buf_| holds requested data and |current_write_buf_| is used |
315 // for Write operation, that is, |current_write_buf_| is | 317 // for Write operation, that is, |current_write_buf_| is |
316 // |write_buf_| + |write_buf_offset_|. | 318 // |write_buf_| + |write_buf_offset_|. |
317 scoped_refptr<IOBuffer> write_buf_; | 319 scoped_refptr<IOBuffer> write_buf_; |
318 scoped_refptr<DrainableIOBuffer> current_write_buf_; | 320 scoped_refptr<DrainableIOBuffer> current_write_buf_; |
319 int write_buf_offset_; | 321 int write_buf_offset_; |
320 int write_buf_size_; | 322 int write_buf_size_; |
321 PendingDataQueue pending_write_bufs_; | 323 PendingDataQueue pending_write_bufs_; |
322 | 324 |
323 bool closing_; | 325 bool closing_; |
| 326 bool server_closed_; |
324 | 327 |
325 scoped_ptr<SocketStreamMetrics> metrics_; | 328 scoped_ptr<SocketStreamMetrics> metrics_; |
326 | 329 |
327 DISALLOW_COPY_AND_ASSIGN(SocketStream); | 330 DISALLOW_COPY_AND_ASSIGN(SocketStream); |
328 }; | 331 }; |
329 | 332 |
330 } // namespace net | 333 } // namespace net |
331 | 334 |
332 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 335 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
OLD | NEW |