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

Unified Diff: blimp/net/engine_connection_manager.h

Issue 2439403003: Refactor BlimpConnection to TCPConnection (Closed)
Patch Set: Added missing Engine Transport Created 4 years, 2 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: blimp/net/engine_connection_manager.h
diff --git a/blimp/net/engine_connection_manager.h b/blimp/net/engine_connection_manager.h
index 9fe04168233d9e7cb27d40f56086ce0eefe44e84..c75fbca7c68d84d8b7bbd433bbd90313fe3cf83f 100644
--- a/blimp/net/engine_connection_manager.h
+++ b/blimp/net/engine_connection_manager.h
@@ -12,11 +12,14 @@
#include "base/macros.h"
#include "blimp/net/blimp_net_export.h"
#include "blimp/net/connection_handler.h"
+#include "net/base/ip_endpoint.h"
+#include "net/log/net_log.h"
namespace blimp {
class BlimpConnection;
class BlimpTransport;
+class BlimpEngineTransport;
// Coordinates the channel creation and authentication workflows for
// incoming (Engine) network connections.
@@ -24,26 +27,29 @@ class BlimpTransport;
// TODO(kmarshall): Add rate limiting and abuse handling logic.
class BLIMP_NET_EXPORT EngineConnectionManager {
Wez 2016/11/09 22:47:17 This class, as per the comment, was intended to be
perumaal 2016/11/10 02:05:05 Kevin and I talked about this specifically. One co
public:
+ enum class EngineTransportType { TCP, GRPC };
+
// Caller is responsible for ensuring that |connection_handler| outlives
// |this|.
- explicit EngineConnectionManager(ConnectionHandler* connection_handler);
+ explicit EngineConnectionManager(ConnectionHandler* connection_handler,
+ net::NetLog* net_log);
~EngineConnectionManager();
// Adds a transport and accepts new BlimpConnections from it as fast as they
- // arrive.
- void AddTransport(std::unique_ptr<BlimpTransport> transport);
+ // arrive. The |ip_endpoint| will receive the actual port-number if the
+ // provided one is not available for listening.
+ void ConnectTransport(net::IPEndPoint* ip_endpoint,
Wez 2016/11/09 22:47:17 Let's not have in/out parameters. We can add a ge
perumaal 2016/11/10 02:05:05 I had it that way actually initially. The problem
+ EngineTransportType transport_type);
private:
- // Invokes transport->Connect to listen for a connection.
- void Connect(BlimpTransport* transport);
-
// Callback invoked by |transport| to indicate that it has a connection
// ready to be authenticated.
void OnConnectResult(BlimpTransport* transport, int result);
ConnectionHandler* connection_handler_;
- std::vector<std::unique_ptr<BlimpTransport>> transports_;
+ net::NetLog* net_log_;
+ std::unique_ptr<BlimpEngineTransport> transport_;
DISALLOW_COPY_AND_ASSIGN(EngineConnectionManager);
};

Powered by Google App Engine
This is Rietveld 408576698