| 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 namespace remoting { | 14 namespace remoting { |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 DesktopEnvironment* DesktopEnvironment::Create(ChromotingHostContext* context) { | 17 DesktopEnvironment* DesktopEnvironment::Create(ChromotingHostContext* context) { |
| 18 scoped_ptr<Capturer> capturer(Capturer::Create()); | 18 scoped_ptr<Capturer> capturer(Capturer::Create()); |
| 19 scoped_ptr<EventExecutor> event_executor( | 19 scoped_ptr<EventExecutor> event_executor( |
| 20 EventExecutor::Create(context->desktop_message_loop(), capturer.get())); | 20 EventExecutor::Create(context->desktop_message_loop(), |
| 21 context->io_message_loop(), |
| 22 capturer.get())); |
| 21 | 23 |
| 22 if (capturer.get() == NULL || event_executor.get() == NULL) { | 24 if (capturer.get() == NULL || event_executor.get() == NULL) { |
| 23 LOG(ERROR) << "Unable to create DesktopEnvironment"; | 25 LOG(ERROR) << "Unable to create DesktopEnvironment"; |
| 24 return NULL; | 26 return NULL; |
| 25 } | 27 } |
| 26 | 28 |
| 27 return new DesktopEnvironment(context, | 29 return new DesktopEnvironment(context, |
| 28 capturer.release(), | 30 capturer.release(), |
| 29 event_executor.release()); | 31 event_executor.release()); |
| 30 } | 32 } |
| 31 | 33 |
| 32 DesktopEnvironment::DesktopEnvironment(ChromotingHostContext* context, | 34 DesktopEnvironment::DesktopEnvironment(ChromotingHostContext* context, |
| 33 Capturer* capturer, | 35 Capturer* capturer, |
| 34 EventExecutor* event_executor) | 36 EventExecutor* event_executor) |
| 35 : host_(NULL), | 37 : host_(NULL), |
| 36 context_(context), | 38 context_(context), |
| 37 capturer_(capturer), | 39 capturer_(capturer), |
| 38 event_executor_(event_executor) { | 40 event_executor_(event_executor) { |
| 39 } | 41 } |
| 40 | 42 |
| 41 DesktopEnvironment::~DesktopEnvironment() { | 43 DesktopEnvironment::~DesktopEnvironment() { |
| 42 } | 44 } |
| 43 | 45 |
| 44 } // namespace remoting | 46 } // namespace remoting |
| OLD | NEW |