summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 01:42:19 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 01:42:19 +0000
commit55cd74b9b658266884b0e6f9101271e6199bc77e (patch)
tree55ad766a790960f896d42e81cfb88fed4a1553e5
parent1966fd19b25fc8ec99356a789bf9e3b5b7bab720 (diff)
downloadchromium_src-55cd74b9b658266884b0e6f9101271e6199bc77e.zip
chromium_src-55cd74b9b658266884b0e6f9101271e6199bc77e.tar.gz
chromium_src-55cd74b9b658266884b0e6f9101271e6199bc77e.tar.bz2
Revert 253259 "Move ContextProvider binding to inside GpuVideoAc..."
Broke 100+ WebKit layout tests. > Move ContextProvider binding to inside GpuVideoAcceleratorFactory > > Bind the ContextProvider inside the GpuVideoAcceleratorFactory itself, so the > Factory can decide appropriately what to do in casae of binding failure. > > Also: replace references to RendererGpuVideoAcceleratorFactory with references > to its superclass, GpuVideoAcceleratorFactory. > > BUG=345424 > TEST=local build on desktop Linux > R=avi@chromium.org, fischman@chromium.org > > Review URL: https://codereview.chromium.org/171773014 TBR=sheu@google.com Review URL: https://codereview.chromium.org/176923018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253326 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/public/renderer/DEPS1
-rw-r--r--content/public/renderer/video_encode_accelerator.cc5
-rw-r--r--content/renderer/media/media_stream_dependency_factory.cc2
-rw-r--r--content/renderer/media/renderer_gpu_video_accelerator_factories.cc15
-rw-r--r--content/renderer/media/renderer_gpu_video_accelerator_factories.h4
-rw-r--r--content/renderer/render_thread_impl.cc12
-rw-r--r--content/renderer/render_thread_impl.h4
7 files changed, 16 insertions, 27 deletions
diff --git a/content/public/renderer/DEPS b/content/public/renderer/DEPS
index 11f2420..245236a 100644
--- a/content/public/renderer/DEPS
+++ b/content/public/renderer/DEPS
@@ -1,5 +1,4 @@
include_rules = [
- "+media/filters",
"+media/video",
"+v8/include/v8.h",
]
diff --git a/content/public/renderer/video_encode_accelerator.cc b/content/public/renderer/video_encode_accelerator.cc
index 23adb16..3ed1875 100644
--- a/content/public/renderer/video_encode_accelerator.cc
+++ b/content/public/renderer/video_encode_accelerator.cc
@@ -5,7 +5,6 @@
#include "content/public/renderer/video_encode_accelerator.h"
#include "content/renderer/render_thread_impl.h"
-#include "media/filters/gpu_video_accelerator_factories.h"
namespace content {
@@ -13,8 +12,8 @@ scoped_ptr<media::VideoEncodeAccelerator>
CreateVideoEncodeAccelerator(media::VideoEncodeAccelerator::Client* client) {
scoped_ptr<media::VideoEncodeAccelerator> vea;
- scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories =
- RenderThreadImpl::current()->GetGpuFactories();
+ scoped_refptr<RendererGpuVideoAcceleratorFactories> gpu_factories =
+ RenderThreadImpl::current()->GetGpuFactories();
if (gpu_factories.get())
vea = gpu_factories->CreateVideoEncodeAccelerator(client).Pass();
diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc
index 51759a5..3217f8b 100644
--- a/content/renderer/media/media_stream_dependency_factory.cc
+++ b/content/renderer/media/media_stream_dependency_factory.cc
@@ -435,7 +435,7 @@ void MediaStreamDependencyFactory::CreatePeerConnectionFactory() {
scoped_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory;
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
- scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories =
+ scoped_refptr<RendererGpuVideoAcceleratorFactories> gpu_factories =
RenderThreadImpl::current()->GetGpuFactories();
if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) {
if (gpu_factories)
diff --git a/content/renderer/media/renderer_gpu_video_accelerator_factories.cc b/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
index 8cc2826..4ecd421 100644
--- a/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
+++ b/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
@@ -19,6 +19,7 @@
namespace content {
+RendererGpuVideoAcceleratorFactories::~RendererGpuVideoAcceleratorFactories() {}
RendererGpuVideoAcceleratorFactories::RendererGpuVideoAcceleratorFactories(
GpuChannelHost* gpu_channel_host,
const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy,
@@ -26,19 +27,7 @@ RendererGpuVideoAcceleratorFactories::RendererGpuVideoAcceleratorFactories(
: task_runner_(message_loop_proxy),
gpu_channel_host_(gpu_channel_host),
context_provider_(context_provider),
- thread_safe_sender_(ChildThread::current()->thread_safe_sender()) {
- task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&RendererGpuVideoAcceleratorFactories::BindContext, this));
-}
-
-RendererGpuVideoAcceleratorFactories::~RendererGpuVideoAcceleratorFactories() {}
-
-void RendererGpuVideoAcceleratorFactories::BindContext() {
- DCHECK(task_runner_->BelongsToCurrentThread());
- if (!context_provider_->BindToCurrentThread())
- context_provider_ = NULL;
-}
+ thread_safe_sender_(ChildThread::current()->thread_safe_sender()) {}
WebGraphicsContext3DCommandBufferImpl*
RendererGpuVideoAcceleratorFactories::GetContext3d() {
diff --git a/content/renderer/media/renderer_gpu_video_accelerator_factories.h b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
index f428685..da6b091 100644
--- a/content/renderer/media/renderer_gpu_video_accelerator_factories.h
+++ b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
@@ -71,10 +71,6 @@ class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories
virtual ~RendererGpuVideoAcceleratorFactories();
private:
- // Helper to bind |context_provider| to the |task_runner_| thread after
- // construction.
- void BindContext();
-
// Helper to get a pointer to the WebGraphicsContext3DCommandBufferImpl,
// if it has not been lost yet.
WebGraphicsContext3DCommandBufferImpl* GetContext3d();
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 33b1991..c266cab 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -77,7 +77,6 @@
#include "content/renderer/media/media_stream_dependency_factory.h"
#include "content/renderer/media/midi_message_filter.h"
#include "content/renderer/media/peer_connection_tracker.h"
-#include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
#include "content/renderer/media/video_capture_impl_manager.h"
#include "content/renderer/media/video_capture_message_filter.h"
#include "content/renderer/media/webrtc_identity_service.h"
@@ -889,13 +888,13 @@ void RenderThreadImpl::PostponeIdleNotification() {
idle_notifications_to_skip_ = 2;
}
-scoped_refptr<media::GpuVideoAcceleratorFactories>
+scoped_refptr<RendererGpuVideoAcceleratorFactories>
RenderThreadImpl::GetGpuFactories() {
DCHECK(IsMainThread());
scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel();
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
- scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories;
+ scoped_refptr<RendererGpuVideoAcceleratorFactories> gpu_factories;
scoped_refptr<base::MessageLoopProxy> media_loop_proxy =
GetMediaThreadMessageLoopProxy();
if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
@@ -914,6 +913,13 @@ RenderThreadImpl::GetGpuFactories() {
WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(),
NULL)),
"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_va_context_provider_) {
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index a613484..08f1663 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -20,6 +20,7 @@
#include "content/common/content_export.h"
#include "content/common/gpu/client/gpu_channel_host.h"
#include "content/public/renderer/render_thread.h"
+#include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
#include "ipc/ipc_channel_proxy.h"
#include "ui/gfx/native_widget_types.h"
@@ -53,7 +54,6 @@ class ForwardingMessageFilter;
namespace media {
class AudioHardwareConfig;
-class GpuVideoAcceleratorFactories;
}
namespace v8 {
@@ -264,7 +264,7 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread,
// not sent for at least one notification delay.
void PostponeIdleNotification();
- scoped_refptr<media::GpuVideoAcceleratorFactories> GetGpuFactories();
+ scoped_refptr<RendererGpuVideoAcceleratorFactories> GetGpuFactories();
scoped_refptr<cc::ContextProvider> OffscreenCompositorContextProvider();
scoped_refptr<webkit::gpu::ContextProviderWebContext>