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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 #endif | 195 #endif |
196 | 196 |
197 #ifdef ENABLE_VTUNE_JIT_INTERFACE | 197 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
198 #include "v8/src/third_party/vtune/v8-vtune.h" | 198 #include "v8/src/third_party/vtune/v8-vtune.h" |
199 #endif | 199 #endif |
200 | 200 |
201 #if defined(USE_AURA) | 201 #if defined(USE_AURA) |
202 #include "content/public/common/service_manager_connection.h" | 202 #include "content/public/common/service_manager_connection.h" |
203 #include "content/renderer/mus/render_widget_mus_connection.h" | 203 #include "content/renderer/mus/render_widget_mus_connection.h" |
204 #include "content/renderer/mus/render_widget_window_tree_client_factory.h" | 204 #include "content/renderer/mus/render_widget_window_tree_client_factory.h" |
205 #include "services/ui/public/cpp/gpu/gpu_service.h" | 205 #include "services/ui/public/cpp/gpu/gpu.h" |
206 #endif | 206 #endif |
207 | 207 |
208 #if defined(ENABLE_IPC_FUZZER) | 208 #if defined(ENABLE_IPC_FUZZER) |
209 #include "content/common/external_ipc_dumper.h" | 209 #include "content/common/external_ipc_dumper.h" |
210 #endif | 210 #endif |
211 | 211 |
212 #if defined(OS_MACOSX) | 212 #if defined(OS_MACOSX) |
213 #include <malloc/malloc.h> | 213 #include <malloc/malloc.h> |
214 #else | 214 #else |
215 #include <malloc.h> | 215 #include <malloc.h> |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 blink::WebView::setUseExternalPopupMenus(true); | 648 blink::WebView::setUseExternalPopupMenus(true); |
649 #endif | 649 #endif |
650 | 650 |
651 lazy_tls.Pointer()->Set(this); | 651 lazy_tls.Pointer()->Set(this); |
652 | 652 |
653 // Register this object as the main thread. | 653 // Register this object as the main thread. |
654 ChildProcess::current()->set_main_thread(this); | 654 ChildProcess::current()->set_main_thread(this); |
655 | 655 |
656 #if defined(USE_AURA) | 656 #if defined(USE_AURA) |
657 if (IsRunningInMash()) { | 657 if (IsRunningInMash()) { |
658 gpu_service_ = | 658 gpu_ = ui::Gpu::Create(GetServiceManagerConnection()->GetConnector(), |
659 ui::GpuService::Create(GetServiceManagerConnection()->GetConnector(), | 659 ChildProcess::current()->io_task_runner()); |
660 ChildProcess::current()->io_task_runner()); | |
661 } | 660 } |
662 #endif | 661 #endif |
663 gpu_memory_buffer_manager_ = | 662 gpu_memory_buffer_manager_ = |
664 base::MakeUnique<ChildGpuMemoryBufferManager>(thread_safe_sender()); | 663 base::MakeUnique<ChildGpuMemoryBufferManager>(thread_safe_sender()); |
665 | 664 |
666 thread_safe_associated_interface_ptr_provider_ = | 665 thread_safe_associated_interface_ptr_provider_ = |
667 base::MakeUnique<ThreadSafeAssociatedInterfacePtrProvider>(channel()); | 666 base::MakeUnique<ThreadSafeAssociatedInterfacePtrProvider>(channel()); |
668 thread_safe_render_message_filter_ = | 667 thread_safe_render_message_filter_ = |
669 thread_safe_associated_interface_ptr_provider_ | 668 thread_safe_associated_interface_ptr_provider_ |
670 ->CreateInterfacePtr<mojom::RenderMessageFilter>(); | 669 ->CreateInterfacePtr<mojom::RenderMessageFilter>(); |
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 return main_thread_compositor_task_runner_; | 1652 return main_thread_compositor_task_runner_; |
1654 } | 1653 } |
1655 | 1654 |
1656 scoped_refptr<base::SingleThreadTaskRunner> | 1655 scoped_refptr<base::SingleThreadTaskRunner> |
1657 RenderThreadImpl::GetCompositorImplThreadTaskRunner() { | 1656 RenderThreadImpl::GetCompositorImplThreadTaskRunner() { |
1658 return compositor_task_runner_; | 1657 return compositor_task_runner_; |
1659 } | 1658 } |
1660 | 1659 |
1661 gpu::GpuMemoryBufferManager* RenderThreadImpl::GetGpuMemoryBufferManager() { | 1660 gpu::GpuMemoryBufferManager* RenderThreadImpl::GetGpuMemoryBufferManager() { |
1662 #if defined(USE_AURA) | 1661 #if defined(USE_AURA) |
1663 if (gpu_service_) | 1662 if (gpu_) |
1664 return gpu_service_->gpu_memory_buffer_manager(); | 1663 return gpu_->gpu_memory_buffer_manager(); |
1665 #endif | 1664 #endif |
1666 return gpu_memory_buffer_manager_.get(); | 1665 return gpu_memory_buffer_manager_.get(); |
1667 } | 1666 } |
1668 | 1667 |
1669 blink::scheduler::RendererScheduler* RenderThreadImpl::GetRendererScheduler() { | 1668 blink::scheduler::RendererScheduler* RenderThreadImpl::GetRendererScheduler() { |
1670 return renderer_scheduler_.get(); | 1669 return renderer_scheduler_.get(); |
1671 } | 1670 } |
1672 | 1671 |
1673 std::unique_ptr<cc::BeginFrameSource> | 1672 std::unique_ptr<cc::BeginFrameSource> |
1674 RenderThreadImpl::CreateExternalBeginFrameSource(int routing_id) { | 1673 RenderThreadImpl::CreateExternalBeginFrameSource(int routing_id) { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1950 // Cache some variables that are needed on the compositor thread for our | 1949 // Cache some variables that are needed on the compositor thread for our |
1951 // implementation of GpuChannelHostFactory. | 1950 // implementation of GpuChannelHostFactory. |
1952 io_thread_task_runner_ = ChildProcess::current()->io_task_runner(); | 1951 io_thread_task_runner_ = ChildProcess::current()->io_task_runner(); |
1953 | 1952 |
1954 gpu_channel_ = | 1953 gpu_channel_ = |
1955 gpu::GpuChannelHost::Create(this, client_id, gpu_info, channel_handle, | 1954 gpu::GpuChannelHost::Create(this, client_id, gpu_info, channel_handle, |
1956 ChildProcess::current()->GetShutDownEvent(), | 1955 ChildProcess::current()->GetShutDownEvent(), |
1957 GetGpuMemoryBufferManager()); | 1956 GetGpuMemoryBufferManager()); |
1958 } else { | 1957 } else { |
1959 #if defined(USE_AURA) | 1958 #if defined(USE_AURA) |
1960 gpu_channel_ = gpu_service_->EstablishGpuChannelSync(); | 1959 gpu_channel_ = gpu_->EstablishGpuChannelSync(); |
1961 #else | 1960 #else |
1962 NOTREACHED(); | 1961 NOTREACHED(); |
1963 #endif | 1962 #endif |
1964 } | 1963 } |
1965 return gpu_channel_; | 1964 return gpu_channel_; |
1966 } | 1965 } |
1967 | 1966 |
1968 std::unique_ptr<cc::CompositorFrameSink> | 1967 std::unique_ptr<cc::CompositorFrameSink> |
1969 RenderThreadImpl::CreateCompositorFrameSink( | 1968 RenderThreadImpl::CreateCompositorFrameSink( |
1970 bool use_software, | 1969 bool use_software, |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2518 } | 2517 } |
2519 } | 2518 } |
2520 | 2519 |
2521 void RenderThreadImpl::OnRendererInterfaceRequest( | 2520 void RenderThreadImpl::OnRendererInterfaceRequest( |
2522 mojom::RendererAssociatedRequest request) { | 2521 mojom::RendererAssociatedRequest request) { |
2523 DCHECK(!renderer_binding_.is_bound()); | 2522 DCHECK(!renderer_binding_.is_bound()); |
2524 renderer_binding_.Bind(std::move(request)); | 2523 renderer_binding_.Bind(std::move(request)); |
2525 } | 2524 } |
2526 | 2525 |
2527 } // namespace content | 2526 } // namespace content |
OLD | NEW |