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

Side by Side Diff: remoting/protocol/audio_decode_scheduler.cc

Issue 2838433003: Replace unique_ptr.reset(other_unique_ptr.release()) with std::move() in chrome (Closed)
Patch Set: Replace unique_ptr.reset(other_unique_ptr.release()) with std::move() in chrome Created 3 years, 7 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/clipboard_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/protocol/audio_decode_scheduler.h" 5 #include "remoting/protocol/audio_decode_scheduler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 13 matching lines...) Expand all
24 audio_consumer_(audio_consumer), 24 audio_consumer_(audio_consumer),
25 weak_factory_(this) {} 25 weak_factory_(this) {}
26 26
27 AudioDecodeScheduler::~AudioDecodeScheduler() { 27 AudioDecodeScheduler::~AudioDecodeScheduler() {
28 audio_decode_task_runner_->DeleteSoon(FROM_HERE, decoder_.release()); 28 audio_decode_task_runner_->DeleteSoon(FROM_HERE, decoder_.release());
29 } 29 }
30 30
31 void AudioDecodeScheduler::Initialize(const protocol::SessionConfig& config) { 31 void AudioDecodeScheduler::Initialize(const protocol::SessionConfig& config) {
32 DCHECK(thread_checker_.CalledOnValidThread()); 32 DCHECK(thread_checker_.CalledOnValidThread());
33 DCHECK(!decoder_); 33 DCHECK(!decoder_);
34 decoder_.reset(AudioDecoder::CreateAudioDecoder(config).release()); 34 decoder_ = AudioDecoder::CreateAudioDecoder(config);
35 } 35 }
36 36
37 void AudioDecodeScheduler::ProcessAudioPacket( 37 void AudioDecodeScheduler::ProcessAudioPacket(
38 std::unique_ptr<AudioPacket> packet, 38 std::unique_ptr<AudioPacket> packet,
39 const base::Closure& done) { 39 const base::Closure& done) {
40 DCHECK(thread_checker_.CalledOnValidThread()); 40 DCHECK(thread_checker_.CalledOnValidThread());
41 41
42 base::PostTaskAndReplyWithResult( 42 base::PostTaskAndReplyWithResult(
43 audio_decode_task_runner_.get(), FROM_HERE, 43 audio_decode_task_runner_.get(), FROM_HERE,
44 base::Bind(&AudioDecoder::Decode, base::Unretained(decoder_.get()), 44 base::Bind(&AudioDecoder::Decode, base::Unretained(decoder_.get()),
(...skipping 10 matching lines...) Expand all
55 if (!packet || !audio_consumer_) { 55 if (!packet || !audio_consumer_) {
56 done.Run(); 56 done.Run();
57 return; 57 return;
58 } 58 }
59 59
60 audio_consumer_->ProcessAudioPacket(std::move(packet), done); 60 audio_consumer_->ProcessAudioPacket(std::move(packet), done);
61 } 61 }
62 62
63 } // namespace protocol 63 } // namespace protocol
64 } // namespace remoting 64 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/clipboard_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698