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

Unified Diff: blimp/net/blimp_transport.h

Issue 2439403003: Refactor BlimpConnection to TCPConnection (Closed)
Patch Set: Sync merge 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/blimp_transport.h
diff --git a/blimp/net/blimp_transport.h b/blimp/net/blimp_transport.h
index 5d06632b2e9af0d5bc18c62f8af78c167922c177..6a7d9d5718e90d42eb64ce442707b31fbab3eb32 100644
--- a/blimp/net/blimp_transport.h
+++ b/blimp/net/blimp_transport.h
@@ -9,11 +9,11 @@
#include <string>
#include "net/base/completion_callback.h"
+#include "net/base/ip_endpoint.h"
namespace blimp {
class BlimpConnection;
-class MessagePort;
// An interface which encapsulates the transport-specific code for
// establishing network connections between the client and engine.
@@ -26,18 +26,27 @@ class BlimpTransport {
// Initiate or listen for a connection.
//
// |callback| is passed net::OK if a connection was successfully
- // established. The connection's MessagePort can then be taken by calling
- // TakeMessagePort().
+ // established.
// All other values indicate a connection error.
virtual void Connect(const net::CompletionCallback& callback) = 0;
- // Returns the MessagePort of a successfully established connection.
- virtual std::unique_ptr<MessagePort> TakeMessagePort() = 0;
+ // Creates a new |BlimpConnection| for the specific |BlimpTransport|
+ // implementation. Call this once the |Connect|'s callback returns net::OK.
Garrett Casto 2016/10/26 23:43:48 Nit: "Must not be called unless |callback| from Co
perumaal 2016/10/27 00:16:04 Good point.
+ virtual std::unique_ptr<BlimpConnection> MakeConnection() = 0;
// Gets the transport name, e.g. "TCP", "SSL", "mock", etc.
virtual const char* GetName() const = 0;
};
+// Interface specific to engine transport on top of generic |BlimpTransport|.
+class BlimpEngineTransport : public BlimpTransport {
Garrett Casto 2016/10/26 23:43:48 Given the rest of this directory, I would assume t
perumaal 2016/10/27 00:16:05 Done.
+ public:
+ ~BlimpEngineTransport() override {}
+
+ // Obtains the local listening address.
+ virtual void GetLocalAddress(net::IPEndPoint* ip_address) const = 0;
+};
+
} // namespace blimp
#endif // BLIMP_NET_BLIMP_TRANSPORT_H_

Powered by Google App Engine
This is Rietveld 408576698