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/desktop_environment.h" | 5 #include "remoting/host/desktop_environment.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "remoting/host/capturer.h" | 9 #include "remoting/host/capturer.h" |
10 #include "remoting/host/chromoting_host.h" | 10 #include "remoting/host/chromoting_host.h" |
11 #include "remoting/host/chromoting_host_context.h" | 11 #include "remoting/host/chromoting_host_context.h" |
12 #include "remoting/host/event_executor.h" | 12 #include "remoting/host/event_executor.h" |
13 | 13 |
14 #if defined(OS_WIN) | |
15 #include "remoting/host/session_event_executor_win.h" | |
16 #endif | |
17 | |
14 namespace remoting { | 18 namespace remoting { |
15 | 19 |
16 // static | 20 // static |
17 DesktopEnvironment* DesktopEnvironment::Create(ChromotingHostContext* context) { | 21 DesktopEnvironment* DesktopEnvironment::Create(ChromotingHostContext* context) { |
18 scoped_ptr<Capturer> capturer(Capturer::Create()); | 22 scoped_ptr<Capturer> capturer(Capturer::Create()); |
19 scoped_ptr<EventExecutor> event_executor( | 23 scoped_ptr<EventExecutor> event_executor( |
Wez
2012/03/08 22:58:55
nit: Since the EventExecutor interface doesn't add
alexeypa (please no reviews)
2012/03/09 01:13:54
Done.
| |
20 EventExecutor::Create(context->desktop_message_loop(), capturer.get())); | 24 EventExecutor::Create(context->desktop_message_loop(), |
25 capturer.get())); | |
21 | 26 |
22 if (capturer.get() == NULL || event_executor.get() == NULL) { | 27 if (capturer.get() == NULL || event_executor.get() == NULL) { |
23 LOG(ERROR) << "Unable to create DesktopEnvironment"; | 28 LOG(ERROR) << "Unable to create DesktopEnvironment"; |
24 return NULL; | 29 return NULL; |
25 } | 30 } |
26 | 31 |
32 #if defined(OS_WIN) | |
33 event_executor.reset(new SessionEventExecutor(context->desktop_message_loop(), | |
34 context->io_message_loop(), | |
35 event_executor.Pass())); | |
Wez
2012/03/08 22:58:55
nit: This is a shame; we really only want to use t
alexeypa (please no reviews)
2012/03/09 01:13:54
Not true. We need SessionEventExecutor to switch b
Wez
2012/03/09 22:24:34
No we don't - we won't be running with sufficient
alexeypa (please no reviews)
2012/03/10 18:08:52
Yes, you are right. we should think about that sce
| |
36 #endif | |
37 | |
27 return new DesktopEnvironment(context, | 38 return new DesktopEnvironment(context, |
28 capturer.release(), | 39 capturer.release(), |
29 event_executor.release()); | 40 event_executor.release()); |
30 } | 41 } |
31 | 42 |
32 DesktopEnvironment::DesktopEnvironment(ChromotingHostContext* context, | 43 DesktopEnvironment::DesktopEnvironment(ChromotingHostContext* context, |
33 Capturer* capturer, | 44 Capturer* capturer, |
34 EventExecutor* event_executor) | 45 EventExecutor* event_executor) |
35 : host_(NULL), | 46 : host_(NULL), |
36 context_(context), | 47 context_(context), |
37 capturer_(capturer), | 48 capturer_(capturer), |
38 event_executor_(event_executor) { | 49 event_executor_(event_executor) { |
39 } | 50 } |
40 | 51 |
41 DesktopEnvironment::~DesktopEnvironment() { | 52 DesktopEnvironment::~DesktopEnvironment() { |
42 } | 53 } |
43 | 54 |
44 } // namespace remoting | 55 } // namespace remoting |
OLD | NEW |