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

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

Issue 841773005: Cleanup channel dispatchers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « remoting/protocol/client_video_dispatcher.cc ('k') | remoting/protocol/connection_to_client.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_CONNECTION_TO_CLIENT_H_ 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ 6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 class HostEventDispatcher; 24 class HostEventDispatcher;
25 class HostStub; 25 class HostStub;
26 class HostVideoDispatcher; 26 class HostVideoDispatcher;
27 class InputStub; 27 class InputStub;
28 class VideoStub; 28 class VideoStub;
29 29
30 // This class represents a remote viewer connection to the chromoting 30 // This class represents a remote viewer connection to the chromoting
31 // host. It sets up all protocol channels and connects them to the 31 // host. It sets up all protocol channels and connects them to the
32 // stubs. 32 // stubs.
33 class ConnectionToClient : public base::NonThreadSafe, 33 class ConnectionToClient : public base::NonThreadSafe,
34 public Session::EventHandler { 34 public Session::EventHandler,
35 public ChannelDispatcherBase::EventHandler {
35 public: 36 public:
36 class EventHandler { 37 class EventHandler {
37 public: 38 public:
38 // Called when the network connection is authenticating 39 // Called when the network connection is authenticating
39 virtual void OnConnectionAuthenticating(ConnectionToClient* connection) = 0; 40 virtual void OnConnectionAuthenticating(ConnectionToClient* connection) = 0;
40 41
41 // Called when the network connection is authenticated. 42 // Called when the network connection is authenticated.
42 virtual void OnConnectionAuthenticated(ConnectionToClient* connection) = 0; 43 virtual void OnConnectionAuthenticated(ConnectionToClient* connection) = 0;
43 44
44 // Called when the network connection is authenticated and all 45 // Called when the network connection is authenticated and all
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 virtual void set_host_stub(HostStub* host_stub); 99 virtual void set_host_stub(HostStub* host_stub);
99 virtual HostStub* host_stub(); 100 virtual HostStub* host_stub();
100 virtual void set_input_stub(InputStub* input_stub); 101 virtual void set_input_stub(InputStub* input_stub);
101 virtual InputStub* input_stub(); 102 virtual InputStub* input_stub();
102 103
103 // Session::EventHandler interface. 104 // Session::EventHandler interface.
104 void OnSessionStateChange(Session::State state) override; 105 void OnSessionStateChange(Session::State state) override;
105 void OnSessionRouteChange(const std::string& channel_name, 106 void OnSessionRouteChange(const std::string& channel_name,
106 const TransportRoute& route) override; 107 const TransportRoute& route) override;
107 108
109 // ChannelDispatcherBase::EventHandler interface.
110 void OnChannelInitialized(ChannelDispatcherBase* channel_dispatcher) override;
111 void OnChannelError(ChannelDispatcherBase* channel_dispatcher,
112 ErrorCode error) override;
113
108 private: 114 private:
109 // Callback for channel initialization.
110 void OnChannelInitialized(bool successful);
111
112 void NotifyIfChannelsReady(); 115 void NotifyIfChannelsReady();
113 116
114 void Close(ErrorCode error); 117 void Close(ErrorCode error);
115 118
116 // Stops writing in the channels. 119 // Stops writing in the channels.
117 void CloseChannels(); 120 void CloseChannels();
118 121
119 // Event handler for handling events sent from this object. 122 // Event handler for handling events sent from this object.
120 EventHandler* handler_; 123 EventHandler* handler_;
121 124
(...skipping 10 matching lines...) Expand all
132 scoped_ptr<HostVideoDispatcher> video_dispatcher_; 135 scoped_ptr<HostVideoDispatcher> video_dispatcher_;
133 scoped_ptr<AudioWriter> audio_writer_; 136 scoped_ptr<AudioWriter> audio_writer_;
134 137
135 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); 138 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient);
136 }; 139 };
137 140
138 } // namespace protocol 141 } // namespace protocol
139 } // namespace remoting 142 } // namespace remoting
140 143
141 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ 144 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
OLDNEW
« no previous file with comments | « remoting/protocol/client_video_dispatcher.cc ('k') | remoting/protocol/connection_to_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698