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

Unified Diff: remoting/host/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/desktop_environment.h
diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h
index 74b1d8e71b0e833a2b8df4026204b78173d06c79..e02d694b4a44147535f7fc7b1ecf2b04c0ac6279 100644
--- a/remoting/host/desktop_environment.h
+++ b/remoting/host/desktop_environment.h
@@ -5,54 +5,39 @@
#ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
#define REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
-#include <string>
-
#include "base/basictypes.h"
-#include "base/callback_forward.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
namespace remoting {
class AudioCapturer;
class EventExecutor;
class VideoFrameCapturer;
-namespace protocol {
-class ClipboardStub;
-}
-
+// Provides factory methods for creation of audio/video capturers and event
+// executor for a given desktop environment.
class DesktopEnvironment {
public:
- DesktopEnvironment(scoped_ptr<AudioCapturer> audio_capturer,
- scoped_ptr<EventExecutor> event_executor,
- scoped_ptr<VideoFrameCapturer> video_capturer);
- virtual ~DesktopEnvironment();
-
- AudioCapturer* audio_capturer() const { return audio_capturer_.get(); }
- EventExecutor* event_executor() const { return event_executor_.get(); }
- VideoFrameCapturer* video_capturer() const { return video_capturer_.get(); }
-
- // Starts the desktop environment passing |client_jid| of the attached
- // authenticated session. Registers |client_clipboard| to receive
- // notifications about local clipboard changes. |disconnect_callback| can be
- // invoked by the DesktopEnvironment to request the client session to be
- // disconnected. |disconnect_callback| is invoked on the same thread Start()
- // has been called on.
- virtual void Start(
- scoped_ptr<protocol::ClipboardStub> client_clipboard,
- const std::string& client_jid,
- const base::Closure& disconnect_callback);
+ DesktopEnvironment() {}
Wez 2013/01/11 02:23:41 Do you need to declare a ctor explicitly here?
alexeypa (please no reviews) 2013/01/11 19:59:46 It is required because of DISALLOW_COPY_AND_ASSIGN
+ virtual ~DesktopEnvironment() {}
+
+ // Factory methods used to create audio/video capturers and event executor for
+ // a particular desktop environment.
+ virtual scoped_ptr<AudioCapturer> CreateAudioCapturer(
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) = 0;
Wez 2013/01/11 02:23:41 nit: If you pass AutoThreadTaskRunner here then ca
Wez 2013/01/11 02:23:41 Why do you prefer to pass the TaskRunners to the D
alexeypa (please no reviews) 2013/01/11 19:59:46 Agree, but it should be done as a separate CL.
alexeypa (please no reviews) 2013/01/11 19:59:46 To avoid using more task runners then needed. If C
Wez 2013/01/12 01:58:06 SGTM!
Wez 2013/01/12 01:58:06 Ah, so you're thinking we would spawn the audio th
alexeypa (please no reviews) 2013/01/14 20:43:09 Potentially. Basically it strikes me that we keep
+ virtual scoped_ptr<EventExecutor> CreateEventExecutor(
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) = 0;
+ virtual scoped_ptr<VideoFrameCapturer> CreateVideoCapturer(
+ scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) = 0;
private:
- // Used to capture audio to deliver to clients.
- scoped_ptr<AudioCapturer> audio_capturer_;
-
- // Executes input and clipboard events received from the client.
- scoped_ptr<EventExecutor> event_executor_;
-
- // Used to capture video to deliver to clients.
- scoped_ptr<VideoFrameCapturer> video_capturer_;
-
DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment);
};

Powered by Google App Engine
This is Rietveld 408576698