Don't add an aura tooltip to bubble close buttons on Windows.
[chromium-blink-merge.git] / net / socket / tcp_listen_socket.h
blobd87fd49bbd089e6a66109ce858273341c3df6c6f
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
3 // found in the LICENSE file.
5 #ifndef NET_SOCKET_TCP_LISTEN_SOCKET_H_
6 #define NET_SOCKET_TCP_LISTEN_SOCKET_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "net/base/net_export.h"
12 #include "net/socket/socket_descriptor.h"
13 #include "net/socket/stream_listen_socket.h"
15 namespace nacl {
16 class NaClProcessHost;
19 namespace net {
21 namespace test_server {
22 class EmbeddedTestServer;
25 // Implements a TCP socket. This class is deprecated and will be removed
26 // once crbug.com/472766 is fixed. There should not be any new consumer of this
27 // class.
28 class NET_EXPORT TCPListenSocket : public StreamListenSocket {
29 public:
30 ~TCPListenSocket() override;
32 protected:
33 TCPListenSocket(SocketDescriptor s, StreamListenSocket::Delegate* del);
35 // Implements StreamListenSocket::Accept.
36 void Accept() override;
38 private:
39 // Note that friend classes are temporary until crbug.com/472766 is fixed.
40 friend class test_server::EmbeddedTestServer;
41 friend class TCPListenSocketTester;
42 friend class TransportClientSocketTest;
43 friend class nacl::NaClProcessHost;
45 // Listen on port for the specified IP address. Use 127.0.0.1 to only
46 // accept local connections.
47 static scoped_ptr<TCPListenSocket> CreateAndListen(
48 const std::string& ip,
49 uint16 port,
50 StreamListenSocket::Delegate* del);
52 // Get raw TCP socket descriptor bound to ip:port.
53 static SocketDescriptor CreateAndBind(const std::string& ip, uint16 port);
55 // Get raw TCP socket descriptor bound to ip and return port it is bound to.
56 static SocketDescriptor CreateAndBindAnyPort(const std::string& ip,
57 uint16* port);
59 DISALLOW_COPY_AND_ASSIGN(TCPListenSocket);
62 } // namespace net
64 #endif // NET_SOCKET_TCP_LISTEN_SOCKET_H_