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

Unified Diff: remoting/host/local_desktop_environment.h

Issue 11778049: Making DesktopEnvironment a factory class used by ClientSession to create audio/video capturers and… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
Index: remoting/host/local_desktop_environment.h
diff --git a/remoting/host/local_desktop_environment.h b/remoting/host/local_desktop_environment.h
new file mode 100644
index 0000000000000000000000000000000000000000..f07570e65d0304049ebfec0bd3a4ba5418cf898c
--- /dev/null
+++ b/remoting/host/local_desktop_environment.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_LOCAL_DESKTOP_ENVIRONMENT_H_
+#define REMOTING_HOST_LOCAL_DESKTOP_ENVIRONMENT_H_
+
+#include "remoting/host/desktop_environment.h"
+
+#include "base/basictypes.h"
+#include "base/bind.h"
+#include "base/callback.h"
+
+namespace remoting {
+
+// Used to create audio/video capturers and event executor that work with
+// the local console.
Wez 2013/01/11 02:23:41 nit: Really want to distinguish this from SessionE
alexeypa (please no reviews) 2013/01/11 19:59:46 This is coming in a follow up CL.
Wez 2013/01/12 01:58:06 Great. :)
alexeypa (please no reviews) 2013/01/14 20:43:09 Included into this CL because of other DE/DEF chan
+class LocalDesktopEnvironment : public DesktopEnvironment {
Wez 2013/01/11 02:23:41 Not keen on this name, but I can't think of a bett
alexeypa (please no reviews) 2013/01/11 19:59:46 Me neither.
Wez 2013/01/12 01:58:06 BasicDesktopEnvironment, perhaps? "local" would e
alexeypa (please no reviews) 2013/01/14 20:43:09 BasicDesktopEnvironment
+ public:
+ // Callback prototype that is invoked to create an instance of the event
+ // executor.
+ typedef base::Callback<scoped_ptr<EventExecutor>(
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)>
+ CreateEventExecutorCallback;
+
+ LocalDesktopEnvironment(
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
+ const CreateEventExecutorCallback& create_event_executor_callback);
+ virtual ~LocalDesktopEnvironment();
+
+ // DesktopEnvironment implementation.
+ virtual scoped_ptr<AudioCapturer> CreateAudioCapturer(
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) OVERRIDE;
+ virtual scoped_ptr<EventExecutor> CreateEventExecutor(
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) OVERRIDE;
+ virtual scoped_ptr<VideoFrameCapturer> CreateVideoCapturer(
+ scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) OVERRIDE;
+
+ private:
+ // Task runner on which public methods of this class should be called.
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
+
+ // Invoked create an instance of the event executor.
+ CreateEventExecutorCallback create_event_executor_callback_;
+
+ // Flags used to make sure that the audio and video capturer are created
+ // only once.
+ bool audio_capturer_created_;
+ bool video_capturer_created_;
+
+ DISALLOW_COPY_AND_ASSIGN(LocalDesktopEnvironment);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_LOCAL_DESKTOP_ENVIRONMENT_H_

Powered by Google App Engine
This is Rietveld 408576698