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

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

Issue 2289553002: gpu: Introduce GpuInit. (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 50d029d95fb178fc80adf7d4d41f9b5b2ca81bb7..2f4ff27e9c6c42686b61f356b8717ddeeeb39378 100644
--- a/services/ui/gpu/gpu_service_internal.h
+++ b/services/ui/gpu/gpu_service_internal.h
@@ -22,11 +22,6 @@
#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;
@@ -40,6 +35,8 @@ class MediaService;
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.
@@ -47,17 +44,16 @@ class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
public mojom::GpuServiceInternal,
public base::NonThreadSafe {
public:
- void Add(mojom::GpuServiceInternalRequest request);
+ ~GpuServiceInternal() override;
- // TODO(sad): This should not be a singleton.
- static GpuServiceInternal* GetInstance();
+ void Add(mojom::GpuServiceInternalRequest request);
gpu::GpuChannelManager* gpu_channel_manager() const {
return gpu_channel_manager_.get();
}
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory() const {
- return gpu_memory_buffer_factory_.get();
+ return gpu_memory_buffer_factory_;
}
// TODO(sad): These should be mojom API.
@@ -73,10 +69,10 @@ class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
const gpu::SyncToken& sync_token);
private:
- friend struct base::DefaultSingletonTraits<GpuServiceInternal>;
+ friend class GpuMain;
- GpuServiceInternal();
- ~GpuServiceInternal() override;
+ GpuServiceInternal(gpu::GpuWatchdogThread* watchdog,
+ gpu::GpuMemoryBufferFactory* memory_buffer_factory);
void EstablishGpuChannelInternal(int32_t client_id,
uint64_t client_tracing_id,
@@ -138,7 +134,7 @@ class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
// The thread that handles IO events for GpuService.
base::Thread io_thread_;
- scoped_refptr<gpu::GpuWatchdogThread> watchdog_thread_;
+ gpu::GpuWatchdogThread* watchdog_thread_;
std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_;
@@ -146,7 +142,7 @@ class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
std::unique_ptr<media::MediaService> media_service_;
- std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
+ 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