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

Side by Side Diff: remoting/host/desktop_environment.h

Issue 10920019: [Chromoting] Refactoring DesktopEnvironment and moving screen/audio recorders to ClientSession. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 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>
9
10 #include "base/basictypes.h" 8 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
12 10
13 namespace remoting { 11 namespace remoting {
14 12
15 class AudioCapturer; 13 class AudioCapturer;
16 class ChromotingHostContext; 14 class ChromotingHostContext;
17 class EventExecutor; 15 class EventExecutor;
18 class VideoFrameCapturer; 16 class VideoFrameCapturer;
19 17
20 namespace protocol { 18 namespace protocol {
21 class ClipboardStub; 19 class ClipboardStub;
22 } 20 }
23 21
24 class DesktopEnvironment { 22 class DesktopEnvironment {
25 public: 23 public:
26 // Creates a DesktopEnvironment used in a host plugin. 24 DesktopEnvironment(scoped_ptr<AudioCapturer> audio_capturer,
27 static scoped_ptr<DesktopEnvironment> Create( 25 scoped_ptr<EventExecutor> event_executor,
28 ChromotingHostContext* context); 26 scoped_ptr<VideoFrameCapturer> video_capturer);
29
30 // Creates a DesktopEnvironment used in a service process.
31 static scoped_ptr<DesktopEnvironment> CreateForService(
32 ChromotingHostContext* context);
33
34 static scoped_ptr<DesktopEnvironment> CreateFake(
35 ChromotingHostContext* context,
36 scoped_ptr<VideoFrameCapturer> capturer,
37 scoped_ptr<EventExecutor> event_executor,
38 scoped_ptr<AudioCapturer> audio_capturer);
39
40 virtual ~DesktopEnvironment(); 27 virtual ~DesktopEnvironment();
41 28
42 VideoFrameCapturer* capturer() const { return capturer_.get(); } 29 AudioCapturer* audio_capturer() const { return audio_capturer_.get(); }
43 EventExecutor* event_executor() const { return event_executor_.get(); } 30 EventExecutor* event_executor() const { return event_executor_.get(); }
44 AudioCapturer* audio_capturer() const { return audio_capturer_.get(); } 31 VideoFrameCapturer* video_capturer() const { return video_capturer_.get(); }
45 void OnSessionStarted(scoped_ptr<protocol::ClipboardStub> client_clipboard); 32
46 void OnSessionFinished(); 33 virtual void Start(
34 scoped_ptr<protocol::ClipboardStub> client_clipboard);
35 virtual void StopAndDelete();
Wez 2012/08/31 18:18:02 We don't actually need StopAndDelete() here, since
alexeypa (please no reviews) 2012/08/31 23:13:30 There is no real reason to keep it here at the mom
47 36
48 private: 37 private:
49 DesktopEnvironment(ChromotingHostContext* context,
50 scoped_ptr<VideoFrameCapturer> capturer,
51 scoped_ptr<EventExecutor> event_executor,
52 scoped_ptr<AudioCapturer> audio_capturer);
53
54 // Host context used to make sure operations are run on the correct thread.
55 // This is owned by the ChromotingHost.
56 ChromotingHostContext* context_;
57
58 // Used to capture video to deliver to clients.
59 scoped_ptr<VideoFrameCapturer> capturer_;
60
61 // Used to capture audio to deliver to clients. 38 // Used to capture audio to deliver to clients.
62 scoped_ptr<AudioCapturer> audio_capturer_; 39 scoped_ptr<AudioCapturer> audio_capturer_;
63 40
64 // Executes input and clipboard events received from the client. 41 // Executes input and clipboard events received from the client.
65 scoped_ptr<EventExecutor> event_executor_; 42 scoped_ptr<EventExecutor> event_executor_;
66 43
44 // Used to capture video to deliver to clients.
45 scoped_ptr<VideoFrameCapturer> video_capturer_;
46
67 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment); 47 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment);
68 }; 48 };
69 49
70 } // namespace remoting 50 } // namespace remoting
71 51
72 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ 52 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698