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

Unified Diff: services/ui/common/gpu_service.cc

Issue 2200353002: Revert of services/ui: Have an explicit lifetime/ownership of ui::GpuService. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/common/gpu_service.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/common/gpu_service.cc
diff --git a/services/ui/common/gpu_service.cc b/services/ui/common/gpu_service.cc
index 9a2f4c561a3e4b28576250d2b1782b026dcdc69e..f8bf9e79e0939d11ced35b5e1313616fe85c0011 100644
--- a/services/ui/common/gpu_service.cc
+++ b/services/ui/common/gpu_service.cc
@@ -47,18 +47,21 @@
GpuService::~GpuService() {
DCHECK(IsMainThread());
- DCHECK_EQ(this, g_gpu_service);
if (gpu_channel_)
gpu_channel_->DestroyChannel();
- g_gpu_service = nullptr;
}
// static
-std::unique_ptr<GpuService> GpuService::Initialize(
- shell::Connector* connector) {
+void GpuService::Initialize(shell::Connector* connector) {
DCHECK(!g_gpu_service);
g_gpu_service = new GpuService(connector);
- return base::WrapUnique(g_gpu_service);
+}
+
+// static
+void GpuService::Terminate() {
+ DCHECK(g_gpu_service);
+ delete g_gpu_service;
+ g_gpu_service = nullptr;
}
// static
« no previous file with comments | « services/ui/common/gpu_service.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698