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

Unified Diff: blimp/net/blimp_connection.h

Issue 1429193002: Add interfaces for most major Blimp net components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Import multiplexer changes from 1434533005 Created 5 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 side-by-side diff with in-line comments
Download patch
Index: blimp/net/blimp_connection.h
diff --git a/blimp/net/blimp_connection.h b/blimp/net/blimp_connection.h
index 35336c4f28e8267904a3055c396bdbf2e2a4dd42..e8a086d12ac367f2a721ca659141d1757a922d3e 100644
--- a/blimp/net/blimp_connection.h
+++ b/blimp/net/blimp_connection.h
@@ -6,15 +6,38 @@
#define BLIMP_NET_BLIMP_CONNECTION_H_
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "blimp/net/blimp_net_export.h"
namespace blimp {
+class BlimpMessageProcessor;
+
+// Encapsulates the state and logic used to exchange BlimpMessages over
+// a network connection.
class BLIMP_NET_EXPORT BlimpConnection {
public:
+ class DisconnectObserver {
+ // Called when the network connection for |this| is disconnected.
+ virtual void OnDisconnected() = 0;
+ };
+
BlimpConnection();
+
~BlimpConnection();
+ // Lets |observer| know when the network connection is terminated.
+ void AddDisconnectObserver(const DisconnectObserver& observer);
Wez 2015/11/12 00:12:53 Strange to have |observer| passed as a const refer
Kevin M 2015/11/12 01:53:15 Good find, it should be a non-const pointer. Done
+
+ // Sets the processor for BlimpConnection->BrowserSession message routing.
Wez 2015/11/12 00:12:53 This class doesn't know anything about BrowserSess
Kevin M 2015/11/12 01:53:16 Done.
+ // Only one can be set a time. Can be set multiple times, but previously set
+ // incoming message processors are discarded.
+ void set_incoming_message_processor(
+ scoped_ptr<BlimpMessageProcessor> processor);
+
+ // Gets a processor for BrowserSession->BlimpConnection message routing.
+ scoped_ptr<BlimpMessageProcessor> take_outgoing_message_processor() const;
+
private:
DISALLOW_COPY_AND_ASSIGN(BlimpConnection);
};

Powered by Google App Engine
This is Rietveld 408576698