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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 #include "content/renderer/media/peer_connection_tracker.h" | 191 #include "content/renderer/media/peer_connection_tracker.h" |
192 #include "content/renderer/media/rtc_peer_connection_handler.h" | 192 #include "content/renderer/media/rtc_peer_connection_handler.h" |
193 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" | 193 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
194 #include "content/renderer/media/webrtc_identity_service.h" | 194 #include "content/renderer/media/webrtc_identity_service.h" |
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(MOJO_SHELL_CLIENT) | 201 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
| 202 #include "components/mus/common/gpu_service.h" |
202 #include "content/public/common/mojo_shell_connection.h" | 203 #include "content/public/common/mojo_shell_connection.h" |
203 #include "content/renderer/mus/render_widget_mus_connection.h" | 204 #include "content/renderer/mus/render_widget_mus_connection.h" |
204 #include "content/renderer/mus/render_widget_window_tree_client_factory.h" | 205 #include "content/renderer/mus/render_widget_window_tree_client_factory.h" |
205 #endif | 206 #endif |
206 | 207 |
207 #if defined(ENABLE_IPC_FUZZER) | 208 #if defined(ENABLE_IPC_FUZZER) |
208 #include "content/common/external_ipc_dumper.h" | 209 #include "content/common/external_ipc_dumper.h" |
209 #endif | 210 #endif |
210 | 211 |
211 using base::ThreadRestrictions; | 212 using base::ThreadRestrictions; |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 // See crbug.com/503724. | 823 // See crbug.com/503724. |
823 base::DiscardableMemoryAllocator::SetInstance( | 824 base::DiscardableMemoryAllocator::SetInstance( |
824 ChildThreadImpl::discardable_shared_memory_manager()); | 825 ChildThreadImpl::discardable_shared_memory_manager()); |
825 | 826 |
826 GetContentClient()->renderer()->ExposeInterfacesToBrowser( | 827 GetContentClient()->renderer()->ExposeInterfacesToBrowser( |
827 GetInterfaceRegistry()); | 828 GetInterfaceRegistry()); |
828 | 829 |
829 GetInterfaceRegistry()->AddInterface(base::Bind(CreateFrameFactory)); | 830 GetInterfaceRegistry()->AddInterface(base::Bind(CreateFrameFactory)); |
830 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); | 831 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); |
831 | 832 |
832 #if defined(MOJO_SHELL_CLIENT) | 833 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
833 // We may not have a MojoShellConnection object in tests that directly | 834 // We may not have a MojoShellConnection object in tests that directly |
834 // instantiate a RenderThreadImpl. | 835 // instantiate a RenderThreadImpl. |
835 if (MojoShellConnection::GetForProcess() && | 836 if (MojoShellConnection::GetForProcess() && |
836 base::CommandLine::ForCurrentProcess()->HasSwitch( | 837 base::CommandLine::ForCurrentProcess()->HasSwitch( |
837 switches::kUseMusInRenderer)) | 838 switches::kUseMusInRenderer)) |
838 CreateRenderWidgetWindowTreeClientFactory(); | 839 CreateRenderWidgetWindowTreeClientFactory(); |
839 #endif | 840 #endif |
840 | 841 |
841 GetRemoteInterfaces()->GetInterface( | 842 GetRemoteInterfaces()->GetInterface( |
842 mojo::GetProxy(&storage_partition_service_)); | 843 mojo::GetProxy(&storage_partition_service_)); |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 RenderThreadImpl::CreateCompositorOutputSurface( | 1795 RenderThreadImpl::CreateCompositorOutputSurface( |
1795 bool use_software, | 1796 bool use_software, |
1796 int routing_id, | 1797 int routing_id, |
1797 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, | 1798 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, |
1798 const GURL& url) { | 1799 const GURL& url) { |
1799 const base::CommandLine& command_line = | 1800 const base::CommandLine& command_line = |
1800 *base::CommandLine::ForCurrentProcess(); | 1801 *base::CommandLine::ForCurrentProcess(); |
1801 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) | 1802 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) |
1802 use_software = true; | 1803 use_software = true; |
1803 | 1804 |
1804 #if defined(MOJO_SHELL_CLIENT) | 1805 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
1805 if (MojoShellConnection::GetForProcess() && !use_software && | 1806 auto shell_connection = MojoShellConnection::GetForProcess(); |
| 1807 if (shell_connection && !use_software && |
1806 command_line.HasSwitch(switches::kUseMusInRenderer)) { | 1808 command_line.HasSwitch(switches::kUseMusInRenderer)) { |
| 1809 mus::GpuService::Initialize(shell_connection->GetConnector()); |
1807 RenderWidgetMusConnection* connection = | 1810 RenderWidgetMusConnection* connection = |
1808 RenderWidgetMusConnection::GetOrCreate(routing_id); | 1811 RenderWidgetMusConnection::GetOrCreate(routing_id); |
1809 return connection->CreateOutputSurface(); | 1812 return connection->CreateOutputSurface(); |
1810 } | 1813 } |
1811 #endif | 1814 #endif |
1812 | 1815 |
1813 uint32_t output_surface_id = g_next_output_surface_id++; | 1816 uint32_t output_surface_id = g_next_output_surface_id++; |
1814 | 1817 |
1815 if (command_line.HasSwitch(switches::kEnableVulkan)) { | 1818 if (command_line.HasSwitch(switches::kEnableVulkan)) { |
1816 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider = | 1819 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider = |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) | 2207 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) |
2205 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; | 2208 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; |
2206 | 2209 |
2207 blink::mainThreadIsolate()->MemoryPressureNotification( | 2210 blink::mainThreadIsolate()->MemoryPressureNotification( |
2208 v8_memory_pressure_level); | 2211 v8_memory_pressure_level); |
2209 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2212 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
2210 v8_memory_pressure_level); | 2213 v8_memory_pressure_level); |
2211 } | 2214 } |
2212 | 2215 |
2213 } // namespace content | 2216 } // namespace content |
OLD | NEW |