Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2233003003: services/ui: Inject GpuService instance where needed, instead of singleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/mus/render_widget_mus_connection.cc ('k') | services/ui/common/gpu_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(USE_AURA) 646 #if defined(USE_AURA)
647 if (IsRunningInMash()) 647 if (IsRunningInMash()) {
648 gpu_service_ = 648 gpu_service_ =
649 ui::GpuService::Initialize(GetMojoShellConnection()->GetConnector()); 649 ui::GpuService::Initialize(GetMojoShellConnection()->GetConnector());
650 }
650 #endif 651 #endif
651 652
652 InitializeWebKit(resource_task_queue); 653 InitializeWebKit(resource_task_queue);
653 654
654 // In single process the single process is all there is. 655 // In single process the single process is all there is.
655 webkit_shared_timer_suspended_ = false; 656 webkit_shared_timer_suspended_ = false;
656 widget_count_ = 0; 657 widget_count_ = 0;
657 hidden_widget_count_ = 0; 658 hidden_widget_count_ = 0;
658 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; 659 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs;
659 idle_notifications_to_skip_ = 0; 660 idle_notifications_to_skip_ = 0;
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 const base::CommandLine& command_line = 1823 const base::CommandLine& command_line =
1823 *base::CommandLine::ForCurrentProcess(); 1824 *base::CommandLine::ForCurrentProcess();
1824 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) 1825 if (command_line.HasSwitch(switches::kDisableGpuCompositing))
1825 use_software = true; 1826 use_software = true;
1826 1827
1827 #if defined(USE_AURA) 1828 #if defined(USE_AURA)
1828 if (GetMojoShellConnection() && !use_software && 1829 if (GetMojoShellConnection() && !use_software &&
1829 command_line.HasSwitch(switches::kUseMusInRenderer)) { 1830 command_line.HasSwitch(switches::kUseMusInRenderer)) {
1830 RenderWidgetMusConnection* connection = 1831 RenderWidgetMusConnection* connection =
1831 RenderWidgetMusConnection::GetOrCreate(routing_id); 1832 RenderWidgetMusConnection::GetOrCreate(routing_id);
1832 return connection->CreateOutputSurface(); 1833 return connection->CreateOutputSurface(gpu_service_.get());
1833 } 1834 }
1834 #endif 1835 #endif
1835 1836
1836 uint32_t output_surface_id = g_next_output_surface_id++; 1837 uint32_t output_surface_id = g_next_output_surface_id++;
1837 1838
1838 if (command_line.HasSwitch(switches::kEnableVulkan)) { 1839 if (command_line.HasSwitch(switches::kEnableVulkan)) {
1839 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider = 1840 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider =
1840 cc::VulkanInProcessContextProvider::Create(); 1841 cc::VulkanInProcessContextProvider::Create();
1841 if (vulkan_context_provider) { 1842 if (vulkan_context_provider) {
1842 DCHECK(!layout_test_mode()); 1843 DCHECK(!layout_test_mode());
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2241 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2241 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2242 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2242 2243
2243 blink::mainThreadIsolate()->MemoryPressureNotification( 2244 blink::mainThreadIsolate()->MemoryPressureNotification(
2244 v8_memory_pressure_level); 2245 v8_memory_pressure_level);
2245 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2246 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2246 v8_memory_pressure_level); 2247 v8_memory_pressure_level);
2247 } 2248 }
2248 2249
2249 } // namespace content 2250 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/mus/render_widget_mus_connection.cc ('k') | services/ui/common/gpu_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698