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

Unified Diff: services/ui/ws/gpu_service_proxy.h

Issue 2281583003: services/ui: Split GpuServiceInternal into gpu vs. ws pieces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DONE_2016.08.24_mus-ws-gpu-refactor
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 | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/gpu_service_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/gpu_service_proxy.h
diff --git a/services/ui/ws/gpu_service_proxy.h b/services/ui/ws/gpu_service_proxy.h
index cb90c3c8ddadb1fc92b4d8d9ff47cc7e166f10dc..9a9a009873a01fde91e5e1895d04b2dc5abd4b50 100644
--- a/services/ui/ws/gpu_service_proxy.h
+++ b/services/ui/ws/gpu_service_proxy.h
@@ -5,22 +5,36 @@
#ifndef SERVICES_UI_WS_GPU_SERVICE_PROXY_H_
#define SERVICES_UI_WS_GPU_SERVICE_PROXY_H_
+#include "base/single_thread_task_runner.h"
+#include "base/synchronization/waitable_event.h"
+#include "base/threading/thread.h"
#include "gpu/config/gpu_info.h"
+#include "gpu/ipc/client/gpu_channel_host.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h"
#include "services/ui/public/interfaces/gpu_memory_buffer.mojom.h"
#include "services/ui/public/interfaces/gpu_service.mojom.h"
+namespace gpu {
+class GpuChannelHost;
+}
+
namespace ui {
class GpuServiceInternal;
+namespace ws {
+
+class GpuServiceProxyDelegate;
+class MusGpuMemoryBufferManager;
+
// The proxy implementation that relays requests from clients to the real
// service implementation in the GPU process over mojom.GpuServiceInternal.
-class GpuServiceProxy : public mojom::GpuService {
+class GpuServiceProxy : public mojom::GpuService,
+ public gpu::GpuChannelHostFactory {
public:
- GpuServiceProxy();
+ explicit GpuServiceProxy(GpuServiceProxyDelegate* delegate);
~GpuServiceProxy() override;
void Add(mojom::GpuServiceRequest request);
@@ -30,11 +44,12 @@ class GpuServiceProxy : public mojom::GpuService {
void OnGpuChannelEstablished(const EstablishGpuChannelCallback& callback,
int32_t client_id,
mojo::ScopedMessagePipeHandle channel_handle);
+ void OnInternalGpuChannelEstablished(
+ mojo::ScopedMessagePipeHandle channel_handle);
// mojom::GpuService overrides:
void EstablishGpuChannel(
const EstablishGpuChannelCallback& callback) override;
-
void CreateGpuMemoryBuffer(
mojom::GpuMemoryBufferIdPtr id,
const gfx::Size& size,
@@ -43,18 +58,30 @@ class GpuServiceProxy : public mojom::GpuService {
uint64_t surface_id,
const mojom::GpuService::CreateGpuMemoryBufferCallback& callback)
override;
-
void DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id,
const gpu::SyncToken& sync_token) override;
+ // gpu::GpuChannelHostFactory overrides:
+ bool IsMainThread() override;
+ scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
+ std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
+ size_t size) override;
+
+ GpuServiceProxyDelegate* delegate_;
int32_t next_client_id_;
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
mojom::GpuServiceInternalPtr gpu_service_;
- mojo::BindingSet<GpuService> bindings_;
+ mojo::BindingSet<mojom::GpuService> bindings_;
gpu::GPUInfo gpu_info_;
+ scoped_refptr<gpu::GpuChannelHost> gpu_channel_;
+ base::WaitableEvent shutdown_event_;
+ std::unique_ptr<base::Thread> io_thread_;
+ std::unique_ptr<MusGpuMemoryBufferManager> gpu_memory_buffer_manager_;
DISALLOW_COPY_AND_ASSIGN(GpuServiceProxy);
};
+} // namespace ws
} // namespace ui
#endif // SERVICES_UI_WS_GPU_SERVICE_PROXY_H_
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/gpu_service_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698