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

Unified Diff: blimp/net/blimp_message_receiver.h

Issue 1324263003: Blimp: create MessageDispatcher class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blimp-protos
Patch Set: Addressed wez's feedback. Created 5 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_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_

Powered by Google App Engine
This is Rietveld 408576698