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

Side by Side Diff: media/filters/decoder_base.h

Issue 3581008: Fix instances of passing raw pointers to RefCounted objects in tasks. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Merge Created 10 years, 2 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/base/pipeline_impl.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // A base class that provides the plumbing for a decoder filters. 5 // A base class that provides the plumbing for a decoder filters.
6 6
7 #ifndef MEDIA_FILTERS_DECODER_BASE_H_ 7 #ifndef MEDIA_FILTERS_DECODER_BASE_H_
8 #define MEDIA_FILTERS_DECODER_BASE_H_ 8 #define MEDIA_FILTERS_DECODER_BASE_H_
9 9
10 #include <deque> 10 #include <deque>
(...skipping 12 matching lines...) Expand all
23 23
24 // In this class, we over-specify method lookup via this-> to avoid unexpected 24 // In this class, we over-specify method lookup via this-> to avoid unexpected
25 // name resolution issues due to the two-phase lookup needed for dependent 25 // name resolution issues due to the two-phase lookup needed for dependent
26 // name resolution in templates. 26 // name resolution in templates.
27 template <class Decoder, class Output> 27 template <class Decoder, class Output>
28 class DecoderBase : public Decoder { 28 class DecoderBase : public Decoder {
29 public: 29 public:
30 30
31 // MediaFilter implementation. 31 // MediaFilter implementation.
32 virtual void Stop(FilterCallback* callback) { 32 virtual void Stop(FilterCallback* callback) {
33 this->message_loop()->PostTask(FROM_HERE, 33 this->message_loop()->PostTask(
34 FROM_HERE,
34 NewRunnableMethod(this, &DecoderBase::StopTask, callback)); 35 NewRunnableMethod(this, &DecoderBase::StopTask, callback));
35 } 36 }
36 37
37 virtual void Seek(base::TimeDelta time, 38 virtual void Seek(base::TimeDelta time,
38 FilterCallback* callback) { 39 FilterCallback* callback) {
39 this->message_loop()->PostTask(FROM_HERE, 40 this->message_loop()->PostTask(
41 FROM_HERE,
40 NewRunnableMethod(this, &DecoderBase::SeekTask, time, callback)); 42 NewRunnableMethod(this, &DecoderBase::SeekTask, time, callback));
41 } 43 }
42 44
43 // Decoder implementation. 45 // Decoder implementation.
44 virtual void Initialize(DemuxerStream* demuxer_stream, 46 virtual void Initialize(DemuxerStream* demuxer_stream,
45 FilterCallback* callback) { 47 FilterCallback* callback) {
46 this->message_loop()->PostTask(FROM_HERE, 48 this->message_loop()->PostTask(
47 NewRunnableMethod(this, &DecoderBase::InitializeTask, demuxer_stream, 49 FROM_HERE,
50 NewRunnableMethod(this,
51 &DecoderBase::InitializeTask,
52 make_scoped_refptr(demuxer_stream),
48 callback)); 53 callback));
49 } 54 }
50 55
51 virtual const MediaFormat& media_format() { return media_format_; } 56 virtual const MediaFormat& media_format() { return media_format_; }
52 57
53 // Audio decoder. 58 // Audio decoder.
54 // Note that this class is only used by the audio decoder, this will 59 // Note that this class is only used by the audio decoder, this will
55 // eventually be merged into FFmpegAudioDecoder. 60 // eventually be merged into FFmpegAudioDecoder.
56 virtual void ProduceAudioSamples(scoped_refptr<Output> output) { 61 virtual void ProduceAudioSamples(scoped_refptr<Output> output) {
57 this->message_loop()->PostTask(FROM_HERE, 62 this->message_loop()->PostTask(FROM_HERE,
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 kStopped, 322 kStopped,
318 }; 323 };
319 State state_; 324 State state_;
320 325
321 DISALLOW_COPY_AND_ASSIGN(DecoderBase); 326 DISALLOW_COPY_AND_ASSIGN(DecoderBase);
322 }; 327 };
323 328
324 } // namespace media 329 } // namespace media
325 330
326 #endif // MEDIA_FILTERS_DECODER_BASE_H_ 331 #endif // MEDIA_FILTERS_DECODER_BASE_H_
OLDNEW
« no previous file with comments | « media/base/pipeline_impl.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698