OLD | NEW |
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 ErrorCode error) = 0; | 49 ErrorCode error) = 0; |
50 | 50 |
51 // Called when sequence number is updated. | 51 // Called when sequence number is updated. |
52 virtual void OnSequenceNumberUpdated(ConnectionToClient* connection, | 52 virtual void OnSequenceNumberUpdated(ConnectionToClient* connection, |
53 int64 sequence_number) = 0; | 53 int64 sequence_number) = 0; |
54 | 54 |
55 // Called on notification of a route change event, which happens when a | 55 // Called on notification of a route change event, which happens when a |
56 // channel is connected. | 56 // channel is connected. |
57 virtual void OnRouteChange(ConnectionToClient* connection, | 57 virtual void OnRouteChange(ConnectionToClient* connection, |
58 const std::string& channel_name, | 58 const std::string& channel_name, |
59 const net::IPEndPoint& remote_end_point, | 59 const TransportRoute& route) = 0; |
60 const net::IPEndPoint& local_end_point) = 0; | |
61 }; | 60 }; |
62 | 61 |
63 // Constructs a ConnectionToClient object for the |session|. Takes | 62 // Constructs a ConnectionToClient object for the |session|. Takes |
64 // ownership of |session|. | 63 // ownership of |session|. |
65 explicit ConnectionToClient(Session* session); | 64 explicit ConnectionToClient(Session* session); |
66 virtual ~ConnectionToClient(); | 65 virtual ~ConnectionToClient(); |
67 | 66 |
68 // Set |event_handler| for connection events. Must be called once when this | 67 // Set |event_handler| for connection events. Must be called once when this |
69 // object is created. | 68 // object is created. |
70 void SetEventHandler(EventHandler* event_handler); | 69 void SetEventHandler(EventHandler* event_handler); |
(...skipping 17 matching lines...) Expand all Loading... |
88 // These three setters should be called before Init(). | 87 // These three setters should be called before Init(). |
89 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub); | 88 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub); |
90 virtual void set_host_stub(HostStub* host_stub); | 89 virtual void set_host_stub(HostStub* host_stub); |
91 virtual void set_input_stub(InputStub* input_stub); | 90 virtual void set_input_stub(InputStub* input_stub); |
92 | 91 |
93 private: | 92 private: |
94 // Callback for protocol Session. | 93 // Callback for protocol Session. |
95 void OnSessionStateChange(Session::State state); | 94 void OnSessionStateChange(Session::State state); |
96 | 95 |
97 void OnSessionRouteChange(const std::string& channel_name, | 96 void OnSessionRouteChange(const std::string& channel_name, |
98 const net::IPEndPoint& remote_end_point, | 97 const TransportRoute& route); |
99 const net::IPEndPoint& local_end_point); | |
100 | 98 |
101 // Callback for channel initialization. | 99 // Callback for channel initialization. |
102 void OnChannelInitialized(bool successful); | 100 void OnChannelInitialized(bool successful); |
103 | 101 |
104 void NotifyIfChannelsReady(); | 102 void NotifyIfChannelsReady(); |
105 | 103 |
106 void CloseOnError(); | 104 void CloseOnError(); |
107 | 105 |
108 // Stops writing in the channels. | 106 // Stops writing in the channels. |
109 void CloseChannels(); | 107 void CloseChannels(); |
(...skipping 13 matching lines...) Expand all Loading... |
123 scoped_ptr<HostEventDispatcher> event_dispatcher_; | 121 scoped_ptr<HostEventDispatcher> event_dispatcher_; |
124 scoped_ptr<VideoWriter> video_writer_; | 122 scoped_ptr<VideoWriter> video_writer_; |
125 | 123 |
126 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); | 124 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); |
127 }; | 125 }; |
128 | 126 |
129 } // namespace protocol | 127 } // namespace protocol |
130 } // namespace remoting | 128 } // namespace remoting |
131 | 129 |
132 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 130 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
OLD | NEW |