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

Unified Diff: remoting/host/desktop_environment.cc

Issue 10915206: [Chromoting] Refactoring DesktopEnvironment and moving screen/audio recorders to ClientSession. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/desktop_environment.h ('k') | remoting/host/desktop_environment_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_environment.cc
diff --git a/remoting/host/desktop_environment.cc b/remoting/host/desktop_environment.cc
index 12d3655af4f794de1f706c579feb0c9977f5909e..8807a0276eeb02fe6ed8fc6c2abe75f403311906 100644
--- a/remoting/host/desktop_environment.cc
+++ b/remoting/host/desktop_environment.cc
@@ -4,99 +4,31 @@
#include "remoting/host/desktop_environment.h"
-#include "base/bind.h"
#include "base/compiler_specific.h"
#include "remoting/host/audio_capturer.h"
-#include "remoting/host/video_frame_capturer.h"
#include "remoting/host/chromoting_host_context.h"
+#include "remoting/host/desktop_environment.h"
#include "remoting/host/event_executor.h"
-
-#if defined(OS_WIN)
-#include "remoting/host/session_event_executor_win.h"
-#endif
+#include "remoting/host/video_frame_capturer.h"
namespace remoting {
-// static
-scoped_ptr<DesktopEnvironment> DesktopEnvironment::Create(
- ChromotingHostContext* context) {
- scoped_ptr<VideoFrameCapturer> capturer(VideoFrameCapturer::Create());
- scoped_ptr<EventExecutor> event_executor = EventExecutor::Create(
- context->desktop_task_runner(), context->ui_task_runner());
- scoped_ptr<AudioCapturer> audio_capturer = AudioCapturer::Create();
-
- if (capturer.get() == NULL || event_executor.get() == NULL) {
- LOG(ERROR) << "Unable to create DesktopEnvironment";
- return scoped_ptr<DesktopEnvironment>();
- }
-
- return scoped_ptr<DesktopEnvironment>(
- new DesktopEnvironment(context,
- capturer.Pass(),
- event_executor.Pass(),
- audio_capturer.Pass()));
-}
-
-// static
-scoped_ptr<DesktopEnvironment> DesktopEnvironment::CreateForService(
- ChromotingHostContext* context) {
- scoped_ptr<VideoFrameCapturer> capturer(VideoFrameCapturer::Create());
- scoped_ptr<EventExecutor> event_executor = EventExecutor::Create(
- context->desktop_task_runner(), context->ui_task_runner());
- scoped_ptr<AudioCapturer> audio_capturer = AudioCapturer::Create();
-
- if (capturer.get() == NULL || event_executor.get() == NULL) {
- LOG(ERROR) << "Unable to create DesktopEnvironment";
- return scoped_ptr<DesktopEnvironment>();
- }
-
-#if defined(OS_WIN)
- event_executor.reset(new SessionEventExecutorWin(
- context->desktop_task_runner(),
- event_executor.Pass()));
-#endif
-
- return scoped_ptr<DesktopEnvironment>(
- new DesktopEnvironment(context,
- capturer.Pass(),
- event_executor.Pass(),
- audio_capturer.Pass()));
-}
-
-// static
-scoped_ptr<DesktopEnvironment> DesktopEnvironment::CreateFake(
- ChromotingHostContext* context,
- scoped_ptr<VideoFrameCapturer> capturer,
- scoped_ptr<EventExecutor> event_executor,
- scoped_ptr<AudioCapturer> audio_capturer) {
- return scoped_ptr<DesktopEnvironment>(
- new DesktopEnvironment(context,
- capturer.Pass(),
- event_executor.Pass(),
- audio_capturer.Pass()));
-}
-
DesktopEnvironment::DesktopEnvironment(
- ChromotingHostContext* context,
- scoped_ptr<VideoFrameCapturer> capturer,
+ scoped_ptr<AudioCapturer> audio_capturer,
scoped_ptr<EventExecutor> event_executor,
- scoped_ptr<AudioCapturer> audio_capturer)
- : context_(context),
- capturer_(capturer.Pass()),
- audio_capturer_(audio_capturer.Pass()),
- event_executor_(event_executor.Pass()) {
+ scoped_ptr<VideoFrameCapturer> video_capturer)
+ : audio_capturer_(audio_capturer.Pass()),
+ event_executor_(event_executor.Pass()),
+ video_capturer_(video_capturer.Pass()) {
}
DesktopEnvironment::~DesktopEnvironment() {
+ event_executor_.release()->StopAndDelete();
}
-void DesktopEnvironment::OnSessionStarted(
+void DesktopEnvironment::Start(
scoped_ptr<protocol::ClipboardStub> client_clipboard) {
- event_executor_->OnSessionStarted(client_clipboard.Pass());
-}
-
-void DesktopEnvironment::OnSessionFinished() {
- event_executor_->OnSessionFinished();
+ event_executor_->Start(client_clipboard.Pass());
}
} // namespace remoting
« no previous file with comments | « remoting/host/desktop_environment.h ('k') | remoting/host/desktop_environment_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698