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

Unified Diff: media/gpu/ipc/client/gpu_video_decode_accelerator_host.h

Issue 2627173002: Adds locks for CommandBufferProxyImpl invalidation (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/gpu/ipc/client/gpu_video_decode_accelerator_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/ipc/client/gpu_video_decode_accelerator_host.h
diff --git a/media/gpu/ipc/client/gpu_video_decode_accelerator_host.h b/media/gpu/ipc/client/gpu_video_decode_accelerator_host.h
index 2ba09634b483b851cc02029ad6e4a12cc3ccd76c..a2f6ffde7e3f8826a99b128ca62f8e2b9c31a1d9 100644
--- a/media/gpu/ipc/client/gpu_video_decode_accelerator_host.h
+++ b/media/gpu/ipc/client/gpu_video_decode_accelerator_host.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/single_thread_task_runner.h"
#include "base/threading/non_thread_safe.h"
#include "gpu/ipc/client/command_buffer_proxy_impl.h"
#include "ipc/ipc_listener.h"
@@ -86,6 +87,10 @@ class GpuVideoDecodeAcceleratorHost
// The client that will receive callbacks from the decoder.
Client* client_;
+ // Protect |impl_|. |impl_| is used on media thread, but it can be invalidated
+ // on main thread.
+ base::Lock impl_lock_;
+
// Unowned reference to the gpu::CommandBufferProxyImpl that created us.
// |this| registers as a DeletionObserver of |impl_|, the so reference is
// always valid as long as it is not NULL.
@@ -94,6 +99,10 @@ class GpuVideoDecodeAcceleratorHost
// Requested dimensions of the buffer, from ProvidePictureBuffers().
gfx::Size picture_buffer_dimensions_;
+ // Task runner for tasks that should run on the thread this class is
+ // constructed.
+ scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
+
// WeakPtr factory for posting tasks back to itself.
base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_;
« no previous file with comments | « no previous file | media/gpu/ipc/client/gpu_video_decode_accelerator_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698