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/host/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
6 | 6 |
7 #include "base/bind.h" | |
8 #include "base/stl_util-inl.h" | |
9 #include "base/task.h" | |
10 #include "build/build_config.h" | 7 #include "build/build_config.h" |
11 #include "remoting/base/constants.h" | 8 #include "remoting/base/constants.h" |
12 #include "remoting/base/encoder.h" | 9 #include "remoting/base/encoder.h" |
13 #include "remoting/base/encoder_row_based.h" | 10 #include "remoting/base/encoder_row_based.h" |
14 #include "remoting/base/encoder_vp8.h" | 11 #include "remoting/base/encoder_vp8.h" |
15 #include "remoting/host/capturer.h" | 12 #include "remoting/host/capturer.h" |
16 #include "remoting/host/chromoting_host_context.h" | 13 #include "remoting/host/chromoting_host_context.h" |
17 #include "remoting/host/curtain.h" | 14 #include "remoting/host/curtain.h" |
18 #include "remoting/host/desktop_environment.h" | 15 #include "remoting/host/desktop_environment.h" |
19 #include "remoting/host/event_executor.h" | 16 #include "remoting/host/event_executor.h" |
(...skipping 11 matching lines...) Expand all Loading... |
31 | 28 |
32 using remoting::protocol::ConnectionToClient; | 29 using remoting::protocol::ConnectionToClient; |
33 using remoting::protocol::InputStub; | 30 using remoting::protocol::InputStub; |
34 | 31 |
35 namespace remoting { | 32 namespace remoting { |
36 | 33 |
37 // static | 34 // static |
38 ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context, | 35 ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context, |
39 MutableHostConfig* config) { | 36 MutableHostConfig* config) { |
40 Capturer* capturer = Capturer::Create(); | 37 Capturer* capturer = Capturer::Create(); |
41 InputStub* input_stub = CreateEventExecutor(context->ui_message_loop(), | 38 EventExecutor* event_executor = |
42 capturer); | 39 EventExecutor::Create(context->ui_message_loop(), capturer); |
43 Curtain* curtain = Curtain::Create(); | 40 Curtain* curtain = Curtain::Create(); |
44 return Create(context, config, | 41 return Create(context, config, |
45 new DesktopEnvironment(capturer, input_stub, curtain)); | 42 new DesktopEnvironment(capturer, event_executor, curtain)); |
46 } | 43 } |
47 | 44 |
48 // static | 45 // static |
49 ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context, | 46 ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context, |
50 MutableHostConfig* config, | 47 MutableHostConfig* config, |
51 DesktopEnvironment* environment) { | 48 DesktopEnvironment* environment) { |
52 return new ChromotingHost(context, config, environment); | 49 return new ChromotingHost(context, config, environment); |
53 } | 50 } |
54 | 51 |
55 ChromotingHost::ChromotingHost(ChromotingHostContext* context, | 52 ChromotingHost::ChromotingHost(ChromotingHostContext* context, |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 322 |
326 VLOG(1) << "Client connected: " << session->jid(); | 323 VLOG(1) << "Client connected: " << session->jid(); |
327 | 324 |
328 // We accept the connection, so create a connection object. | 325 // We accept the connection, so create a connection object. |
329 ConnectionToClient* connection = new ConnectionToClient( | 326 ConnectionToClient* connection = new ConnectionToClient( |
330 context_->network_message_loop(), this); | 327 context_->network_message_loop(), this); |
331 | 328 |
332 // Create a client object. | 329 // Create a client object. |
333 ClientSession* client = new ClientSession( | 330 ClientSession* client = new ClientSession( |
334 this, | 331 this, |
335 base::Bind(UserAuthenticator::Create), | 332 UserAuthenticator::Create(), |
336 connection, | 333 connection, |
337 desktop_environment_->input_stub()); | 334 desktop_environment_->event_executor()); |
338 connection->set_host_stub(client); | 335 connection->set_host_stub(client); |
339 connection->set_input_stub(client); | 336 connection->set_input_stub(client); |
340 | 337 |
341 connection->Init(session); | 338 connection->Init(session); |
342 | 339 |
343 clients_.push_back(client); | 340 clients_.push_back(client); |
344 } | 341 } |
345 | 342 |
346 void ChromotingHost::set_protocol_config( | 343 void ChromotingHost::set_protocol_config( |
347 protocol::CandidateSessionConfig* config) { | 344 protocol::CandidateSessionConfig* config) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 return; | 456 return; |
460 } | 457 } |
461 | 458 |
462 protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus(); | 459 protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus(); |
463 status->set_success(false); | 460 status->set_success(false); |
464 connection->client_stub()->BeginSessionResponse( | 461 connection->client_stub()->BeginSessionResponse( |
465 status, new DeleteTask<protocol::LocalLoginStatus>(status)); | 462 status, new DeleteTask<protocol::LocalLoginStatus>(status)); |
466 } | 463 } |
467 | 464 |
468 } // namespace remoting | 465 } // namespace remoting |
OLD | NEW |