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

Side by Side Diff: remoting/protocol/client_message_dispatcher.h

Issue 6271004: Changed MessageReader so that it doesn't read from the socket if there are (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ref-counted MessageReader Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/proto/internal.proto ('k') | remoting/protocol/client_message_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_PROTOCOL_CLIENT_MESSAGE_DISPATCHER_H_ 5 #ifndef REMOTING_PROTOCOL_CLIENT_MESSAGE_DISPATCHER_H_
6 #define REMOTING_PROTOCOL_CLIENT_MESSAGE_DISPATCHER_H_ 6 #define REMOTING_PROTOCOL_CLIENT_MESSAGE_DISPATCHER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 22 matching lines...) Expand all
33 public: 33 public:
34 // Construct a message dispatcher. 34 // Construct a message dispatcher.
35 ClientMessageDispatcher(); 35 ClientMessageDispatcher();
36 virtual ~ClientMessageDispatcher(); 36 virtual ~ClientMessageDispatcher();
37 37
38 // Initialize the message dispatcher with the given connection and 38 // Initialize the message dispatcher with the given connection and
39 // message handlers. 39 // message handlers.
40 void Initialize(protocol::Session* session, ClientStub* client_stub); 40 void Initialize(protocol::Session* session, ClientStub* client_stub);
41 41
42 private: 42 private:
43 void OnControlMessageReceived(ControlMessage* message); 43 void OnControlMessageReceived(ControlMessage* message, Task* done_task);
44 44
45 // MessageReader that runs on the control channel. It runs a loop 45 // MessageReader that runs on the control channel. It runs a loop
46 // that parses data on the channel and then calls the corresponding handler 46 // that parses data on the channel and then calls the corresponding handler
47 // in this class. 47 // in this class.
48 scoped_ptr<ProtobufMessageReader<ControlMessage> > control_message_reader_; 48 scoped_ptr<ProtobufMessageReader<ControlMessage> > control_message_reader_;
49 49
50 // Stubs for client and input. These objects are not owned. 50 // Stubs for client and input. These objects are not owned.
51 // They are called on the thread there data is received, i.e. jingle thread. 51 // They are called on the thread there data is received, i.e. jingle thread.
52 ClientStub* client_stub_; 52 ClientStub* client_stub_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(ClientMessageDispatcher); 54 DISALLOW_COPY_AND_ASSIGN(ClientMessageDispatcher);
55 }; 55 };
56 56
57 } // namespace protocol 57 } // namespace protocol
58 } // namespace remoting 58 } // namespace remoting
59 59
60 #endif // REMOTING_PROTOCOL_CLIENT_MESSAGE_DISPATCHER_H_ 60 #endif // REMOTING_PROTOCOL_CLIENT_MESSAGE_DISPATCHER_H_
OLDNEW
« no previous file with comments | « remoting/proto/internal.proto ('k') | remoting/protocol/client_message_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698