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

Unified Diff: remoting/host/audio_scheduler.cc

Issue 14520018: Create the desktop environment before any of the channel were connected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 8 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
« no previous file with comments | « remoting/host/audio_scheduler.h ('k') | remoting/host/chromoting_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/audio_scheduler.cc
diff --git a/remoting/host/audio_scheduler.cc b/remoting/host/audio_scheduler.cc
index a477fe720dab0b23dffe1ef205e1413e4e764a53..b8bf7ef07d8e74339214864e3d0e509db0b9e956 100644
--- a/remoting/host/audio_scheduler.cc
+++ b/remoting/host/audio_scheduler.cc
@@ -15,25 +15,30 @@
namespace remoting {
-// static
-scoped_refptr<AudioScheduler> AudioScheduler::Create(
+AudioScheduler::AudioScheduler(
scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
scoped_ptr<AudioCapturer> audio_capturer,
scoped_ptr<AudioEncoder> audio_encoder,
- protocol::AudioStub* audio_stub) {
- DCHECK(network_task_runner->BelongsToCurrentThread());
- DCHECK(audio_capturer);
- DCHECK(audio_encoder);
- DCHECK(audio_stub);
-
- scoped_refptr<AudioScheduler> scheduler = new AudioScheduler(
- audio_task_runner, network_task_runner,
- audio_capturer.Pass(), audio_encoder.Pass(), audio_stub);
- audio_task_runner->PostTask(
- FROM_HERE, base::Bind(&AudioScheduler::StartOnAudioThread, scheduler));
-
- return scheduler;
+ protocol::AudioStub* audio_stub)
+ : audio_task_runner_(audio_task_runner),
+ network_task_runner_(network_task_runner),
+ audio_capturer_(audio_capturer.Pass()),
+ audio_encoder_(audio_encoder.Pass()),
+ audio_stub_(audio_stub),
+ network_stopped_(false),
+ enabled_(true) {
+ DCHECK(network_task_runner_->BelongsToCurrentThread());
+ DCHECK(audio_capturer_);
+ DCHECK(audio_encoder_);
+ DCHECK(audio_stub_);
+}
+
+void AudioScheduler::Start() {
+ DCHECK(network_task_runner_->BelongsToCurrentThread());
+
+ audio_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&AudioScheduler::StartOnAudioThread, this));
}
void AudioScheduler::Stop() {
@@ -48,21 +53,6 @@ void AudioScheduler::Stop() {
base::Bind(&AudioScheduler::StopOnAudioThread, this));
}
-AudioScheduler::AudioScheduler(
- scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
- scoped_ptr<AudioCapturer> audio_capturer,
- scoped_ptr<AudioEncoder> audio_encoder,
- protocol::AudioStub* audio_stub)
- : audio_task_runner_(audio_task_runner),
- network_task_runner_(network_task_runner),
- audio_capturer_(audio_capturer.Pass()),
- audio_encoder_(audio_encoder.Pass()),
- audio_stub_(audio_stub),
- network_stopped_(false),
- enabled_(true) {
-}
-
AudioScheduler::~AudioScheduler() {
}
« no previous file with comments | « remoting/host/audio_scheduler.h ('k') | remoting/host/chromoting_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698