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

Unified Diff: services/ui/gpu/gpu_main.h

Issue 2366623002: services/ui: Initialize all of gpu in one thread. (Closed)
Patch Set: . Created 4 years, 3 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 | « no previous file | services/ui/gpu/gpu_main.cc » ('j') | services/ui/gpu/gpu_main.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/gpu/gpu_main.h
diff --git a/services/ui/gpu/gpu_main.h b/services/ui/gpu/gpu_main.h
index ffcf8c01a0203a070c251bac1894d28541764ab8..dfd1a2364a125926ef8878d1e489850038381df9 100644
--- a/services/ui/gpu/gpu_main.h
+++ b/services/ui/gpu/gpu_main.h
@@ -5,6 +5,7 @@
#ifndef SERVICES_UI_GPU_GPU_MAIN_H_
#define SERVICES_UI_GPU_GPU_MAIN_H_
+#include "base/threading/thread.h"
#include "gpu/ipc/service/gpu_init.h"
#include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h"
@@ -21,19 +22,32 @@ class GpuMain : public gpu::GpuSandboxHelper {
GpuMain();
~GpuMain() override;
- void Add(mojom::GpuServiceInternalRequest request);
+ void OnStart();
+ void Create(mojom::GpuServiceInternalRequest request);
GpuServiceInternal* gpu_service() { return gpu_service_internal_.get(); }
private:
+ void InitOnGpuThread();
+ void TearDownOnGpuThread();
+ void CreateOnGpuThread(mojom::GpuServiceInternalRequest request);
+
// gpu::GpuSandboxHelper:
void PreSandboxStartup() override;
bool EnsureSandboxInitialized() override;
+ std::unique_ptr<gpu::GpuInit> gpu_init_;
std::unique_ptr<GpuServiceInternal> gpu_service_internal_;
- gpu::GpuInit gpu_init_;
std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
+ // The main thread for GpuService.
+ base::Thread gpu_thread_;
+
+ // The thread that handles IO events for GpuService.
+ base::Thread io_thread_;
+
+ base::WeakPtrFactory<GpuMain> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GpuMain);
};
« no previous file with comments | « no previous file | services/ui/gpu/gpu_main.cc » ('j') | services/ui/gpu/gpu_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698