OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BLIMP_NET_TCP_ENGINE_TRANSPORT_H_ | 5 #ifndef BLIMP_NET_TCP_ENGINE_TRANSPORT_H_ |
6 #define BLIMP_NET_TCP_ENGINE_TRANSPORT_H_ | 6 #define BLIMP_NET_TCP_ENGINE_TRANSPORT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // BlimpTransport which listens for a TCP connection at |address|. | 26 // BlimpTransport which listens for a TCP connection at |address|. |
27 class BLIMP_NET_EXPORT TCPEngineTransport : public BlimpTransport { | 27 class BLIMP_NET_EXPORT TCPEngineTransport : public BlimpTransport { |
28 public: | 28 public: |
29 // Caller retains the ownership of |net_log|. | 29 // Caller retains the ownership of |net_log|. |
30 TCPEngineTransport(const net::IPEndPoint& address, net::NetLog* net_log); | 30 TCPEngineTransport(const net::IPEndPoint& address, net::NetLog* net_log); |
31 ~TCPEngineTransport() override; | 31 ~TCPEngineTransport() override; |
32 | 32 |
33 // BlimpTransport implementation. | 33 // BlimpTransport implementation. |
34 void Connect(const net::CompletionCallback& callback) override; | 34 void Connect(const net::CompletionCallback& callback) override; |
35 scoped_ptr<BlimpConnection> TakeConnection() override; | 35 scoped_ptr<BlimpConnection> TakeConnection() override; |
36 const std::string GetName() const override; | 36 const char* GetName() const override; |
37 | 37 |
38 int GetLocalAddressForTesting(net::IPEndPoint* address) const; | 38 int GetLocalAddressForTesting(net::IPEndPoint* address) const; |
39 | 39 |
40 private: | 40 private: |
41 void OnTCPConnectAccepted(int result); | 41 void OnTCPConnectAccepted(int result); |
42 | 42 |
43 const net::IPEndPoint address_; | 43 const net::IPEndPoint address_; |
44 net::NetLog* net_log_; | 44 net::NetLog* net_log_; |
45 scoped_ptr<net::ServerSocket> server_socket_; | 45 scoped_ptr<net::ServerSocket> server_socket_; |
46 scoped_ptr<net::StreamSocket> accepted_socket_; | 46 scoped_ptr<net::StreamSocket> accepted_socket_; |
47 net::CompletionCallback connect_callback_; | 47 net::CompletionCallback connect_callback_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(TCPEngineTransport); | 49 DISALLOW_COPY_AND_ASSIGN(TCPEngineTransport); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace blimp | 52 } // namespace blimp |
53 | 53 |
54 #endif // BLIMP_NET_TCP_ENGINE_TRANSPORT_H_ | 54 #endif // BLIMP_NET_TCP_ENGINE_TRANSPORT_H_ |
OLD | NEW |