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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 159263004: Remove threading from GpuVideoAcceleratorFactories (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 0f7ba9fd NULL pointer fix. Created 6 years, 10 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
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 7a8d51d6b1764fe5c81e7a68376f70da0382f52a..3a0c0fd5e5ad7d0f5c3342fba55fad44fa3344e9 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -898,6 +898,8 @@ RenderThreadImpl::GetGpuFactories() {
scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel();
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
scoped_refptr<RendererGpuVideoAcceleratorFactories> gpu_factories;
+ scoped_refptr<base::MessageLoopProxy> media_loop_proxy =
+ GetMediaThreadMessageLoopProxy();
if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
if (!gpu_va_context_provider_ ||
gpu_va_context_provider_->DestroyedOnMainThread()) {
@@ -913,11 +915,18 @@ RenderThreadImpl::GetGpuFactories() {
GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"),
WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())),
"GPU-VideoAccelerator-Offscreen");
+ if (gpu_va_context_provider_) {
+ media_loop_proxy->PostTask(
+ FROM_HERE,
+ base::Bind(
+ base::IgnoreResult(&cc::ContextProvider::BindToCurrentThread),
+ gpu_va_context_provider_));
+ }
}
}
- if (gpu_channel_host) {
+ if (gpu_va_context_provider_) {
gpu_factories = new RendererGpuVideoAcceleratorFactories(
- gpu_channel_host.get(), gpu_va_context_provider_);
+ gpu_channel_host, media_loop_proxy, gpu_va_context_provider_);
}
return gpu_factories;
}
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.cc ('k') | media/cast/test/fake_gpu_video_accelerator_factories.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698