OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Stream-based listen socket implementation that handles reading and writing | 5 // Stream-based listen socket implementation that handles reading and writing |
6 // to the socket, but does not handle creating the socket nor connecting | 6 // to the socket, but does not handle creating the socket nor connecting |
7 // sockets, which are handled by subclasses on creation and in Accept, | 7 // sockets, which are handled by subclasses on creation and in Accept, |
8 // respectively. | 8 // respectively. |
9 | 9 |
10 // StreamListenSocket handles IO asynchronously in the specified MessageLoop. | 10 // StreamListenSocket handles IO asynchronously in the specified MessageLoop. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 int send_pending_size_; | 140 int send_pending_size_; |
141 bool send_error_; | 141 bool send_error_; |
142 net::BackoffEntry send_backoff_; | 142 net::BackoffEntry send_backoff_; |
143 | 143 |
144 // Used to continue sending data asynchronously. | 144 // Used to continue sending data asynchronously. |
145 base::OneShotTimer<StreamListenSocket> send_timer_; | 145 base::OneShotTimer<StreamListenSocket> send_timer_; |
146 | 146 |
147 DISALLOW_COPY_AND_ASSIGN(StreamListenSocket); | 147 DISALLOW_COPY_AND_ASSIGN(StreamListenSocket); |
148 }; | 148 }; |
149 | 149 |
| 150 // Abstract factory that must be subclassed for each subclass of |
| 151 // StreamListenSocket. |
| 152 class NET_EXPORT StreamListenSocketFactory { |
| 153 public: |
| 154 virtual ~StreamListenSocketFactory() {} |
| 155 |
| 156 // Returns a new instance of StreamListenSocket or NULL if an error occurred. |
| 157 virtual scoped_refptr<StreamListenSocket> CreateAndListen( |
| 158 StreamListenSocket::Delegate* delegate) const = 0; |
| 159 }; |
| 160 |
150 } // namespace net | 161 } // namespace net |
151 | 162 |
152 #endif // NET_BASE_STREAM_LISTEN_SOCKET_H_ | 163 #endif // NET_BASE_STREAM_LISTEN_SOCKET_H_ |
OLD | NEW |