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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 blink::WebView::setUseExternalPopupMenus(true); | 636 blink::WebView::setUseExternalPopupMenus(true); |
637 #endif | 637 #endif |
638 | 638 |
639 lazy_tls.Pointer()->Set(this); | 639 lazy_tls.Pointer()->Set(this); |
640 | 640 |
641 // Register this object as the main thread. | 641 // Register this object as the main thread. |
642 ChildProcess::current()->set_main_thread(this); | 642 ChildProcess::current()->set_main_thread(this); |
643 | 643 |
644 #if defined(MOJO_SHELL_CLIENT) | 644 #if defined(MOJO_SHELL_CLIENT) |
645 if (IsRunningInMash()) | 645 if (IsRunningInMash()) |
646 gpu_service_ = | 646 ui::GpuService::Initialize(GetMojoShellConnection()->GetConnector()); |
647 ui::GpuService::Initialize(GetMojoShellConnection()->GetConnector()); | |
648 #endif | 647 #endif |
649 | 648 |
650 InitializeWebKit(resource_task_queue); | 649 InitializeWebKit(resource_task_queue); |
651 | 650 |
652 // In single process the single process is all there is. | 651 // In single process the single process is all there is. |
653 webkit_shared_timer_suspended_ = false; | 652 webkit_shared_timer_suspended_ = false; |
654 widget_count_ = 0; | 653 widget_count_ = 0; |
655 hidden_widget_count_ = 0; | 654 hidden_widget_count_ = 0; |
656 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; | 655 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; |
657 idle_notifications_to_skip_ = 0; | 656 idle_notifications_to_skip_ = 0; |
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1797 // 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 |
1798 // implementation of GpuChannelHostFactory. | 1797 // implementation of GpuChannelHostFactory. |
1799 io_thread_task_runner_ = ChildProcess::current()->io_task_runner(); | 1798 io_thread_task_runner_ = ChildProcess::current()->io_task_runner(); |
1800 | 1799 |
1801 gpu_channel_ = | 1800 gpu_channel_ = |
1802 gpu::GpuChannelHost::Create(this, client_id, gpu_info, channel_handle, | 1801 gpu::GpuChannelHost::Create(this, client_id, gpu_info, channel_handle, |
1803 ChildProcess::current()->GetShutDownEvent(), | 1802 ChildProcess::current()->GetShutDownEvent(), |
1804 gpu_memory_buffer_manager()); | 1803 gpu_memory_buffer_manager()); |
1805 } else { | 1804 } else { |
1806 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 1805 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
1807 gpu_channel_ = gpu_service_->EstablishGpuChannelSync(); | 1806 gpu_channel_ = ui::GpuService::GetInstance()->EstablishGpuChannelSync(); |
1808 #else | 1807 #else |
1809 NOTREACHED(); | 1808 NOTREACHED(); |
1810 #endif | 1809 #endif |
1811 } | 1810 } |
1812 return gpu_channel_; | 1811 return gpu_channel_; |
1813 } | 1812 } |
1814 | 1813 |
1815 std::unique_ptr<cc::OutputSurface> | 1814 std::unique_ptr<cc::OutputSurface> |
1816 RenderThreadImpl::CreateCompositorOutputSurface( | 1815 RenderThreadImpl::CreateCompositorOutputSurface( |
1817 bool use_software, | 1816 bool use_software, |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2240 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) | 2239 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) |
2241 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; | 2240 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; |
2242 | 2241 |
2243 blink::mainThreadIsolate()->MemoryPressureNotification( | 2242 blink::mainThreadIsolate()->MemoryPressureNotification( |
2244 v8_memory_pressure_level); | 2243 v8_memory_pressure_level); |
2245 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2244 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
2246 v8_memory_pressure_level); | 2245 v8_memory_pressure_level); |
2247 } | 2246 } |
2248 | 2247 |
2249 } // namespace content | 2248 } // namespace content |
OLD | NEW |