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

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

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/filters/decoder_base.h ('k') | media/filters/ffmpeg_video_decoder.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 #include "base/callback.h" 5 #include "base/callback.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 NewRunnableMethod(this, &FFmpegDemuxer::SeekTask, time, callback)); 305 NewRunnableMethod(this, &FFmpegDemuxer::SeekTask, time, callback));
306 } 306 }
307 307
308 void FFmpegDemuxer::OnAudioRendererDisabled() { 308 void FFmpegDemuxer::OnAudioRendererDisabled() {
309 message_loop()->PostTask(FROM_HERE, 309 message_loop()->PostTask(FROM_HERE,
310 NewRunnableMethod(this, &FFmpegDemuxer::DisableAudioStreamTask)); 310 NewRunnableMethod(this, &FFmpegDemuxer::DisableAudioStreamTask));
311 } 311 }
312 312
313 void FFmpegDemuxer::Initialize(DataSource* data_source, 313 void FFmpegDemuxer::Initialize(DataSource* data_source,
314 FilterCallback* callback) { 314 FilterCallback* callback) {
315 message_loop()->PostTask(FROM_HERE, 315 message_loop()->PostTask(
316 NewRunnableMethod(this, &FFmpegDemuxer::InitializeTask, data_source, 316 FROM_HERE,
317 NewRunnableMethod(this,
318 &FFmpegDemuxer::InitializeTask,
319 make_scoped_refptr(data_source),
317 callback)); 320 callback));
318 } 321 }
319 322
320 size_t FFmpegDemuxer::GetNumberOfStreams() { 323 size_t FFmpegDemuxer::GetNumberOfStreams() {
321 return streams_.size(); 324 return streams_.size();
322 } 325 }
323 326
324 scoped_refptr<DemuxerStream> FFmpegDemuxer::GetStream(int stream) { 327 scoped_refptr<DemuxerStream> FFmpegDemuxer::GetStream(int stream) {
325 DCHECK_GE(stream, 0); 328 DCHECK_GE(stream, 0);
326 DCHECK_LT(stream, static_cast<int>(streams_.size())); 329 DCHECK_LT(stream, static_cast<int>(streams_.size()));
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 read_event_.Wait(); 613 read_event_.Wait();
611 return last_read_bytes_; 614 return last_read_bytes_;
612 } 615 }
613 616
614 void FFmpegDemuxer::SignalReadCompleted(size_t size) { 617 void FFmpegDemuxer::SignalReadCompleted(size_t size) {
615 last_read_bytes_ = size; 618 last_read_bytes_ = size;
616 read_event_.Signal(); 619 read_event_.Signal();
617 } 620 }
618 621
619 } // namespace media 622 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decoder_base.h ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698