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/common/gpu/client/gpu_channel_host.h" | 5 #include "content/common/gpu/client/gpu_channel_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/message_loop/message_loop_proxy.h" |
12 #include "base/posix/eintr_wrapper.h" | 12 #include "base/posix/eintr_wrapper.h" |
13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
15 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 15 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
| 16 #include "content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h" |
16 #include "content/common/gpu/gpu_messages.h" | 17 #include "content/common/gpu/gpu_messages.h" |
17 #include "ipc/ipc_sync_message_filter.h" | 18 #include "ipc/ipc_sync_message_filter.h" |
18 #include "url/gurl.h" | 19 #include "url/gurl.h" |
19 | 20 |
20 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
21 #include "content/public/common/sandbox_init.h" | 22 #include "content/public/common/sandbox_init.h" |
22 #endif | 23 #endif |
23 | 24 |
24 using base::AutoLock; | 25 using base::AutoLock; |
25 using base::MessageLoopProxy; | 26 using base::MessageLoopProxy; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 MessageLoopProxy::current())); | 291 MessageLoopProxy::current())); |
291 } | 292 } |
292 | 293 |
293 void GpuChannelHost::RemoveRoute(int route_id) { | 294 void GpuChannelHost::RemoveRoute(int route_id) { |
294 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); | 295 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); |
295 io_loop->PostTask(FROM_HERE, | 296 io_loop->PostTask(FROM_HERE, |
296 base::Bind(&GpuChannelHost::MessageFilter::RemoveRoute, | 297 base::Bind(&GpuChannelHost::MessageFilter::RemoveRoute, |
297 channel_filter_.get(), route_id)); | 298 channel_filter_.get(), route_id)); |
298 } | 299 } |
299 | 300 |
| 301 GpuJpegDecodeAcceleratorHost* GpuChannelHost::CreateJpegDecoder() { |
| 302 TRACE_EVENT0("gpu", "GpuChannelHost::CreateJpegDecoder"); |
| 303 |
| 304 GpuJpegDecodeAcceleratorHost* decoder = |
| 305 new GpuJpegDecodeAcceleratorHost(this); |
| 306 return decoder; |
| 307 } |
| 308 |
300 base::SharedMemoryHandle GpuChannelHost::ShareToGpuProcess( | 309 base::SharedMemoryHandle GpuChannelHost::ShareToGpuProcess( |
301 base::SharedMemoryHandle source_handle) { | 310 base::SharedMemoryHandle source_handle) { |
302 if (IsLost()) | 311 if (IsLost()) |
303 return base::SharedMemory::NULLHandle(); | 312 return base::SharedMemory::NULLHandle(); |
304 | 313 |
305 #if defined(OS_WIN) | 314 #if defined(OS_WIN) |
306 // Windows needs to explicitly duplicate the handle out to another process. | 315 // Windows needs to explicitly duplicate the handle out to another process. |
307 base::SharedMemoryHandle target_handle; | 316 base::SharedMemoryHandle target_handle; |
308 if (!BrokerDuplicateHandle(source_handle, | 317 if (!BrokerDuplicateHandle(source_handle, |
309 channel_->GetPeerPID(), | 318 channel_->GetPeerPID(), |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 | 435 |
427 listeners_.clear(); | 436 listeners_.clear(); |
428 } | 437 } |
429 | 438 |
430 bool GpuChannelHost::MessageFilter::IsLost() const { | 439 bool GpuChannelHost::MessageFilter::IsLost() const { |
431 AutoLock lock(lock_); | 440 AutoLock lock(lock_); |
432 return lost_; | 441 return lost_; |
433 } | 442 } |
434 | 443 |
435 } // namespace content | 444 } // namespace content |
OLD | NEW |