| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_gpu_video_decoder_factories.h" | 5 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "content/common/child_thread.h" | 9 #include "content/common/child_thread.h" |
| 10 #include "content/common/gpu/client/command_buffer_proxy.h" | |
| 11 #include "content/common/gpu/client/gpu_channel_host.h" | 10 #include "content/common/gpu/client/gpu_channel_host.h" |
| 12 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 11 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 13 #include "gpu/command_buffer/client/gles2_implementation.h" | 12 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 13 #include "gpu/ipc/command_buffer_proxy.h" |
| 14 | 14 |
| 15 RendererGpuVideoDecoderFactories::~RendererGpuVideoDecoderFactories() {} | 15 RendererGpuVideoDecoderFactories::~RendererGpuVideoDecoderFactories() {} |
| 16 RendererGpuVideoDecoderFactories::RendererGpuVideoDecoderFactories( | 16 RendererGpuVideoDecoderFactories::RendererGpuVideoDecoderFactories( |
| 17 GpuChannelHost* gpu_channel_host, MessageLoop* message_loop, | 17 GpuChannelHost* gpu_channel_host, MessageLoop* message_loop, |
| 18 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi) | 18 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi) |
| 19 : message_loop_(message_loop), | 19 : message_loop_(message_loop), |
| 20 gpu_channel_host_(gpu_channel_host) { | 20 gpu_channel_host_(gpu_channel_host) { |
| 21 if (MessageLoop::current() == message_loop_) { | 21 if (MessageLoop::current() == message_loop_) { |
| 22 AsyncGetContext(wgc3dcbi, NULL); | 22 AsyncGetContext(wgc3dcbi, NULL); |
| 23 return; | 23 return; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 waiter.Wait(); | 145 waiter.Wait(); |
| 146 return shm; | 146 return shm; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void RendererGpuVideoDecoderFactories::AsyncCreateSharedMemory( | 149 void RendererGpuVideoDecoderFactories::AsyncCreateSharedMemory( |
| 150 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter) { | 150 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter) { |
| 151 DCHECK_EQ(MessageLoop::current(), ChildThread::current()->message_loop()); | 151 DCHECK_EQ(MessageLoop::current(), ChildThread::current()->message_loop()); |
| 152 *shm = ChildThread::current()->AllocateSharedMemory(size); | 152 *shm = ChildThread::current()->AllocateSharedMemory(size); |
| 153 waiter->Signal(); | 153 waiter->Signal(); |
| 154 } | 154 } |
| OLD | NEW |