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

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

Issue 2194003002: services/ui: Have an explicit lifetime/ownership of ui::GpuService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot merge 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/render_thread_impl.h ('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 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(USE_AURA) 645 #if defined(USE_AURA)
646 if (IsRunningInMash()) 646 if (IsRunningInMash())
647 ui::GpuService::Initialize(GetMojoShellConnection()->GetConnector()); 647 gpu_service_ =
648 ui::GpuService::Initialize(GetMojoShellConnection()->GetConnector());
648 #endif 649 #endif
649 650
650 InitializeWebKit(resource_task_queue); 651 InitializeWebKit(resource_task_queue);
651 652
652 // In single process the single process is all there is. 653 // In single process the single process is all there is.
653 webkit_shared_timer_suspended_ = false; 654 webkit_shared_timer_suspended_ = false;
654 widget_count_ = 0; 655 widget_count_ = 0;
655 hidden_widget_count_ = 0; 656 hidden_widget_count_ = 0;
656 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; 657 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs;
657 idle_notifications_to_skip_ = 0; 658 idle_notifications_to_skip_ = 0;
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1796 // Cache some variables that are needed on the compositor thread for our 1797 // Cache some variables that are needed on the compositor thread for our
1797 // implementation of GpuChannelHostFactory. 1798 // implementation of GpuChannelHostFactory.
1798 io_thread_task_runner_ = ChildProcess::current()->io_task_runner(); 1799 io_thread_task_runner_ = ChildProcess::current()->io_task_runner();
1799 1800
1800 gpu_channel_ = 1801 gpu_channel_ =
1801 gpu::GpuChannelHost::Create(this, client_id, gpu_info, channel_handle, 1802 gpu::GpuChannelHost::Create(this, client_id, gpu_info, channel_handle,
1802 ChildProcess::current()->GetShutDownEvent(), 1803 ChildProcess::current()->GetShutDownEvent(),
1803 gpu_memory_buffer_manager()); 1804 gpu_memory_buffer_manager());
1804 } else { 1805 } else {
1805 #if defined(USE_AURA) 1806 #if defined(USE_AURA)
1806 gpu_channel_ = ui::GpuService::GetInstance()->EstablishGpuChannelSync(); 1807 gpu_channel_ = gpu_service_->EstablishGpuChannelSync();
1807 #else 1808 #else
1808 NOTREACHED(); 1809 NOTREACHED();
1809 #endif 1810 #endif
1810 } 1811 }
1811 return gpu_channel_; 1812 return gpu_channel_;
1812 } 1813 }
1813 1814
1814 std::unique_ptr<cc::OutputSurface> 1815 std::unique_ptr<cc::OutputSurface>
1815 RenderThreadImpl::CreateCompositorOutputSurface( 1816 RenderThreadImpl::CreateCompositorOutputSurface(
1816 bool use_software, 1817 bool use_software,
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2239 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2239 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2240 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2240 2241
2241 blink::mainThreadIsolate()->MemoryPressureNotification( 2242 blink::mainThreadIsolate()->MemoryPressureNotification(
2242 v8_memory_pressure_level); 2243 v8_memory_pressure_level);
2243 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2244 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2244 v8_memory_pressure_level); 2245 v8_memory_pressure_level);
2245 } 2246 }
2246 2247
2247 } // namespace content 2248 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | services/ui/common/gpu_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698