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