Index: net/base/tcp_listen_socket.h |
diff --git a/net/base/tcp_listen_socket.h b/net/base/tcp_listen_socket.h |
index fed1df36689d7b2f67a8728a4af981b7ff3a614b..caab8f7d38a834fc27136ac4bcf8f1d47e9677b9 100644 |
--- a/net/base/tcp_listen_socket.h |
+++ b/net/base/tcp_listen_socket.h |
@@ -25,8 +25,6 @@ class NET_EXPORT TCPListenSocket : public StreamListenSocket { |
static scoped_refptr<TCPListenSocket> CreateAndListen( |
const std::string& ip, int port, StreamListenSocket::Delegate* del); |
- virtual ~TCPListenSocket(); |
- |
protected: |
TCPListenSocket(SOCKET s, StreamListenSocket::Delegate* del); |
@@ -36,9 +34,29 @@ class NET_EXPORT TCPListenSocket : public StreamListenSocket { |
virtual void Accept() OVERRIDE; |
private: |
+ friend class scoped_refptr<TCPListenSocket>; |
+ virtual ~TCPListenSocket(); |
+ |
DISALLOW_COPY_AND_ASSIGN(TCPListenSocket); |
}; |
+// Factory that can be used to instantiate TCPListenSocket. |
+class TCPListenSocketFactory : public StreamListenSocketFactory { |
+ public: |
+ TCPListenSocketFactory(const std::string& ip, int port); |
+ virtual ~TCPListenSocketFactory(); |
+ |
+ // StreamListenSocketFactory overrides. |
+ virtual scoped_refptr<StreamListenSocket> CreateAndListen( |
+ StreamListenSocket::Delegate* delegate) const OVERRIDE; |
+ |
+ private: |
+ const std::string ip_; |
+ const int port_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TCPListenSocketFactory); |
+}; |
+ |
} // namespace net |
#endif // NET_BASE_TCP_LISTEN_SOCKET_H_ |