| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/input_handler.h" | |
| 11 #include "remoting/client/rectangle_update_decoder.h" | 10 #include "remoting/client/rectangle_update_decoder.h" |
| 12 #include "remoting/protocol/connection_to_host.h" | 11 #include "remoting/protocol/connection_to_host.h" |
| 13 #include "remoting/protocol/session_config.h" | 12 #include "remoting/protocol/session_config.h" |
| 14 | 13 |
| 15 namespace remoting { | 14 namespace remoting { |
| 16 | 15 |
| 17 ChromotingClient::QueuedVideoPacket::QueuedVideoPacket( | 16 ChromotingClient::QueuedVideoPacket::QueuedVideoPacket( |
| 18 const VideoPacket* packet, const base::Closure& done) | 17 const VideoPacket* packet, const base::Closure& done) |
| 19 : packet(packet), done(done) { | 18 : packet(packet), done(done) { |
| 20 } | 19 } |
| 21 | 20 |
| 22 ChromotingClient::QueuedVideoPacket::~QueuedVideoPacket() { | 21 ChromotingClient::QueuedVideoPacket::~QueuedVideoPacket() { |
| 23 } | 22 } |
| 24 | 23 |
| 25 ChromotingClient::ChromotingClient(const ClientConfig& config, | 24 ChromotingClient::ChromotingClient(const ClientConfig& config, |
| 26 ClientContext* context, | 25 ClientContext* context, |
| 27 protocol::ConnectionToHost* connection, | 26 protocol::ConnectionToHost* connection, |
| 28 ChromotingView* view, | 27 ChromotingView* view, |
| 29 RectangleUpdateDecoder* rectangle_decoder, | 28 RectangleUpdateDecoder* rectangle_decoder, |
| 30 InputHandler* input_handler, | |
| 31 const base::Closure& client_done) | 29 const base::Closure& client_done) |
| 32 : config_(config), | 30 : config_(config), |
| 33 context_(context), | 31 context_(context), |
| 34 connection_(connection), | 32 connection_(connection), |
| 35 view_(view), | 33 view_(view), |
| 36 rectangle_decoder_(rectangle_decoder), | 34 rectangle_decoder_(rectangle_decoder), |
| 37 input_handler_(input_handler), | |
| 38 client_done_(client_done), | 35 client_done_(client_done), |
| 39 packet_being_processed_(false), | 36 packet_being_processed_(false), |
| 40 last_sequence_number_(0), | 37 last_sequence_number_(0), |
| 41 thread_proxy_(context_->network_message_loop()) { | 38 thread_proxy_(context_->network_message_loop()) { |
| 42 } | 39 } |
| 43 | 40 |
| 44 ChromotingClient::~ChromotingClient() { | 41 ChromotingClient::~ChromotingClient() { |
| 45 } | 42 } |
| 46 | 43 |
| 47 void ChromotingClient::Start(scoped_refptr<XmppProxy> xmpp_proxy) { | 44 void ChromotingClient::Start(scoped_refptr<XmppProxy> xmpp_proxy) { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 195 |
| 199 void ChromotingClient::Initialize() { | 196 void ChromotingClient::Initialize() { |
| 200 if (!message_loop()->BelongsToCurrentThread()) { | 197 if (!message_loop()->BelongsToCurrentThread()) { |
| 201 thread_proxy_.PostTask(FROM_HERE, base::Bind( | 198 thread_proxy_.PostTask(FROM_HERE, base::Bind( |
| 202 &ChromotingClient::Initialize, base::Unretained(this))); | 199 &ChromotingClient::Initialize, base::Unretained(this))); |
| 203 return; | 200 return; |
| 204 } | 201 } |
| 205 | 202 |
| 206 // Initialize the decoder. | 203 // Initialize the decoder. |
| 207 rectangle_decoder_->Initialize(connection_->config()); | 204 rectangle_decoder_->Initialize(connection_->config()); |
| 208 | |
| 209 // Schedule the input handler to process the event queue. | |
| 210 input_handler_->Initialize(); | |
| 211 } | 205 } |
| 212 | 206 |
| 213 } // namespace remoting | 207 } // namespace remoting |
| OLD | NEW |