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

Side by Side Diff: content/renderer/media/webmediaplayer_impl.cc

Issue 27420004: Remove threading from RendererGpuVideoAcceleratorFactories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dthread
Patch Set: 51676bf4 Initial. Created 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/media/webmediaplayer_impl.h" 5 #include "content/renderer/media/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 DCHECK(main_loop_->BelongsToCurrentThread()); 1163 DCHECK(main_loop_->BelongsToCurrentThread());
1164 1164
1165 // Abort any pending IO so stopping the pipeline doesn't get blocked. 1165 // Abort any pending IO so stopping the pipeline doesn't get blocked.
1166 if (data_source_) 1166 if (data_source_)
1167 data_source_->Abort(); 1167 data_source_->Abort();
1168 if (chunk_demuxer_) { 1168 if (chunk_demuxer_) {
1169 chunk_demuxer_->Shutdown(); 1169 chunk_demuxer_->Shutdown();
1170 chunk_demuxer_ = NULL; 1170 chunk_demuxer_ = NULL;
1171 } 1171 }
1172 1172
1173 if (gpu_factories_.get()) { 1173 gpu_factories_ = NULL;
1174 gpu_factories_->Abort();
1175 gpu_factories_ = NULL;
1176 }
1177 1174
1178 // Make sure to kill the pipeline so there's no more media threads running. 1175 // Make sure to kill the pipeline so there's no more media threads running.
1179 // Note: stopping the pipeline might block for a long time. 1176 // Note: stopping the pipeline might block for a long time.
1180 base::WaitableEvent waiter(false, false); 1177 base::WaitableEvent waiter(false, false);
1181 pipeline_->Stop(base::Bind( 1178 pipeline_->Stop(base::Bind(
1182 &base::WaitableEvent::Signal, base::Unretained(&waiter))); 1179 &base::WaitableEvent::Signal, base::Unretained(&waiter)));
1183 waiter.Wait(); 1180 waiter.Wait();
1184 1181
1185 // Let V8 know we are not using extra resources anymore. 1182 // Let V8 know we are not using extra resources anymore.
1186 if (incremented_externally_allocated_memory_) { 1183 if (incremented_externally_allocated_memory_) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 &WebMediaPlayerImpl::Repaint, AsWeakPtr())); 1245 &WebMediaPlayerImpl::Repaint, AsWeakPtr()));
1249 } 1246 }
1250 1247
1251 void WebMediaPlayerImpl::SetPlaybackRate(float playback_rate) { 1248 void WebMediaPlayerImpl::SetPlaybackRate(float playback_rate) {
1252 pipeline_->SetPlaybackRate(playback_rate); 1249 pipeline_->SetPlaybackRate(playback_rate);
1253 if (data_source_) 1250 if (data_source_)
1254 data_source_->SetPlaybackRate(playback_rate); 1251 data_source_->SetPlaybackRate(playback_rate);
1255 } 1252 }
1256 1253
1257 } // namespace content 1254 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698