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 #include "remoting/client/chromoting_client.h" | 5 #include "remoting/client/chromoting_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "remoting/client/chromoting_view.h" | 8 #include "remoting/client/chromoting_view.h" |
9 #include "remoting/client/client_context.h" | 9 #include "remoting/client/client_context.h" |
10 #include "remoting/client/rectangle_update_decoder.h" | 10 #include "remoting/client/rectangle_update_decoder.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 if (!client_done_.is_null()) { | 96 if (!client_done_.is_null()) { |
97 message_loop()->PostTask(FROM_HERE, client_done_); | 97 message_loop()->PostTask(FROM_HERE, client_done_); |
98 client_done_.Reset(); | 98 client_done_.Reset(); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 ChromotingStats* ChromotingClient::GetStats() { | 102 ChromotingStats* ChromotingClient::GetStats() { |
103 return &stats_; | 103 return &stats_; |
104 } | 104 } |
105 | 105 |
106 void ChromotingClient::Repaint() { | |
107 DCHECK(message_loop()->BelongsToCurrentThread()); | |
108 view_->Paint(); | |
109 } | |
110 | |
111 void ChromotingClient::ProcessVideoPacket(const VideoPacket* packet, | 106 void ChromotingClient::ProcessVideoPacket(const VideoPacket* packet, |
112 const base::Closure& done) { | 107 const base::Closure& done) { |
113 DCHECK(message_loop()->BelongsToCurrentThread()); | 108 DCHECK(message_loop()->BelongsToCurrentThread()); |
114 | 109 |
115 // If the video packet is empty then drop it. Empty packets are used to | 110 // If the video packet is empty then drop it. Empty packets are used to |
116 // maintain activity on the network. | 111 // maintain activity on the network. |
117 if (!packet->has_data() || packet->data().size() == 0) { | 112 if (!packet->has_data() || packet->data().size() == 0) { |
118 done.Run(); | 113 done.Run(); |
119 return; | 114 return; |
120 } | 115 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 thread_proxy_.PostTask(FROM_HERE, base::Bind( | 208 thread_proxy_.PostTask(FROM_HERE, base::Bind( |
214 &ChromotingClient::Initialize, base::Unretained(this))); | 209 &ChromotingClient::Initialize, base::Unretained(this))); |
215 return; | 210 return; |
216 } | 211 } |
217 | 212 |
218 // Initialize the decoder. | 213 // Initialize the decoder. |
219 rectangle_decoder_->Initialize(connection_->config()); | 214 rectangle_decoder_->Initialize(connection_->config()); |
220 } | 215 } |
221 | 216 |
222 } // namespace remoting | 217 } // namespace remoting |
OLD | NEW |