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

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

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « remoting/host/audio_capturer_win.cc ('k') | remoting/host/cast_extension_session.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/audio_scheduler.h" 5 #include "remoting/host/audio_scheduler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 28 matching lines...) Expand all
39 39
40 audio_task_runner_->PostTask( 40 audio_task_runner_->PostTask(
41 FROM_HERE, base::Bind(&AudioScheduler::StartOnAudioThread, this)); 41 FROM_HERE, base::Bind(&AudioScheduler::StartOnAudioThread, this));
42 } 42 }
43 43
44 void AudioScheduler::Stop() { 44 void AudioScheduler::Stop() {
45 DCHECK(network_task_runner_->BelongsToCurrentThread()); 45 DCHECK(network_task_runner_->BelongsToCurrentThread());
46 DCHECK(audio_stub_); 46 DCHECK(audio_stub_);
47 47
48 // Clear |audio_stub_| to prevent audio packets being delivered to the client. 48 // Clear |audio_stub_| to prevent audio packets being delivered to the client.
49 audio_stub_ = NULL; 49 audio_stub_ = nullptr;
50 50
51 audio_task_runner_->PostTask( 51 audio_task_runner_->PostTask(
52 FROM_HERE, 52 FROM_HERE,
53 base::Bind(&AudioScheduler::StopOnAudioThread, this)); 53 base::Bind(&AudioScheduler::StopOnAudioThread, this));
54 } 54 }
55 55
56 AudioScheduler::~AudioScheduler() { 56 AudioScheduler::~AudioScheduler() {
57 } 57 }
58 58
59 void AudioScheduler::StartOnAudioThread() { 59 void AudioScheduler::StartOnAudioThread() {
(...skipping 22 matching lines...) Expand all
82 void AudioScheduler::EncodeAudioPacket(scoped_ptr<AudioPacket> packet) { 82 void AudioScheduler::EncodeAudioPacket(scoped_ptr<AudioPacket> packet) {
83 DCHECK(audio_task_runner_->BelongsToCurrentThread()); 83 DCHECK(audio_task_runner_->BelongsToCurrentThread());
84 DCHECK(packet.get()); 84 DCHECK(packet.get());
85 85
86 if (!enabled_) 86 if (!enabled_)
87 return; 87 return;
88 88
89 scoped_ptr<AudioPacket> encoded_packet = 89 scoped_ptr<AudioPacket> encoded_packet =
90 audio_encoder_->Encode(packet.Pass()); 90 audio_encoder_->Encode(packet.Pass());
91 91
92 // The audio encoder returns a NULL audio packet if there's no audio to send. 92 // The audio encoder returns a null audio packet if there's no audio to send.
93 if (encoded_packet.get()) { 93 if (encoded_packet.get()) {
94 network_task_runner_->PostTask( 94 network_task_runner_->PostTask(
95 FROM_HERE, base::Bind(&AudioScheduler::SendAudioPacket, 95 FROM_HERE, base::Bind(&AudioScheduler::SendAudioPacket,
96 this, base::Passed(&encoded_packet))); 96 this, base::Passed(&encoded_packet)));
97 } 97 }
98 } 98 }
99 99
100 void AudioScheduler::SendAudioPacket(scoped_ptr<AudioPacket> packet) { 100 void AudioScheduler::SendAudioPacket(scoped_ptr<AudioPacket> packet) {
101 DCHECK(network_task_runner_->BelongsToCurrentThread()); 101 DCHECK(network_task_runner_->BelongsToCurrentThread());
102 DCHECK(packet.get()); 102 DCHECK(packet.get());
103 103
104 if (!audio_stub_) 104 if (!audio_stub_)
105 return; 105 return;
106 106
107 audio_stub_->ProcessAudioPacket(packet.Pass(), base::Closure()); 107 audio_stub_->ProcessAudioPacket(packet.Pass(), base::Closure());
108 } 108 }
109 109
110 } // namespace remoting 110 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/audio_capturer_win.cc ('k') | remoting/host/cast_extension_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698