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

Unified Diff: blimp/net/helium/helium_transport.h

Issue 2383533003: Blimp: define HeliumTransport/HeliumStream interfaces. (Closed)
Patch Set: Created 4 years, 3 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
« blimp/net/helium/helium_stream.h ('K') | « blimp/net/helium/helium_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/helium/helium_transport.h
diff --git a/blimp/net/helium/helium_transport.h b/blimp/net/helium/helium_transport.h
new file mode 100644
index 0000000000000000000000000000000000000000..42d9029dc6fe11614a75f0166200e9b46e8cdabc
--- /dev/null
+++ b/blimp/net/helium/helium_transport.h
@@ -0,0 +1,33 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BLIMP_NET_HELIUM_HELIUM_TRANSPORT_H_
+#define BLIMP_NET_HELIUM_HELIUM_TRANSPORT_H_
+
+#include <memory>
+
+#include "base/callback.h"
+
+namespace blimp {
+
+// Abstract interface for a HeliumStream factory. Subclasses can use this
+// interface to encapsulate transport-specific connection semantics.
+class HeliumTransport {
perumaal 2016/09/29 19:13:50 Just to make sure. Would this initially wrap a Bli
Kevin M 2016/09/29 21:18:40 That's a possibility, then we'd have a HeliumStrea
+ public:
+ // The HeliumStream is assumed to be authenticated and ready to use.
+ // |stream| is nullptr if the connection attempt failed.
+ using ConnectCallback =
+ base::Callback<void(std::unique_ptr<HeliumStream> stream)>;
+
+ // Asynchronously attempts to connect a new HeliumStream.
+ virtual void Connect(const ConnectCallback& connect_cb) = 0;
scf 2016/09/29 19:12:22 does it allow many calls to the Connect on the sam
Kevin M 2016/09/29 21:18:40 Yes; there is no FIFO ordering constraint like the
+
+ // Returns true if the underlying transport has the necessary resources (e.g.
+ // network connectivity) to Connect() new streams.
+ virtual bool IsAvailable() = 0;
+};
+
+} // namespace blimp
+
+#endif // BLIMP_NET_HELIUM_HELIUM_TRANSPORT_H_
« blimp/net/helium/helium_stream.h ('K') | « blimp/net/helium/helium_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698