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

Unified Diff: remoting/protocol/client_message_dispatcher.h

Issue 6030007: Chromoting protocol layers to receive and send login messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments Created 10 years 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
« no previous file with comments | « remoting/protocol/client_control_sender.cc ('k') | remoting/protocol/client_message_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/client_message_dispatcher.h
diff --git a/remoting/protocol/client_message_dispatcher.h b/remoting/protocol/client_message_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..cad48e4e6d4afe0add6e58e3b333bdbc5822df74
--- /dev/null
+++ b/remoting/protocol/client_message_dispatcher.h
@@ -0,0 +1,61 @@
+// Copyright (c) 2010 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 REMOTING_PROTOCOL_CLIENT_MESSAGE_DISPATCHER_H_
+#define REMOTING_PROTOCOL_CLIENT_MESSAGE_DISPATCHER_H_
+
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+#include "base/task.h"
+
+namespace remoting {
+
+class EventMessage;
+
+namespace protocol {
+
+class ClientStub;
+class ControlMessage;
+class InputStub;
+class MessageReader;
+class Session;
+
+// A message dispatcher used to listen for messages received in
+// protocol::Session. It dispatches messages to the corresponding
+// handler.
+//
+// Internally it contains an EventStreamReader that decodes data on
+// communications channels into protocol buffer messages.
+// EventStreamReader is registered with protocol::Session given to it.
+//
+// Object of this class is owned by ConnectionToHost.
+class ClientMessageDispatcher {
+ public:
+ // Construct a message dispatcher.
+ ClientMessageDispatcher();
+ virtual ~ClientMessageDispatcher();
+
+ // Initialize the message dispatcher with the given connection and
+ // message handlers.
+ void Initialize(protocol::Session* session, ClientStub* client_stub);
+
+ private:
+ void OnControlMessageReceived(ControlMessage* message);
+
+ // MessageReader that runs on the control channel. It runs a loop
+ // that parses data on the channel and then calls the corresponding handler
+ // in this class.
+ scoped_ptr<MessageReader> control_message_reader_;
+
+ // Stubs for client and input. These objects are not owned.
+ // They are called on the thread there data is received, i.e. jingle thread.
+ ClientStub* client_stub_;
+
+ DISALLOW_COPY_AND_ASSIGN(ClientMessageDispatcher);
+};
+
+} // namespace protocol
+} // namespace remoting
+
+#endif // REMOTING_PROTOCOL_CLIENT_MESSAGE_DISPATCHER_H_
« no previous file with comments | « remoting/protocol/client_control_sender.cc ('k') | remoting/protocol/client_message_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698