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

Unified Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.h

Issue 23440015: Fix webrtc HW encode deadlock scenarios. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 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/media/renderer_gpu_video_accelerator_factories.h
diff --git a/content/renderer/media/renderer_gpu_video_accelerator_factories.h b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
index fcc4ffb411a961b5968b135a7590d3efe1e40c95..4dcf4485be97eba3b94de5b0e9f9c1d1d61bb085 100644
--- a/content/renderer/media/renderer_gpu_video_accelerator_factories.h
+++ b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/synchronization/waitable_event.h"
+#include "base/threading/thread.h"
#include "content/common/content_export.h"
#include "media/filters/gpu_video_accelerator_factories.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -141,6 +142,17 @@ class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories
std::vector<uint32> created_textures_;
std::vector<gpu::Mailbox> created_texture_mailboxes_;
+ // Renderer thread designated solely to allocate shared memory on. We hide on
+ // it from webrtc to avoid all kinds of deadlocks of varying complexity, which
+ // we would randomly end up in if we wanted to allocate shared memory on the
+ // renderer's ChildThread, as webrtc likes to sleep on it while calling into
+ // encoder via a varying number of indirections and/or while holding critical
+ // sections.
+ // The thread is owned by the original factories, while the proxy is shared
+ // by all clones.
+ scoped_ptr<base::Thread> shm_alloc_thread_;
Ami GONE FROM CHROMIUM 2013/09/04 20:47:56 Previously you said that "the original factories o
+ scoped_refptr<base::MessageLoopProxy> shm_alloc_message_loop_;
+
DISALLOW_COPY_AND_ASSIGN(RendererGpuVideoAcceleratorFactories);
};

Powered by Google App Engine
This is Rietveld 408576698