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

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

Issue 205583011: [Draft] Fix canceling pin prompt causes host overload (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing .gitIngore Created 6 years, 9 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
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 20 matching lines...) Expand all
31 class HostEventDispatcher; 31 class HostEventDispatcher;
32 32
33 // This class represents a remote viewer connection to the chromoting 33 // This class represents a remote viewer connection to the chromoting
34 // host. It sets up all protocol channels and connects them to the 34 // host. It sets up all protocol channels and connects them to the
35 // stubs. 35 // stubs.
36 class ConnectionToClient : public base::NonThreadSafe, 36 class ConnectionToClient : public base::NonThreadSafe,
37 public Session::EventHandler { 37 public Session::EventHandler {
38 public: 38 public:
39 class EventHandler { 39 class EventHandler {
40 public: 40 public:
41 // Called when the network connection is Authenticating
42 virtual void OnConnectionAuthenticating(ConnectionToClient* connection) = 0;
43
41 // Called when the network connection is authenticated. 44 // Called when the network connection is authenticated.
42 virtual void OnConnectionAuthenticated(ConnectionToClient* connection) = 0; 45 virtual void OnConnectionAuthenticated(ConnectionToClient* connection) = 0;
43 46
44 // Called when the network connection is authenticated and all 47 // Called when the network connection is authenticated and all
45 // channels are connected. 48 // channels are connected.
46 virtual void OnConnectionChannelsConnected( 49 virtual void OnConnectionChannelsConnected(
47 ConnectionToClient* connection) = 0; 50 ConnectionToClient* connection) = 0;
48 51
49 // Called when the network connection is closed or failed. 52 // Called when the network connection is closed or failed.
50 virtual void OnConnectionClosed(ConnectionToClient* connection, 53 virtual void OnConnectionClosed(ConnectionToClient* connection,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // Set/get the stubs which will handle messages we receive from the client. 97 // Set/get the stubs which will handle messages we receive from the client.
95 // All stubs MUST be set before the session's channels become connected. 98 // All stubs MUST be set before the session's channels become connected.
96 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub); 99 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub);
97 virtual ClipboardStub* clipboard_stub(); 100 virtual ClipboardStub* clipboard_stub();
98 virtual void set_host_stub(HostStub* host_stub); 101 virtual void set_host_stub(HostStub* host_stub);
99 virtual HostStub* host_stub(); 102 virtual HostStub* host_stub();
100 virtual void set_input_stub(InputStub* input_stub); 103 virtual void set_input_stub(InputStub* input_stub);
101 virtual InputStub* input_stub(); 104 virtual InputStub* input_stub();
102 105
103 // Session::EventHandler interface. 106 // Session::EventHandler interface.
107 virtual void OnSessionAuthenticationBegin() OVERRIDE;
104 virtual void OnSessionStateChange(Session::State state) OVERRIDE; 108 virtual void OnSessionStateChange(Session::State state) OVERRIDE;
105 virtual void OnSessionRouteChange(const std::string& channel_name, 109 virtual void OnSessionRouteChange(const std::string& channel_name,
106 const TransportRoute& route) OVERRIDE; 110 const TransportRoute& route) OVERRIDE;
107 111
108 private: 112 private:
109 // Callback for channel initialization. 113 // Callback for channel initialization.
110 void OnChannelInitialized(bool successful); 114 void OnChannelInitialized(bool successful);
111 115
112 void NotifyIfChannelsReady(); 116 void NotifyIfChannelsReady();
113 117
(...skipping 18 matching lines...) Expand all
132 scoped_ptr<VideoWriter> video_writer_; 136 scoped_ptr<VideoWriter> video_writer_;
133 scoped_ptr<AudioWriter> audio_writer_; 137 scoped_ptr<AudioWriter> audio_writer_;
134 138
135 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); 139 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient);
136 }; 140 };
137 141
138 } // namespace protocol 142 } // namespace protocol
139 } // namespace remoting 143 } // namespace remoting
140 144
141 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ 145 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698