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

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

Issue 10823323: Add support for multiplexed channels in remoting::protocol::Session interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/protocol/audio_writer.cc ('k') | remoting/protocol/channel_dispatcher_base.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CHANNEL_DISPATCHER_BASE_H_ 5 #ifndef REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_
6 #define REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_ 6 #define REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 13
14 namespace net { 14 namespace net {
15 class StreamSocket; 15 class StreamSocket;
16 } // namespace net 16 } // namespace net
17 17
18 namespace remoting { 18 namespace remoting {
19 namespace protocol { 19 namespace protocol {
20 20
21 class ChannelFactory;
21 class Session; 22 class Session;
22 23
23 // Base class for channel message dispatchers. It's responsible for 24 // Base class for channel message dispatchers. It's responsible for
24 // creating the named channel. Derived dispatchers then dispatch 25 // creating the named channel. Derived dispatchers then dispatch
25 // incoming messages on this channel as well as send outgoing 26 // incoming messages on this channel as well as send outgoing
26 // messages. 27 // messages.
27 class ChannelDispatcherBase { 28 class ChannelDispatcherBase {
28 public: 29 public:
29 // The callback is called when initialization is finished. The 30 // The callback is called when initialization is finished. The
30 // parameter is set to true on success. 31 // parameter is set to true on success.
(...skipping 14 matching lines...) Expand all
45 net::StreamSocket* channel() { return channel_.get(); } 46 net::StreamSocket* channel() { return channel_.get(); }
46 47
47 // Called when channel is initialized. Must be overriden in the 48 // Called when channel is initialized. Must be overriden in the
48 // child classes. Should not delete the dispatcher. 49 // child classes. Should not delete the dispatcher.
49 virtual void OnInitialized() = 0; 50 virtual void OnInitialized() = 0;
50 51
51 private: 52 private:
52 void OnChannelReady(scoped_ptr<net::StreamSocket> socket); 53 void OnChannelReady(scoped_ptr<net::StreamSocket> socket);
53 54
54 std::string channel_name_; 55 std::string channel_name_;
55 Session* session_; 56 ChannelFactory* channel_factory_;
56 InitializedCallback initialized_callback_; 57 InitializedCallback initialized_callback_;
57 scoped_ptr<net::StreamSocket> channel_; 58 scoped_ptr<net::StreamSocket> channel_;
58 59
59 DISALLOW_COPY_AND_ASSIGN(ChannelDispatcherBase); 60 DISALLOW_COPY_AND_ASSIGN(ChannelDispatcherBase);
60 }; 61 };
61 62
62 } // namespace protocol 63 } // namespace protocol
63 } // namespace remoting 64 } // namespace remoting
64 65
65 #endif // REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_ 66 #endif // REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_
OLDNEW
« no previous file with comments | « remoting/protocol/audio_writer.cc ('k') | remoting/protocol/channel_dispatcher_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698