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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 if (last_packet) | 159 if (last_packet) |
160 decode_start = base::Time::Now(); | 160 decode_start = base::Time::Now(); |
161 | 161 |
162 rectangle_decoder_->DecodePacket( | 162 rectangle_decoder_->DecodePacket( |
163 packet, base::Bind(&ChromotingClient::OnPacketDone, | 163 packet, base::Bind(&ChromotingClient::OnPacketDone, |
164 base::Unretained(this), last_packet, decode_start)); | 164 base::Unretained(this), last_packet, decode_start)); |
165 } | 165 } |
166 | 166 |
167 void ChromotingClient::OnConnectionState( | 167 void ChromotingClient::OnConnectionState( |
168 protocol::ConnectionToHost::State state, | 168 protocol::ConnectionToHost::State state, |
169 protocol::ConnectionToHost::Error error) { | 169 protocol::ErrorCode error) { |
170 DCHECK(message_loop()->BelongsToCurrentThread()); | 170 DCHECK(message_loop()->BelongsToCurrentThread()); |
171 VLOG(1) << "ChromotingClient::OnConnectionState(" << state << ")"; | 171 VLOG(1) << "ChromotingClient::OnConnectionState(" << state << ")"; |
172 if (state == protocol::ConnectionToHost::CONNECTED) | 172 if (state == protocol::ConnectionToHost::CONNECTED) |
173 Initialize(); | 173 Initialize(); |
174 view_->SetConnectionState(state, error); | 174 view_->SetConnectionState(state, error); |
175 } | 175 } |
176 | 176 |
177 base::MessageLoopProxy* ChromotingClient::message_loop() { | 177 base::MessageLoopProxy* ChromotingClient::message_loop() { |
178 return context_->network_message_loop(); | 178 return context_->network_message_loop(); |
179 } | 179 } |
(...skipping 28 matching lines...) Expand all Loading... |
208 thread_proxy_.PostTask(FROM_HERE, base::Bind( | 208 thread_proxy_.PostTask(FROM_HERE, base::Bind( |
209 &ChromotingClient::Initialize, base::Unretained(this))); | 209 &ChromotingClient::Initialize, base::Unretained(this))); |
210 return; | 210 return; |
211 } | 211 } |
212 | 212 |
213 // Initialize the decoder. | 213 // Initialize the decoder. |
214 rectangle_decoder_->Initialize(connection_->config()); | 214 rectangle_decoder_->Initialize(connection_->config()); |
215 } | 215 } |
216 | 216 |
217 } // namespace remoting | 217 } // namespace remoting |
OLD | NEW |