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

Unified Diff: media/filters/chunk_demuxer.cc

Issue 9968117: Move Demuxer::set_host() to Initialize(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: fixes Created 8 years, 9 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/filters/chunk_demuxer.h ('k') | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/chunk_demuxer.cc
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc
index 452d5353f26ef4abecf6277d92c436e54ab3d681..d3f532cc9fbb13a601ec18ef57ccef79ed50a859 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -333,6 +333,7 @@ void ChunkDemuxerStream::CreateReadDoneClosures_Locked(ClosureQueue* closures) {
ChunkDemuxer::ChunkDemuxer(ChunkDemuxerClient* client)
: state_(WAITING_FOR_INIT),
+ host_(NULL),
client_(client),
buffered_bytes_(0),
seek_waits_for_data_(true) {
@@ -343,11 +344,13 @@ ChunkDemuxer::~ChunkDemuxer() {
DCHECK_NE(state_, INITIALIZED);
}
-void ChunkDemuxer::Initialize(const PipelineStatusCB& cb) {
+void ChunkDemuxer::Initialize(DemuxerHost* host,
+ const PipelineStatusCB& cb) {
DVLOG(1) << "Init()";
{
base::AutoLock auto_lock(lock_);
DCHECK_EQ(state_, WAITING_FOR_INIT);
+ host_ = host;
ChangeState_Locked(INITIALIZING);
init_cb_ = cb;
@@ -537,13 +540,13 @@ bool ChunkDemuxer::AppendData(const uint8* data, size_t length) {
}
// Notify the host of 'network activity' because we got data.
- host()->SetBufferedBytes(buffered_bytes);
+ host_->SetBufferedBytes(buffered_bytes);
if (buffered_ts.InSeconds() >= 0) {
- host()->SetBufferedTime(buffered_ts);
+ host_->SetBufferedTime(buffered_ts);
}
- host()->SetNetworkActivity(true);
+ host_->SetNetworkActivity(true);
if (!cb.is_null())
cb.Run(PIPELINE_OK);
@@ -649,7 +652,7 @@ void ChunkDemuxer::ReportError_Locked(PipelineStatus error) {
}
base::AutoUnlock auto_unlock(lock_);
- host()->OnDemuxerError(error);
+ host_->OnDemuxerError(error);
}
void ChunkDemuxer::OnStreamParserInitDone(bool success,
@@ -662,8 +665,8 @@ void ChunkDemuxer::OnStreamParserInitDone(bool success,
}
duration_ = duration;
- host()->SetDuration(duration_);
- host()->SetCurrentReadPosition(0);
+ host_->SetDuration(duration_);
+ host_->SetCurrentReadPosition(0);
ChangeState_Locked(INITIALIZED);
PipelineStatusCB cb;
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698