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

Side by Side Diff: media/filters/decoder_selector.cc

Issue 1904213003: Convert //media/filters from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove include Created 4 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 unified diff | Download patch
« no previous file with comments | « media/filters/decoder_selector.h ('k') | media/filters/decoder_stream.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/filters/decoder_selector.h" 5 #include "media/filters/decoder_selector.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 output_cb_); 138 output_cb_);
139 } 139 }
140 140
141 template <DemuxerStream::Type StreamType> 141 template <DemuxerStream::Type StreamType>
142 void DecoderSelector<StreamType>::DecryptingDecoderInitDone(bool success) { 142 void DecoderSelector<StreamType>::DecryptingDecoderInitDone(bool success) {
143 DVLOG(2) << __FUNCTION__; 143 DVLOG(2) << __FUNCTION__;
144 DCHECK(task_runner_->BelongsToCurrentThread()); 144 DCHECK(task_runner_->BelongsToCurrentThread());
145 145
146 if (success) { 146 if (success) {
147 base::ResetAndReturn(&select_decoder_cb_) 147 base::ResetAndReturn(&select_decoder_cb_)
148 .Run(std::move(decoder_), scoped_ptr<DecryptingDemuxerStream>()); 148 .Run(std::move(decoder_), std::unique_ptr<DecryptingDemuxerStream>());
149 return; 149 return;
150 } 150 }
151 151
152 decoder_.reset(); 152 decoder_.reset();
153 153
154 // When we get here decrypt-and-decode is not supported. Try to use 154 // When we get here decrypt-and-decode is not supported. Try to use
155 // DecryptingDemuxerStream to do decrypt-only. 155 // DecryptingDemuxerStream to do decrypt-only.
156 InitializeDecryptingDemuxerStream(); 156 InitializeDecryptingDemuxerStream();
157 } 157 }
158 #endif // !defined(OS_ANDROID) 158 #endif // !defined(OS_ANDROID)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 base::ResetAndReturn(&select_decoder_cb_) 225 base::ResetAndReturn(&select_decoder_cb_)
226 .Run(std::move(decoder_), std::move(decrypted_stream_)); 226 .Run(std::move(decoder_), std::move(decrypted_stream_));
227 } 227 }
228 228
229 template <DemuxerStream::Type StreamType> 229 template <DemuxerStream::Type StreamType>
230 void DecoderSelector<StreamType>::ReturnNullDecoder() { 230 void DecoderSelector<StreamType>::ReturnNullDecoder() {
231 DVLOG(2) << __FUNCTION__; 231 DVLOG(2) << __FUNCTION__;
232 DCHECK(task_runner_->BelongsToCurrentThread()); 232 DCHECK(task_runner_->BelongsToCurrentThread());
233 base::ResetAndReturn(&select_decoder_cb_) 233 base::ResetAndReturn(&select_decoder_cb_)
234 .Run(scoped_ptr<Decoder>(), 234 .Run(std::unique_ptr<Decoder>(),
235 scoped_ptr<DecryptingDemuxerStream>()); 235 std::unique_ptr<DecryptingDemuxerStream>());
236 } 236 }
237 237
238 // These forward declarations tell the compiler that we will use 238 // These forward declarations tell the compiler that we will use
239 // DecoderSelector with these arguments, allowing us to keep these definitions 239 // DecoderSelector with these arguments, allowing us to keep these definitions
240 // in our .cc without causing linker errors. This also means if anyone tries to 240 // in our .cc without causing linker errors. This also means if anyone tries to
241 // instantiate a DecoderSelector with anything but these two specializations 241 // instantiate a DecoderSelector with anything but these two specializations
242 // they'll most likely get linker errors. 242 // they'll most likely get linker errors.
243 template class DecoderSelector<DemuxerStream::AUDIO>; 243 template class DecoderSelector<DemuxerStream::AUDIO>;
244 template class DecoderSelector<DemuxerStream::VIDEO>; 244 template class DecoderSelector<DemuxerStream::VIDEO>;
245 245
246 } // namespace media 246 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decoder_selector.h ('k') | media/filters/decoder_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698