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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ 5 #ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
6 #define REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ 6 #define REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
7 7
8 #include <string> 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
9 11
10 #include "base/basictypes.h" 12 namespace base {
11 #include "base/callback_forward.h" 13 class SingleThreadTaskRunner;
12 #include "base/memory/scoped_ptr.h" 14 } // namespace base
13 15
14 namespace remoting { 16 namespace remoting {
15 17
16 class AudioCapturer; 18 class AudioCapturer;
17 class EventExecutor; 19 class EventExecutor;
18 class VideoFrameCapturer; 20 class VideoFrameCapturer;
19 21
20 namespace protocol { 22 // Provides factory methods for creation of audio/video capturers and event
21 class ClipboardStub; 23 // executor for a given desktop environment.
22 }
23
24 class DesktopEnvironment { 24 class DesktopEnvironment {
25 public: 25 public:
26 DesktopEnvironment(scoped_ptr<AudioCapturer> audio_capturer, 26 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
27 scoped_ptr<EventExecutor> event_executor, 27 virtual ~DesktopEnvironment() {}
28 scoped_ptr<VideoFrameCapturer> video_capturer);
29 virtual ~DesktopEnvironment();
30 28
31 AudioCapturer* audio_capturer() const { return audio_capturer_.get(); } 29 // Factory methods used to create audio/video capturers and event executor for
32 EventExecutor* event_executor() const { return event_executor_.get(); } 30 // a particular desktop environment.
33 VideoFrameCapturer* video_capturer() const { return video_capturer_.get(); } 31 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer(
34 32 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
35 // Starts the desktop environment passing |client_jid| of the attached 33 virtual scoped_ptr<EventExecutor> CreateEventExecutor(
36 // authenticated session. Registers |client_clipboard| to receive 34 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
37 // notifications about local clipboard changes. |disconnect_callback| can be 35 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) = 0;
38 // invoked by the DesktopEnvironment to request the client session to be 36 virtual scoped_ptr<VideoFrameCapturer> CreateVideoCapturer(
39 // disconnected. |disconnect_callback| is invoked on the same thread Start() 37 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
40 // has been called on. 38 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) = 0;
41 virtual void Start(
42 scoped_ptr<protocol::ClipboardStub> client_clipboard,
43 const std::string& client_jid,
44 const base::Closure& disconnect_callback);
45 39
46 private: 40 private:
47 // Used to capture audio to deliver to clients.
48 scoped_ptr<AudioCapturer> audio_capturer_;
49
50 // Executes input and clipboard events received from the client.
51 scoped_ptr<EventExecutor> event_executor_;
52
53 // Used to capture video to deliver to clients.
54 scoped_ptr<VideoFrameCapturer> video_capturer_;
55
56 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment); 41 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment);
57 }; 42 };
58 43
59 } // namespace remoting 44 } // namespace remoting
60 45
61 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ 46 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698