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

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

Issue 10911271: Remove CommandLine dependency from the Linux's AudioCapturer. (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 #include "remoting/host/desktop_environment.h" 5 #include "remoting/host/desktop_environment.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "remoting/host/audio_capturer.h" 9 #include "remoting/host/audio_capturer.h"
10 #include "remoting/host/video_frame_capturer.h" 10 #include "remoting/host/video_frame_capturer.h"
11 #include "remoting/host/chromoting_host_context.h" 11 #include "remoting/host/chromoting_host_context.h"
12 #include "remoting/host/event_executor.h" 12 #include "remoting/host/event_executor.h"
13 13
14 #if defined(OS_WIN) 14 #if defined(OS_WIN)
15 #include "remoting/host/session_event_executor_win.h" 15 #include "remoting/host/session_event_executor_win.h"
16 #endif 16 #endif
17 17
18 namespace remoting { 18 namespace remoting {
19 19
20 // static 20 // static
21 scoped_ptr<DesktopEnvironment> DesktopEnvironment::Create( 21 scoped_ptr<DesktopEnvironment> DesktopEnvironment::Create(
22 ChromotingHostContext* context) { 22 ChromotingHostContext* context) {
23 scoped_ptr<VideoFrameCapturer> capturer(VideoFrameCapturer::Create()); 23 scoped_ptr<VideoFrameCapturer> capturer(VideoFrameCapturer::Create());
24 scoped_ptr<EventExecutor> event_executor = EventExecutor::Create( 24 scoped_ptr<EventExecutor> event_executor = EventExecutor::Create(
25 context->desktop_task_runner(), context->ui_task_runner()); 25 context->desktop_task_runner(), context->ui_task_runner());
26 scoped_ptr<AudioCapturer> audio_capturer = AudioCapturer::Create(); 26 scoped_ptr<AudioCapturer> audio_capturer = AudioCapturer::Create(context);
27 27
28 if (capturer.get() == NULL || event_executor.get() == NULL) { 28 if (capturer.get() == NULL || event_executor.get() == NULL) {
29 LOG(ERROR) << "Unable to create DesktopEnvironment"; 29 LOG(ERROR) << "Unable to create DesktopEnvironment";
30 return scoped_ptr<DesktopEnvironment>(); 30 return scoped_ptr<DesktopEnvironment>();
31 } 31 }
32 32
33 return scoped_ptr<DesktopEnvironment>( 33 return scoped_ptr<DesktopEnvironment>(
34 new DesktopEnvironment(context, 34 new DesktopEnvironment(context,
35 capturer.Pass(), 35 capturer.Pass(),
36 event_executor.Pass(), 36 event_executor.Pass(),
37 audio_capturer.Pass())); 37 audio_capturer.Pass()));
38 } 38 }
39 39
40 // static 40 // static
41 scoped_ptr<DesktopEnvironment> DesktopEnvironment::CreateForService( 41 scoped_ptr<DesktopEnvironment> DesktopEnvironment::CreateForService(
42 ChromotingHostContext* context) { 42 ChromotingHostContext* context) {
43 scoped_ptr<VideoFrameCapturer> capturer(VideoFrameCapturer::Create()); 43 scoped_ptr<VideoFrameCapturer> capturer(VideoFrameCapturer::Create());
44 scoped_ptr<EventExecutor> event_executor = EventExecutor::Create( 44 scoped_ptr<EventExecutor> event_executor = EventExecutor::Create(
45 context->desktop_task_runner(), context->ui_task_runner()); 45 context->desktop_task_runner(), context->ui_task_runner());
46 scoped_ptr<AudioCapturer> audio_capturer = AudioCapturer::Create(); 46 scoped_ptr<AudioCapturer> audio_capturer = AudioCapturer::Create(context);
47 47
48 if (capturer.get() == NULL || event_executor.get() == NULL) { 48 if (capturer.get() == NULL || event_executor.get() == NULL) {
49 LOG(ERROR) << "Unable to create DesktopEnvironment"; 49 LOG(ERROR) << "Unable to create DesktopEnvironment";
50 return scoped_ptr<DesktopEnvironment>(); 50 return scoped_ptr<DesktopEnvironment>();
51 } 51 }
52 52
53 #if defined(OS_WIN) 53 #if defined(OS_WIN)
54 event_executor.reset(new SessionEventExecutorWin( 54 event_executor.reset(new SessionEventExecutorWin(
55 context->desktop_task_runner(), 55 context->desktop_task_runner(),
56 event_executor.Pass())); 56 event_executor.Pass()));
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void DesktopEnvironment::OnSessionStarted( 93 void DesktopEnvironment::OnSessionStarted(
94 scoped_ptr<protocol::ClipboardStub> client_clipboard) { 94 scoped_ptr<protocol::ClipboardStub> client_clipboard) {
95 event_executor_->OnSessionStarted(client_clipboard.Pass()); 95 event_executor_->OnSessionStarted(client_clipboard.Pass());
96 } 96 }
97 97
98 void DesktopEnvironment::OnSessionFinished() { 98 void DesktopEnvironment::OnSessionFinished() {
99 event_executor_->OnSessionFinished(); 99 event_executor_->OnSessionFinished();
100 } 100 }
101 101
102 } // namespace remoting 102 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698