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/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 } | 1463 } |
1464 | 1464 |
1465 bool RenderThreadImpl::IsGatherPixelRefsEnabled() { | 1465 bool RenderThreadImpl::IsGatherPixelRefsEnabled() { |
1466 return is_gather_pixel_refs_enabled_; | 1466 return is_gather_pixel_refs_enabled_; |
1467 } | 1467 } |
1468 | 1468 |
1469 bool RenderThreadImpl::IsMainThread() { | 1469 bool RenderThreadImpl::IsMainThread() { |
1470 return !!current(); | 1470 return !!current(); |
1471 } | 1471 } |
1472 | 1472 |
1473 scoped_refptr<base::MessageLoopProxy> RenderThreadImpl::GetIOLoopProxy() { | 1473 scoped_refptr<base::SingleThreadTaskRunner> |
1474 return io_message_loop_proxy_; | 1474 RenderThreadImpl::GetIOThreadTaskRunner() { |
| 1475 return io_thread_task_runner_; |
1475 } | 1476 } |
1476 | 1477 |
1477 scoped_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory( | 1478 scoped_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory( |
1478 size_t size) { | 1479 size_t size) { |
1479 return scoped_ptr<base::SharedMemory>( | 1480 return scoped_ptr<base::SharedMemory>( |
1480 HostAllocateSharedMemoryBuffer(size)); | 1481 HostAllocateSharedMemoryBuffer(size)); |
1481 } | 1482 } |
1482 | 1483 |
1483 CreateCommandBufferResult RenderThreadImpl::CreateViewCommandBuffer( | 1484 CreateCommandBufferResult RenderThreadImpl::CreateViewCommandBuffer( |
1484 int32 surface_id, | 1485 int32 surface_id, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 #endif | 1609 #endif |
1609 channel_handle.name.empty()) { | 1610 channel_handle.name.empty()) { |
1610 // Otherwise cancel the connection. | 1611 // Otherwise cancel the connection. |
1611 return NULL; | 1612 return NULL; |
1612 } | 1613 } |
1613 | 1614 |
1614 GetContentClient()->SetGpuInfo(gpu_info); | 1615 GetContentClient()->SetGpuInfo(gpu_info); |
1615 | 1616 |
1616 // Cache some variables that are needed on the compositor thread for our | 1617 // Cache some variables that are needed on the compositor thread for our |
1617 // implementation of GpuChannelHostFactory. | 1618 // implementation of GpuChannelHostFactory. |
1618 io_message_loop_proxy_ = ChildProcess::current()->io_message_loop_proxy(); | 1619 io_thread_task_runner_ = ChildProcess::current()->io_message_loop_proxy(); |
1619 | 1620 |
1620 gpu_channel_ = | 1621 gpu_channel_ = |
1621 GpuChannelHost::Create(this, | 1622 GpuChannelHost::Create(this, |
1622 gpu_info, | 1623 gpu_info, |
1623 channel_handle, | 1624 channel_handle, |
1624 ChildProcess::current()->GetShutDownEvent(), | 1625 ChildProcess::current()->GetShutDownEvent(), |
1625 gpu_memory_buffer_manager()); | 1626 gpu_memory_buffer_manager()); |
1626 return gpu_channel_.get(); | 1627 return gpu_channel_.get(); |
1627 } | 1628 } |
1628 | 1629 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1884 } | 1885 } |
1885 | 1886 |
1886 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1887 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
1887 size_t erased = | 1888 size_t erased = |
1888 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1889 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
1889 routing_id_); | 1890 routing_id_); |
1890 DCHECK_EQ(1u, erased); | 1891 DCHECK_EQ(1u, erased); |
1891 } | 1892 } |
1892 | 1893 |
1893 } // namespace content | 1894 } // namespace content |
OLD | NEW |