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 // ChromotingClient is the controller for the Client implementation. | 5 // ChromotingClient is the controller for the Client implementation. |
6 | 6 |
7 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 7 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
8 #define REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 8 #define REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace base { | 26 namespace base { |
27 class SingleThreadTaskRunner; | 27 class SingleThreadTaskRunner; |
28 } // namespace base | 28 } // namespace base |
29 | 29 |
30 namespace remoting { | 30 namespace remoting { |
31 | 31 |
32 namespace protocol { | 32 namespace protocol { |
33 class TransportFactory; | 33 class TransportFactory; |
34 } // namespace protocol | 34 } // namespace protocol |
35 | 35 |
| 36 class AudioDecoder; |
36 class AudioPlayer; | 37 class AudioPlayer; |
37 class ClientUserInterface; | 38 class ClientUserInterface; |
38 class RectangleUpdateDecoder; | 39 class RectangleUpdateDecoder; |
39 | 40 |
40 // TODO(sergeyu): Move VideoStub implementation to RectangleUpdateDecoder. | 41 // TODO(sergeyu): Move VideoStub implementation to RectangleUpdateDecoder. |
41 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, | 42 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, |
42 public protocol::ClientStub, | 43 public protocol::ClientStub, |
43 public protocol::VideoStub, | 44 public protocol::VideoStub, |
44 public protocol::AudioStub { | 45 public protocol::AudioStub { |
45 public: | 46 public: |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void OnDisconnected(const base::Closure& shutdown_task); | 109 void OnDisconnected(const base::Closure& shutdown_task); |
109 | 110 |
110 // The following are not owned by this class. | 111 // The following are not owned by this class. |
111 ClientConfig config_; | 112 ClientConfig config_; |
112 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 113 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
113 protocol::ConnectionToHost* connection_; | 114 protocol::ConnectionToHost* connection_; |
114 ClientUserInterface* user_interface_; | 115 ClientUserInterface* user_interface_; |
115 RectangleUpdateDecoder* rectangle_decoder_; | 116 RectangleUpdateDecoder* rectangle_decoder_; |
116 AudioPlayer* audio_player_; | 117 AudioPlayer* audio_player_; |
117 | 118 |
| 119 scoped_ptr<AudioDecoder> audio_decoder_; |
| 120 |
118 // If non-NULL, this is called when the client is done. | 121 // If non-NULL, this is called when the client is done. |
119 base::Closure client_done_; | 122 base::Closure client_done_; |
120 | 123 |
121 // Contains all video packets that have been received, but have not yet been | 124 // Contains all video packets that have been received, but have not yet been |
122 // processed. | 125 // processed. |
123 // | 126 // |
124 // Used to serialize sending of messages to the client. | 127 // Used to serialize sending of messages to the client. |
125 std::list<QueuedVideoPacket> received_packets_; | 128 std::list<QueuedVideoPacket> received_packets_; |
126 | 129 |
127 // True if a message is being processed. Can be used to determine if it is | 130 // True if a message is being processed. Can be used to determine if it is |
128 // safe to dispatch another message. | 131 // safe to dispatch another message. |
129 bool packet_being_processed_; | 132 bool packet_being_processed_; |
130 | 133 |
131 // Record the statistics of the connection. | 134 // Record the statistics of the connection. |
132 ChromotingStats stats_; | 135 ChromotingStats stats_; |
133 | 136 |
134 // Keep track of the last sequence number bounced back from the host. | 137 // Keep track of the last sequence number bounced back from the host. |
135 int64 last_sequence_number_; | 138 int64 last_sequence_number_; |
136 | 139 |
137 // WeakPtr used to avoid tasks accessing the client after it is deleted. | 140 // WeakPtr used to avoid tasks accessing the client after it is deleted. |
138 base::WeakPtrFactory<ChromotingClient> weak_factory_; | 141 base::WeakPtrFactory<ChromotingClient> weak_factory_; |
139 base::WeakPtr<ChromotingClient> weak_ptr_; | 142 base::WeakPtr<ChromotingClient> weak_ptr_; |
140 | 143 |
141 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 144 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
142 }; | 145 }; |
143 | 146 |
144 } // namespace remoting | 147 } // namespace remoting |
145 | 148 |
146 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 149 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
OLD | NEW |