Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: remoting/host/chromoting_host.cc

Issue 5065001: Move creation of capturer, input stub into ChromotingHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "remoting/base/constants.h" 10 #include "remoting/base/constants.h"
11 #if defined(OS_WIN)
12 #include "remoting/host/capturer_gdi.h"
13 #include "remoting/host/event_executor_win.h"
14 #elif defined(OS_LINUX)
15 #include "remoting/host/capturer_linux.h"
16 #include "remoting/host/event_executor_linux.h"
17 #elif defined(OS_MACOSX)
18 #include "remoting/host/capturer_mac.h"
19 #include "remoting/host/event_executor_mac.h"
20 #endif
11 #include "remoting/base/encoder.h" 21 #include "remoting/base/encoder.h"
12 #include "remoting/base/encoder_verbatim.h" 22 #include "remoting/base/encoder_verbatim.h"
13 #include "remoting/base/encoder_vp8.h" 23 #include "remoting/base/encoder_vp8.h"
14 #include "remoting/base/encoder_zlib.h" 24 #include "remoting/base/encoder_zlib.h"
15 #include "remoting/host/chromoting_host_context.h" 25 #include "remoting/host/chromoting_host_context.h"
16 #include "remoting/host/capturer.h"
17 #include "remoting/host/host_config.h" 26 #include "remoting/host/host_config.h"
18 #include "remoting/host/host_stub_fake.h" 27 #include "remoting/host/host_stub_fake.h"
19 #include "remoting/host/session_manager.h" 28 #include "remoting/host/session_manager.h"
20 #include "remoting/protocol/connection_to_client.h" 29 #include "remoting/protocol/connection_to_client.h"
21 #include "remoting/protocol/host_stub.h" 30 #include "remoting/protocol/host_stub.h"
22 #include "remoting/protocol/input_stub.h" 31 #include "remoting/protocol/input_stub.h"
23 #include "remoting/protocol/jingle_session_manager.h" 32 #include "remoting/protocol/jingle_session_manager.h"
24 #include "remoting/protocol/session_config.h" 33 #include "remoting/protocol/session_config.h"
25 34
26 using remoting::protocol::ConnectionToClient; 35 using remoting::protocol::ConnectionToClient;
27 36
28 namespace remoting { 37 namespace remoting {
29 38
30 ChromotingHost::ChromotingHost(ChromotingHostContext* context, 39 ChromotingHost::ChromotingHost(ChromotingHostContext* context,
31 MutableHostConfig* config, 40 MutableHostConfig* config)
32 Capturer* capturer,
33 protocol::InputStub* input_stub)
34 : context_(context), 41 : context_(context),
35 config_(config), 42 config_(config),
36 capturer_(capturer), 43 #if defined(OS_WIN)
37 input_stub_(input_stub), 44 capturer_(new remoting::CapturerGdi(
45 context->capture_message_loop())),
46 input_stub_(new remoting::EventExecutorWin(
47 context->capture_message_loop(), capturer_.get())),
48 #elif defined(OS_LINUX)
49 capturer_(new remoting::CapturerLinux(
50 context->capture_message_loop())),
51 input_stub_(new remoting::EventExecutorLinux(
52 context->capture_message_loop(), capturer_.get())),
53 #elif defined(OS_MACOSX)
54 capturer_(new remoting::CapturerMac(
55 context->capture_message_loop())),
56 input_stub_(new remoting::EventExecutorMac(
57 context->capture_message_loop(), capturer_.get())),
58 #endif
38 host_stub_(new HostStubFake()), 59 host_stub_(new HostStubFake()),
39 state_(kInitial) { 60 state_(kInitial) {
40 } 61 }
41 62
42 ChromotingHost::~ChromotingHost() { 63 ChromotingHost::~ChromotingHost() {
43 } 64 }
44 65
45 void ChromotingHost::Start(Task* shutdown_task) { 66 void ChromotingHost::Start(Task* shutdown_task) {
46 if (MessageLoop::current() != context_->main_message_loop()) { 67 if (MessageLoop::current() != context_->main_message_loop()) {
47 context_->main_message_loop()->PostTask( 68 context_->main_message_loop()->PostTask(
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 #if !defined(ARCH_CPU_ARM_FAMILY) 320 #if !defined(ARCH_CPU_ARM_FAMILY)
300 else if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { 321 else if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) {
301 return new remoting::EncoderVp8(); 322 return new remoting::EncoderVp8();
302 } 323 }
303 #endif 324 #endif
304 325
305 return NULL; 326 return NULL;
306 } 327 }
307 328
308 } // namespace remoting 329 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698