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

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

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | services/ui/common/gpu_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/common/gpu_service.h
diff --git a/services/ui/common/gpu_service.h b/services/ui/common/gpu_service.h
index 7308754eac55f45c1c5ac0d7b234f8e75e16e9cd..d00a60c4ce1b1e77a96807bfdc94a359f53dc8aa 100644
--- a/services/ui/common/gpu_service.h
+++ b/services/ui/common/gpu_service.h
@@ -27,6 +27,8 @@ namespace ui {
class MUS_COMMON_EXPORT GpuService : public gpu::GpuChannelHostFactory {
public:
+ ~GpuService() override;
+
void EstablishGpuChannel(const base::Closure& callback);
scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync();
scoped_refptr<gpu::GpuChannelHost> GetGpuChannel();
@@ -36,16 +38,13 @@ class MUS_COMMON_EXPORT GpuService : public gpu::GpuChannelHostFactory {
// The GpuService has to be initialized in the main thread before establishing
// the gpu channel.
- static void Initialize(shell::Connector* connector);
- // The GpuService has to be terminated in the main thread.
- static void Terminate();
+ static std::unique_ptr<GpuService> Initialize(shell::Connector* connector);
static GpuService* GetInstance();
private:
friend struct base::DefaultSingletonTraits<GpuService>;
explicit GpuService(shell::Connector* connector);
- ~GpuService() override;
scoped_refptr<gpu::GpuChannelHost> GetGpuChannelLocked();
void EstablishGpuChannelOnMainThread();
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | services/ui/common/gpu_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698