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

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

Issue 2338483003: Revert of services/ui: Use new gpu::GpuInit to do the GPU initialization. (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 | « services/ui/gpu/gpu_main.cc ('k') | services/ui/gpu/gpu_service_internal.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/gpu/gpu_service_internal.h
diff --git a/services/ui/gpu/gpu_service_internal.h b/services/ui/gpu/gpu_service_internal.h
index 82f93d05e439ccb4fbd3ba366343938a2275dcb5..60b4f37c52d3201ec3cd752c7d083df2c643780a 100644
--- a/services/ui/gpu/gpu_service_internal.h
+++ b/services/ui/gpu/gpu_service_internal.h
@@ -22,6 +22,11 @@
#include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h"
#include "ui/gfx/native_widget_types.h"
+namespace base {
+template <typename T>
+struct DefaultSingletonTraits;
+}
+
namespace gpu {
class GpuChannelHost;
class GpuMemoryBufferFactory;
@@ -35,8 +40,6 @@
namespace ui {
-class GpuMain;
-
// This runs in the GPU process, and communicates with the gpu host (which is
// the window server) over the mojom APIs. This is responsible for setting up
// the connection to clients, allocating/free'ing gpu memory etc.
@@ -44,16 +47,17 @@
public mojom::GpuServiceInternal,
public base::NonThreadSafe {
public:
- ~GpuServiceInternal() override;
+ void Add(mojom::GpuServiceInternalRequest request);
- void Add(mojom::GpuServiceInternalRequest request);
+ // TODO(sad): This should not be a singleton.
+ static GpuServiceInternal* GetInstance();
gpu::GpuChannelManager* gpu_channel_manager() const {
return gpu_channel_manager_.get();
}
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory() const {
- return gpu_memory_buffer_factory_;
+ return gpu_memory_buffer_factory_.get();
}
// TODO(sad): These should be mojom API.
@@ -69,11 +73,10 @@
const gpu::SyncToken& sync_token);
private:
- friend class GpuMain;
+ friend struct base::DefaultSingletonTraits<GpuServiceInternal>;
- GpuServiceInternal(const gpu::GPUInfo& gpu_info,
- gpu::GpuWatchdogThread* watchdog,
- gpu::GpuMemoryBufferFactory* memory_buffer_factory);
+ GpuServiceInternal();
+ ~GpuServiceInternal() override;
void EstablishGpuChannelInternal(int32_t client_id,
uint64_t client_tracing_id,
@@ -134,7 +137,7 @@
// The thread that handles IO events for GpuService.
base::Thread io_thread_;
- gpu::GpuWatchdogThread* watchdog_thread_;
+ scoped_refptr<gpu::GpuWatchdogThread> watchdog_thread_;
std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_;
@@ -142,7 +145,7 @@
std::unique_ptr<media::MediaService> media_service_;
- gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory_;
+ std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
gpu::GpuPreferences gpu_preferences_;
« no previous file with comments | « services/ui/gpu/gpu_main.cc ('k') | services/ui/gpu/gpu_service_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698