Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: net/base/tcp_listen_socket.h

Issue 10386048: Decouple DevTools from socket implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Matt's comments Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698