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

Unified Diff: media/base/pipeline_unittest.cc

Issue 14217008: Remove reference counting from media::DemuxerStream and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/pipeline.cc ('k') | media/base/video_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_unittest.cc
diff --git a/media/base/pipeline_unittest.cc b/media/base/pipeline_unittest.cc
index b9a7e23135803072352a0fc44e79dcb1c0badb82..9602e4a9024d78a7dd5f1bc57e1797e23c69cb55 100644
--- a/media/base/pipeline_unittest.cc
+++ b/media/base/pipeline_unittest.cc
@@ -141,7 +141,7 @@ class PipelineTest : public ::testing::Test {
// Configure the demuxer to return the streams.
for (size_t i = 0; i < streams->size(); ++i) {
- scoped_refptr<DemuxerStream> stream((*streams)[i]);
+ DemuxerStream* stream = (*streams)[i];
EXPECT_CALL(*demuxer_, GetStream(stream->type()))
.WillRepeatedly(Return(stream));
}
@@ -152,14 +152,15 @@ class PipelineTest : public ::testing::Test {
InitializeDemuxer(streams, base::TimeDelta::FromSeconds(10));
}
- StrictMock<MockDemuxerStream>* CreateStream(DemuxerStream::Type type) {
- StrictMock<MockDemuxerStream>* stream =
- new StrictMock<MockDemuxerStream>(type);
- return stream;
+ scoped_ptr<StrictMock<MockDemuxerStream> > CreateStream(
+ DemuxerStream::Type type) {
+ scoped_ptr<StrictMock<MockDemuxerStream> > stream(
+ new StrictMock<MockDemuxerStream>(type));
+ return stream.Pass();
}
// Sets up expectations to allow the video renderer to initialize.
- void InitializeVideoRenderer(const scoped_refptr<DemuxerStream>& stream) {
+ void InitializeVideoRenderer(DemuxerStream* stream) {
EXPECT_CALL(*video_renderer_, Initialize(stream, _, _, _, _, _, _, _, _))
.WillOnce(RunCallback<1>(PIPELINE_OK));
EXPECT_CALL(*video_renderer_, SetPlaybackRate(0.0f));
@@ -172,7 +173,7 @@ class PipelineTest : public ::testing::Test {
}
// Sets up expectations to allow the audio renderer to initialize.
- void InitializeAudioRenderer(const scoped_refptr<DemuxerStream>& stream,
+ void InitializeAudioRenderer(DemuxerStream* stream,
bool disable_after_init_cb) {
if (disable_after_init_cb) {
EXPECT_CALL(*audio_renderer_, Initialize(stream, _, _, _, _, _, _, _))
@@ -229,11 +230,11 @@ class PipelineTest : public ::testing::Test {
}
MockDemuxerStream* audio_stream() {
- return audio_stream_;
+ return audio_stream_.get();
}
MockDemuxerStream* video_stream() {
- return video_stream_;
+ return video_stream_.get();
}
void ExpectSeek(const base::TimeDelta& seek_time) {
@@ -294,8 +295,8 @@ class PipelineTest : public ::testing::Test {
scoped_ptr<MockDemuxer> demuxer_;
MockVideoRenderer* video_renderer_;
MockAudioRenderer* audio_renderer_;
- scoped_refptr<StrictMock<MockDemuxerStream> > audio_stream_;
- scoped_refptr<StrictMock<MockDemuxerStream> > video_stream_;
+ scoped_ptr<StrictMock<MockDemuxerStream> > audio_stream_;
+ scoped_ptr<StrictMock<MockDemuxerStream> > video_stream_;
AudioRenderer::TimeCB audio_time_cb_;
VideoDecoderConfig video_decoder_config_;
« no previous file with comments | « media/base/pipeline.cc ('k') | media/base/video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698