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

Side by Side Diff: blimp/net/tcp_client_transport.h

Issue 2439403003: Refactor BlimpConnection to TCPConnection (Closed)
Patch Set: Added missing Engine Transport Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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_CLIENT_TRANSPORT_H_ 5 #ifndef BLIMP_NET_TCP_CLIENT_TRANSPORT_H_
6 #define BLIMP_NET_TCP_CLIENT_TRANSPORT_H_ 6 #define BLIMP_NET_TCP_CLIENT_TRANSPORT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 19 matching lines...) Expand all
30 class BLIMP_NET_EXPORT TCPClientTransport : public BlimpTransport { 30 class BLIMP_NET_EXPORT TCPClientTransport : public BlimpTransport {
31 public: 31 public:
32 TCPClientTransport(const net::IPEndPoint& ip_endpoint, 32 TCPClientTransport(const net::IPEndPoint& ip_endpoint,
33 net::NetLog* net_log); 33 net::NetLog* net_log);
34 ~TCPClientTransport() override; 34 ~TCPClientTransport() override;
35 35
36 void SetClientSocketFactoryForTest(net::ClientSocketFactory* factory); 36 void SetClientSocketFactoryForTest(net::ClientSocketFactory* factory);
37 37
38 // BlimpTransport implementation. 38 // BlimpTransport implementation.
39 void Connect(const net::CompletionCallback& callback) override; 39 void Connect(const net::CompletionCallback& callback) override;
40 std::unique_ptr<MessagePort> TakeMessagePort() override; 40 std::unique_ptr<BlimpConnection> MakeConnection() override;
41
42 std::unique_ptr<MessagePort> TakeMessagePort();
Wez 2016/11/09 22:47:17 nit: Please add a comment to clarify why this is h
43
41 const char* GetName() const override; 44 const char* GetName() const override;
42 45
43 protected: 46 protected:
44 // Called when the TCP connection completed. 47 // Called when the TCP connection completed.
45 virtual void OnTCPConnectComplete(int result); 48 virtual void OnTCPConnectComplete(int result);
46 49
47 // Called when the connection attempt completed or failed. 50 // Called when the connection attempt completed or failed.
48 // Resets |socket_| if |result| indicates a failure (!= net::OK). 51 // Resets |socket_| if |result| indicates a failure (!= net::OK).
49 void OnConnectComplete(int result); 52 void OnConnectComplete(int result);
50 53
(...skipping 11 matching lines...) Expand all
62 net::CompletionCallback connect_callback_; 65 net::CompletionCallback connect_callback_;
63 net::ClientSocketFactory* socket_factory_ = nullptr; 66 net::ClientSocketFactory* socket_factory_ = nullptr;
64 std::unique_ptr<net::StreamSocket> socket_; 67 std::unique_ptr<net::StreamSocket> socket_;
65 68
66 DISALLOW_COPY_AND_ASSIGN(TCPClientTransport); 69 DISALLOW_COPY_AND_ASSIGN(TCPClientTransport);
67 }; 70 };
68 71
69 } // namespace blimp 72 } // namespace blimp
70 73
71 #endif // BLIMP_NET_TCP_CLIENT_TRANSPORT_H_ 74 #endif // BLIMP_NET_TCP_CLIENT_TRANSPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698