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