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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 #if defined(ENABLE_WEBRTC) | 193 #if defined(ENABLE_WEBRTC) |
194 #include "content/renderer/media/peer_connection_tracker.h" | 194 #include "content/renderer/media/peer_connection_tracker.h" |
195 #include "content/renderer/media/rtc_peer_connection_handler.h" | 195 #include "content/renderer/media/rtc_peer_connection_handler.h" |
196 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" | 196 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
197 #endif | 197 #endif |
198 | 198 |
199 #ifdef ENABLE_VTUNE_JIT_INTERFACE | 199 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
200 #include "v8/src/third_party/vtune/v8-vtune.h" | 200 #include "v8/src/third_party/vtune/v8-vtune.h" |
201 #endif | 201 #endif |
202 | 202 |
203 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 203 #if defined(USE_AURA) |
204 #include "content/public/common/mojo_shell_connection.h" | 204 #include "content/public/common/mojo_shell_connection.h" |
205 #include "content/renderer/mus/render_widget_mus_connection.h" | 205 #include "content/renderer/mus/render_widget_mus_connection.h" |
206 #include "content/renderer/mus/render_widget_window_tree_client_factory.h" | 206 #include "content/renderer/mus/render_widget_window_tree_client_factory.h" |
207 #include "services/ui/common/gpu_service.h" | 207 #include "services/ui/common/gpu_service.h" |
208 #endif | 208 #endif |
209 | 209 |
210 #if defined(ENABLE_IPC_FUZZER) | 210 #if defined(ENABLE_IPC_FUZZER) |
211 #include "content/common/external_ipc_dumper.h" | 211 #include "content/common/external_ipc_dumper.h" |
212 #endif | 212 #endif |
213 | 213 |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 #if defined(USE_EXTERNAL_POPUP_MENU) | 635 #if defined(USE_EXTERNAL_POPUP_MENU) |
636 // On Mac and Android Java UI, the select popups are rendered by the browser. | 636 // On Mac and Android Java UI, the select popups are rendered by the browser. |
637 blink::WebView::setUseExternalPopupMenus(true); | 637 blink::WebView::setUseExternalPopupMenus(true); |
638 #endif | 638 #endif |
639 | 639 |
640 lazy_tls.Pointer()->Set(this); | 640 lazy_tls.Pointer()->Set(this); |
641 | 641 |
642 // Register this object as the main thread. | 642 // Register this object as the main thread. |
643 ChildProcess::current()->set_main_thread(this); | 643 ChildProcess::current()->set_main_thread(this); |
644 | 644 |
645 #if defined(MOJO_SHELL_CLIENT) | 645 #if defined(USE_AURA) |
646 if (IsRunningInMash()) | 646 if (IsRunningInMash()) |
647 ui::GpuService::Initialize(GetMojoShellConnection()->GetConnector()); | 647 ui::GpuService::Initialize(GetMojoShellConnection()->GetConnector()); |
648 #endif | 648 #endif |
649 | 649 |
650 InitializeWebKit(resource_task_queue); | 650 InitializeWebKit(resource_task_queue); |
651 | 651 |
652 // In single process the single process is all there is. | 652 // In single process the single process is all there is. |
653 webkit_shared_timer_suspended_ = false; | 653 webkit_shared_timer_suspended_ = false; |
654 widget_count_ = 0; | 654 widget_count_ = 0; |
655 hidden_widget_count_ = 0; | 655 hidden_widget_count_ = 0; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 | 711 |
712 midi_message_filter_ = new MidiMessageFilter(GetIOTaskRunner()); | 712 midi_message_filter_ = new MidiMessageFilter(GetIOTaskRunner()); |
713 AddFilter(midi_message_filter_.get()); | 713 AddFilter(midi_message_filter_.get()); |
714 | 714 |
715 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); | 715 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); |
716 | 716 |
717 AddFilter((new CacheStorageMessageFilter(thread_safe_sender()))->GetFilter()); | 717 AddFilter((new CacheStorageMessageFilter(thread_safe_sender()))->GetFilter()); |
718 | 718 |
719 AddFilter((new ServiceWorkerContextMessageFilter())->GetFilter()); | 719 AddFilter((new ServiceWorkerContextMessageFilter())->GetFilter()); |
720 | 720 |
721 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 721 #if defined(USE_AURA) |
722 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 722 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
723 switches::kUseMusInRenderer)) { | 723 switches::kUseMusInRenderer)) { |
724 CreateRenderWidgetWindowTreeClientFactory(GetMojoShellConnection()); | 724 CreateRenderWidgetWindowTreeClientFactory(GetMojoShellConnection()); |
725 } | 725 } |
726 #endif | 726 #endif |
727 | 727 |
728 // Must be called before RenderThreadStarted() below. | 728 // Must be called before RenderThreadStarted() below. |
729 StartMojoShellConnection(); | 729 StartMojoShellConnection(); |
730 | 730 |
731 GetContentClient()->renderer()->RenderThreadStarted(); | 731 GetContentClient()->renderer()->RenderThreadStarted(); |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 | 1795 |
1796 // Cache some variables that are needed on the compositor thread for our | 1796 // Cache some variables that are needed on the compositor thread for our |
1797 // implementation of GpuChannelHostFactory. | 1797 // implementation of GpuChannelHostFactory. |
1798 io_thread_task_runner_ = ChildProcess::current()->io_task_runner(); | 1798 io_thread_task_runner_ = ChildProcess::current()->io_task_runner(); |
1799 | 1799 |
1800 gpu_channel_ = | 1800 gpu_channel_ = |
1801 gpu::GpuChannelHost::Create(this, client_id, gpu_info, channel_handle, | 1801 gpu::GpuChannelHost::Create(this, client_id, gpu_info, channel_handle, |
1802 ChildProcess::current()->GetShutDownEvent(), | 1802 ChildProcess::current()->GetShutDownEvent(), |
1803 gpu_memory_buffer_manager()); | 1803 gpu_memory_buffer_manager()); |
1804 } else { | 1804 } else { |
1805 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 1805 #if defined(USE_AURA) |
1806 gpu_channel_ = ui::GpuService::GetInstance()->EstablishGpuChannelSync(); | 1806 gpu_channel_ = ui::GpuService::GetInstance()->EstablishGpuChannelSync(); |
1807 #else | 1807 #else |
1808 NOTREACHED(); | 1808 NOTREACHED(); |
1809 #endif | 1809 #endif |
1810 } | 1810 } |
1811 return gpu_channel_; | 1811 return gpu_channel_; |
1812 } | 1812 } |
1813 | 1813 |
1814 std::unique_ptr<cc::OutputSurface> | 1814 std::unique_ptr<cc::OutputSurface> |
1815 RenderThreadImpl::CreateCompositorOutputSurface( | 1815 RenderThreadImpl::CreateCompositorOutputSurface( |
1816 bool use_software, | 1816 bool use_software, |
1817 int routing_id, | 1817 int routing_id, |
1818 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, | 1818 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, |
1819 const GURL& url) { | 1819 const GURL& url) { |
1820 const base::CommandLine& command_line = | 1820 const base::CommandLine& command_line = |
1821 *base::CommandLine::ForCurrentProcess(); | 1821 *base::CommandLine::ForCurrentProcess(); |
1822 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) | 1822 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) |
1823 use_software = true; | 1823 use_software = true; |
1824 | 1824 |
1825 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 1825 #if defined(USE_AURA) |
1826 if (GetMojoShellConnection() && !use_software && | 1826 if (GetMojoShellConnection() && !use_software && |
1827 command_line.HasSwitch(switches::kUseMusInRenderer)) { | 1827 command_line.HasSwitch(switches::kUseMusInRenderer)) { |
1828 RenderWidgetMusConnection* connection = | 1828 RenderWidgetMusConnection* connection = |
1829 RenderWidgetMusConnection::GetOrCreate(routing_id); | 1829 RenderWidgetMusConnection::GetOrCreate(routing_id); |
1830 return connection->CreateOutputSurface(); | 1830 return connection->CreateOutputSurface(); |
1831 } | 1831 } |
1832 #endif | 1832 #endif |
1833 | 1833 |
1834 uint32_t output_surface_id = g_next_output_surface_id++; | 1834 uint32_t output_surface_id = g_next_output_surface_id++; |
1835 | 1835 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2238 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) | 2238 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) |
2239 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; | 2239 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; |
2240 | 2240 |
2241 blink::mainThreadIsolate()->MemoryPressureNotification( | 2241 blink::mainThreadIsolate()->MemoryPressureNotification( |
2242 v8_memory_pressure_level); | 2242 v8_memory_pressure_level); |
2243 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2243 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
2244 v8_memory_pressure_level); | 2244 v8_memory_pressure_level); |
2245 } | 2245 } |
2246 | 2246 |
2247 } // namespace content | 2247 } // namespace content |
OLD | NEW |