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

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

Issue 827013005: Avoid double task trampoline for Pipeline state transitions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix MojoRendererImpl. Created 5 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chunk_demuxer.h" 5 #include "media/filters/chunk_demuxer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <list> 9 #include <list>
10 10
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 } 1125 }
1126 1126
1127 void ChunkDemuxer::Initialize( 1127 void ChunkDemuxer::Initialize(
1128 DemuxerHost* host, 1128 DemuxerHost* host,
1129 const PipelineStatusCB& cb, 1129 const PipelineStatusCB& cb,
1130 bool enable_text_tracks) { 1130 bool enable_text_tracks) {
1131 DVLOG(1) << "Init()"; 1131 DVLOG(1) << "Init()";
1132 1132
1133 base::AutoLock auto_lock(lock_); 1133 base::AutoLock auto_lock(lock_);
1134 1134
1135 // Always post the callback because |this| could be destroyed upon failure.
1135 init_cb_ = BindToCurrentLoop(cb); 1136 init_cb_ = BindToCurrentLoop(cb);
1137
1136 if (state_ == SHUTDOWN) { 1138 if (state_ == SHUTDOWN) {
1137 base::ResetAndReturn(&init_cb_).Run(DEMUXER_ERROR_COULD_NOT_OPEN); 1139 base::ResetAndReturn(&init_cb_).Run(DEMUXER_ERROR_COULD_NOT_OPEN);
1138 return; 1140 return;
1139 } 1141 }
1140 DCHECK_EQ(state_, WAITING_FOR_INIT); 1142 DCHECK_EQ(state_, WAITING_FOR_INIT);
1141 host_ = host; 1143 host_ = host;
1142 enable_text_ = enable_text_tracks; 1144 enable_text_ = enable_text_tracks;
1143 1145
1144 ChangeState_Locked(INITIALIZING); 1146 ChangeState_Locked(INITIALIZING);
1145 1147
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 } 1854 }
1853 1855
1854 void ChunkDemuxer::ShutdownAllStreams() { 1856 void ChunkDemuxer::ShutdownAllStreams() {
1855 for (SourceStateMap::iterator itr = source_state_map_.begin(); 1857 for (SourceStateMap::iterator itr = source_state_map_.begin();
1856 itr != source_state_map_.end(); ++itr) { 1858 itr != source_state_map_.end(); ++itr) {
1857 itr->second->Shutdown(); 1859 itr->second->Shutdown();
1858 } 1860 }
1859 } 1861 }
1860 1862
1861 } // namespace media 1863 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698