Index: blimp/net/blimp_message_receiver.h |
diff --git a/blimp/net/blimp_message_receiver.h b/blimp/net/blimp_message_receiver.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..170e7dfd3e1186c5055e316f637e278b80456b44 |
--- /dev/null |
+++ b/blimp/net/blimp_message_receiver.h |
@@ -0,0 +1,27 @@ |
+// Copyright 2015 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_BLIMP_MESSAGE_RECEIVER_H_ |
+#define BLIMP_NET_BLIMP_MESSAGE_RECEIVER_H_ |
+ |
+namespace blimp { |
+ |
+class BlimpMessage; |
+ |
+// Abstract interface for classes that can receive BlimpMessages. |
Wez
2015/10/09 23:15:34
nit: I can see it's abstract; suggest just "Interf
Kevin M
2015/10/10 00:42:34
Done.
|
+class BlimpMessageReceiver { |
+ public: |
+ virtual ~BlimpMessageReceiver() {} |
+ |
+ // Receives |message| for processing. |
+ // The handler is responsible for routing the call through the appropriate |
+ // thread. |
+ // Method will return false if |message| is invalid, which should cause the |
+ // connection to be terminated. |
Wez
2015/10/09 23:15:35
nit: Make clear that the caller needs to terminate
Kevin M
2015/10/10 00:42:34
Done.
|
+ virtual bool OnMessage(const BlimpMessage& message) = 0; |
Wez
2015/10/09 23:15:34
nit: OnBlimpMessage, for consistency, and 'cos OnM
Kevin M
2015/10/10 00:42:34
Done.
|
+}; |
+ |
+} // namespace blimp |
+ |
+#endif // BLIMP_NET_BLIMP_MESSAGE_RECEIVER_H_ |