Chromium Code Reviews| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 // Called when the network connection has failed. | 46 // Called when the network connection has failed. |
| 47 virtual void OnConnectionFailed(ConnectionToClient* connection, | 47 virtual void OnConnectionFailed(ConnectionToClient* connection, |
| 48 Session::Error error) = 0; | 48 Session::Error error) = 0; |
| 49 | 49 |
| 50 // Called when sequence number is updated. | 50 // Called when sequence number is updated. |
| 51 virtual void OnSequenceNumberUpdated(ConnectionToClient* connection, | 51 virtual void OnSequenceNumberUpdated(ConnectionToClient* connection, |
| 52 int64 sequence_number) = 0; | 52 int64 sequence_number) = 0; |
| 53 | 53 |
| 54 // Called on notification of a route change event, which happens when a | 54 // Called on notification of a route change event, which happens when a |
| 55 // channel is connected. | 55 // channel is connected. |
| 56 virtual void OnClientIpAddress(ConnectionToClient* connection, | 56 virtual void OnClientIpAddress(ConnectionToClient* connection, |
|
Sergey Ulanov
2012/02/02 01:10:23
Maybe rename it to OnRouteChange()?
Lambros
2012/02/02 01:48:12
Done.
| |
| 57 const std::string& channel_name, | 57 const std::string& channel_name, |
| 58 const net::IPEndPoint& end_point) = 0; | 58 const net::IPEndPoint& end_point, |
| 59 const net::IPEndPoint& local_endpoint) = 0; | |
|
Sergey Ulanov
2012/02/02 01:10:23
s/endpoint/end_point/
Lambros
2012/02/02 01:48:12
Done.
| |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 // Constructs a ConnectionToClient object for the |session|. Takes | 62 // Constructs a ConnectionToClient object for the |session|. Takes |
| 62 // ownership of |session|. | 63 // ownership of |session|. |
| 63 explicit ConnectionToClient(Session* session); | 64 explicit ConnectionToClient(Session* session); |
| 64 virtual ~ConnectionToClient(); | 65 virtual ~ConnectionToClient(); |
| 65 | 66 |
| 66 // 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 |
| 67 // object is created. | 68 // object is created. |
| 68 void SetEventHandler(EventHandler* event_handler); | 69 void SetEventHandler(EventHandler* event_handler); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 85 | 86 |
| 86 // These two setters should be called before Init(). | 87 // These two setters should be called before Init(). |
| 87 virtual void set_host_stub(HostStub* host_stub); | 88 virtual void set_host_stub(HostStub* host_stub); |
| 88 virtual void set_input_stub(InputStub* input_stub); | 89 virtual void set_input_stub(InputStub* input_stub); |
| 89 | 90 |
| 90 private: | 91 private: |
| 91 // Callback for protocol Session. | 92 // Callback for protocol Session. |
| 92 void OnSessionStateChange(Session::State state); | 93 void OnSessionStateChange(Session::State state); |
| 93 | 94 |
| 94 void OnSessionRouteChange(const std::string& channel_name, | 95 void OnSessionRouteChange(const std::string& channel_name, |
| 95 const net::IPEndPoint& end_point); | 96 const net::IPEndPoint& end_point, |
| 97 const net::IPEndPoint& local_end_point); | |
| 96 | 98 |
| 97 // Callback for channel initialization. | 99 // Callback for channel initialization. |
| 98 void OnChannelInitialized(bool successful); | 100 void OnChannelInitialized(bool successful); |
| 99 | 101 |
| 100 void NotifyIfChannelsReady(); | 102 void NotifyIfChannelsReady(); |
| 101 | 103 |
| 102 void CloseOnError(); | 104 void CloseOnError(); |
| 103 | 105 |
| 104 // Stops writing in the channels. | 106 // Stops writing in the channels. |
| 105 void CloseChannels(); | 107 void CloseChannels(); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 118 scoped_ptr<HostEventDispatcher> event_dispatcher_; | 120 scoped_ptr<HostEventDispatcher> event_dispatcher_; |
| 119 scoped_ptr<VideoWriter> video_writer_; | 121 scoped_ptr<VideoWriter> video_writer_; |
| 120 | 122 |
| 121 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); | 123 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); |
| 122 }; | 124 }; |
| 123 | 125 |
| 124 } // namespace protocol | 126 } // namespace protocol |
| 125 } // namespace remoting | 127 } // namespace remoting |
| 126 | 128 |
| 127 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 129 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
| OLD | NEW |