| 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 <utility> | 10 #include <utility> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #include "content/child/thread_safe_sender.h" | 68 #include "content/child/thread_safe_sender.h" |
| 69 #include "content/child/web_database_observer_impl.h" | 69 #include "content/child/web_database_observer_impl.h" |
| 70 #include "content/child/worker_thread_registry.h" | 70 #include "content/child/worker_thread_registry.h" |
| 71 #include "content/common/child_process_messages.h" | 71 #include "content/common/child_process_messages.h" |
| 72 #include "content/common/content_constants_internal.h" | 72 #include "content/common/content_constants_internal.h" |
| 73 #include "content/common/database_messages.h" | 73 #include "content/common/database_messages.h" |
| 74 #include "content/common/dom_storage/dom_storage_messages.h" | 74 #include "content/common/dom_storage/dom_storage_messages.h" |
| 75 #include "content/common/frame_messages.h" | 75 #include "content/common/frame_messages.h" |
| 76 #include "content/common/gpu/client/context_provider_command_buffer.h" | 76 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 77 #include "content/common/gpu/client/gpu_channel_host.h" | 77 #include "content/common/gpu/client/gpu_channel_host.h" |
| 78 #include "content/common/gpu/client/ipc/chrome/chrome_gpu_channel_host_ipc_trans
port.h" |
| 78 #include "content/common/gpu/gpu_messages.h" | 79 #include "content/common/gpu/gpu_messages.h" |
| 79 #include "content/common/gpu/gpu_process_launch_causes.h" | 80 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 80 #include "content/common/render_frame_setup.mojom.h" | 81 #include "content/common/render_frame_setup.mojom.h" |
| 81 #include "content/common/render_process_messages.h" | 82 #include "content/common/render_process_messages.h" |
| 82 #include "content/common/resource_messages.h" | 83 #include "content/common/resource_messages.h" |
| 83 #include "content/common/service_worker/embedded_worker_setup.mojom.h" | 84 #include "content/common/service_worker/embedded_worker_setup.mojom.h" |
| 84 #include "content/common/view_messages.h" | 85 #include "content/common/view_messages.h" |
| 85 #include "content/common/worker_messages.h" | 86 #include "content/common/worker_messages.h" |
| 86 #include "content/public/common/content_constants.h" | 87 #include "content/public/common/content_constants.h" |
| 87 #include "content/public/common/content_paths.h" | 88 #include "content/public/common/content_paths.h" |
| (...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1693 return io_thread_task_runner_; | 1694 return io_thread_task_runner_; |
| 1694 } | 1695 } |
| 1695 | 1696 |
| 1696 scoped_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory( | 1697 scoped_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory( |
| 1697 size_t size) { | 1698 size_t size) { |
| 1698 return HostAllocateSharedMemoryBuffer(size); | 1699 return HostAllocateSharedMemoryBuffer(size); |
| 1699 } | 1700 } |
| 1700 | 1701 |
| 1701 CreateCommandBufferResult RenderThreadImpl::CreateViewCommandBuffer( | 1702 CreateCommandBufferResult RenderThreadImpl::CreateViewCommandBuffer( |
| 1702 int32_t surface_id, | 1703 int32_t surface_id, |
| 1703 const GPUCreateCommandBufferConfig& init_params, | 1704 const GpuCreateCommandBufferConfig& init_params, |
| 1704 int32_t route_id) { | 1705 int32_t route_id) { |
| 1705 NOTREACHED(); | 1706 NOTREACHED(); |
| 1706 return CREATE_COMMAND_BUFFER_FAILED; | 1707 return CREATE_COMMAND_BUFFER_FAILED; |
| 1707 } | 1708 } |
| 1708 | 1709 |
| 1709 void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() { | 1710 void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() { |
| 1710 notify_webkit_of_modal_loop_ = false; | 1711 notify_webkit_of_modal_loop_ = false; |
| 1711 } | 1712 } |
| 1712 | 1713 |
| 1713 bool RenderThreadImpl::OnControlMessageReceived(const IPC::Message& msg) { | 1714 bool RenderThreadImpl::OnControlMessageReceived(const IPC::Message& msg) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 // Otherwise cancel the connection. | 1837 // Otherwise cancel the connection. |
| 1837 return NULL; | 1838 return NULL; |
| 1838 } | 1839 } |
| 1839 | 1840 |
| 1840 GetContentClient()->SetGpuInfo(gpu_info); | 1841 GetContentClient()->SetGpuInfo(gpu_info); |
| 1841 | 1842 |
| 1842 // Cache some variables that are needed on the compositor thread for our | 1843 // Cache some variables that are needed on the compositor thread for our |
| 1843 // implementation of GpuChannelHostFactory. | 1844 // implementation of GpuChannelHostFactory. |
| 1844 io_thread_task_runner_ = ChildProcess::current()->io_task_runner(); | 1845 io_thread_task_runner_ = ChildProcess::current()->io_task_runner(); |
| 1845 | 1846 |
| 1846 gpu_channel_ = | 1847 scoped_ptr<GpuChannelHostIPCTransport> transport( |
| 1847 GpuChannelHost::Create(this, | 1848 GpuHostIPCTransportFactory::Get()->CreateGpuChannelHostIPCTransport()); |
| 1848 client_id, | 1849 static_cast<ChromeGpuChannelHostIPCTransport*>(transport.get()) |
| 1849 gpu_info, | 1850 ->BindToService(this, client_id, channel_handle, |
| 1850 channel_handle, | 1851 ChildProcess::current()->GetShutDownEvent()); |
| 1851 ChildProcess::current()->GetShutDownEvent(), | 1852 |
| 1852 gpu_memory_buffer_manager()); | 1853 gpu_channel_ = GpuChannelHost::Create(std::move(transport), gpu_info, |
| 1854 gpu_memory_buffer_manager()); |
| 1853 return gpu_channel_.get(); | 1855 return gpu_channel_.get(); |
| 1854 } | 1856 } |
| 1855 | 1857 |
| 1856 blink::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter( | 1858 blink::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter( |
| 1857 blink::WebMediaStreamCenterClient* client) { | 1859 blink::WebMediaStreamCenterClient* client) { |
| 1858 #if defined(ENABLE_WEBRTC) | 1860 #if defined(ENABLE_WEBRTC) |
| 1859 if (!media_stream_center_) { | 1861 if (!media_stream_center_) { |
| 1860 media_stream_center_ = GetContentClient()->renderer() | 1862 media_stream_center_ = GetContentClient()->renderer() |
| 1861 ->OverrideCreateWebMediaStreamCenter(client); | 1863 ->OverrideCreateWebMediaStreamCenter(client); |
| 1862 if (!media_stream_center_) { | 1864 if (!media_stream_center_) { |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2137 } | 2139 } |
| 2138 | 2140 |
| 2139 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2141 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 2140 size_t erased = | 2142 size_t erased = |
| 2141 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2143 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 2142 routing_id_); | 2144 routing_id_); |
| 2143 DCHECK_EQ(1u, erased); | 2145 DCHECK_EQ(1u, erased); |
| 2144 } | 2146 } |
| 2145 | 2147 |
| 2146 } // namespace content | 2148 } // namespace content |
| OLD | NEW |