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

Side by Side Diff: remoting/host/desktop_environment_factory.cc

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 #include "remoting/host/desktop_environment_factory.h" 5 #include "remoting/host/desktop_environment_factory.h"
6 6
7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h"
7 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
8 #include "remoting/capturer/video_frame_capturer.h"
9 #include "remoting/host/audio_capturer.h" 10 #include "remoting/host/audio_capturer.h"
10 #include "remoting/host/chromoting_host_context.h"
11 #include "remoting/host/desktop_environment.h"
12 #include "remoting/host/event_executor.h" 11 #include "remoting/host/event_executor.h"
12 #include "remoting/host/local_desktop_environment.h"
13 13
14 namespace remoting { 14 namespace remoting {
15 15
16 DesktopEnvironmentFactory::DesktopEnvironmentFactory( 16 DesktopEnvironmentFactory::DesktopEnvironmentFactory(
17 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 17 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner)
18 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) 18 : caller_task_runner_(caller_task_runner) {
19 : input_task_runner_(input_task_runner),
20 ui_task_runner_(ui_task_runner) {
21 } 19 }
22 20
23 DesktopEnvironmentFactory::~DesktopEnvironmentFactory() { 21 DesktopEnvironmentFactory::~DesktopEnvironmentFactory() {
24 } 22 }
25 23
26 scoped_ptr<DesktopEnvironment> DesktopEnvironmentFactory::Create() { 24 scoped_ptr<DesktopEnvironment> DesktopEnvironmentFactory::Create(
27 scoped_ptr<DesktopEnvironment> environment(new DesktopEnvironment( 25 const std::string& client_jid,
28 AudioCapturer::Create(), 26 const base::Closure& disconnect_callback) {
29 EventExecutor::Create(input_task_runner_, ui_task_runner_), 27 DCHECK(caller_task_runner()->BelongsToCurrentThread());
30 VideoFrameCapturer::Create())); 28
31 return environment.Pass(); 29 return scoped_ptr<DesktopEnvironment>(
30 new LocalDesktopEnvironment(caller_task_runner(),
31 base::Bind(&EventExecutor::Create)));
32 } 32 }
33 33
34 bool DesktopEnvironmentFactory::SupportsAudioCapture() const { 34 bool DesktopEnvironmentFactory::SupportsAudioCapture() const {
35 return AudioCapturer::IsSupported(); 35 return AudioCapturer::IsSupported();
36 } 36 }
37 37
38 } // namespace remoting 38 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698