| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 public: | 29 public: |
| 30 // Caller retains the ownership of |net_log|. | 30 // Caller retains the ownership of |net_log|. |
| 31 TCPEngineTransport(const net::IPEndPoint& address, net::NetLog* net_log); | 31 TCPEngineTransport(const net::IPEndPoint& address, net::NetLog* net_log); |
| 32 ~TCPEngineTransport() override; | 32 ~TCPEngineTransport() override; |
| 33 | 33 |
| 34 // BlimpTransport implementation. | 34 // BlimpTransport implementation. |
| 35 void Connect(const net::CompletionCallback& callback) override; | 35 void Connect(const net::CompletionCallback& callback) override; |
| 36 std::unique_ptr<BlimpConnection> TakeConnection() override; | 36 std::unique_ptr<BlimpConnection> TakeConnection() override; |
| 37 const char* GetName() const override; | 37 const char* GetName() const override; |
| 38 | 38 |
| 39 int GetLocalAddressForTesting(net::IPEndPoint* address) const; | 39 int GetLocalAddress(net::IPEndPoint* address) const; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 void OnTCPConnectAccepted(int result); | 42 void OnTCPConnectAccepted(int result); |
| 43 | 43 |
| 44 const net::IPEndPoint address_; | 44 const net::IPEndPoint address_; |
| 45 net::NetLog* net_log_; | 45 net::NetLog* net_log_; |
| 46 std::unique_ptr<net::ServerSocket> server_socket_; | 46 std::unique_ptr<net::ServerSocket> server_socket_; |
| 47 std::unique_ptr<net::StreamSocket> accepted_socket_; | 47 std::unique_ptr<net::StreamSocket> accepted_socket_; |
| 48 net::CompletionCallback connect_callback_; | 48 net::CompletionCallback connect_callback_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(TCPEngineTransport); | 50 DISALLOW_COPY_AND_ASSIGN(TCPEngineTransport); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace blimp | 53 } // namespace blimp |
| 54 | 54 |
| 55 #endif // BLIMP_NET_TCP_ENGINE_TRANSPORT_H_ | 55 #endif // BLIMP_NET_TCP_ENGINE_TRANSPORT_H_ |
| OLD | NEW |