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

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

Issue 2741343003: Update liftetime management of GpuClient (Closed)
Patch Set: Testing GpuClient Created 3 years, 9 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
Index: services/ui/ws/gpu_host.h
diff --git a/services/ui/ws/gpu_host.h b/services/ui/ws/gpu_host.h
index b937266a5cc7136b079d451ae36d421b6797c376..d2302a39f7408ca6e90e289190b92ec9fab8ce54 100644
--- a/services/ui/ws/gpu_host.h
+++ b/services/ui/ws/gpu_host.h
@@ -12,6 +12,7 @@
#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 "mojo/public/cpp/bindings/strong_binding_set.h"
#include "services/ui/gpu/gpu_main.h"
#include "services/ui/gpu/interfaces/gpu_host.mojom.h"
#include "services/ui/gpu/interfaces/gpu_service.mojom.h"
@@ -23,6 +24,10 @@ class ServerGpuMemoryBufferManager;
namespace ws {
+namespace test {
+class GpuHostTest;
+} // namespace test
+
class GpuHostDelegate;
// Sets up connection from clients to the real service implementation in the GPU
@@ -32,7 +37,7 @@ class GpuHost : public mojom::GpuHost {
explicit GpuHost(GpuHostDelegate* delegate);
~GpuHost() override;
- void Add(mojom::GpuRequest request);
+ mojom::Gpu* Add(mojom::GpuRequest request);
void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget);
void OnAcceleratedWidgetDestroyed(gfx::AcceleratedWidget widget);
@@ -42,6 +47,8 @@ class GpuHost : public mojom::GpuHost {
cc::mojom::DisplayCompositorClientPtr client);
private:
+ friend class test::GpuHostTest;
+
void OnBadMessageFromGpu();
// mojom::GpuHost:
@@ -72,6 +79,8 @@ class GpuHost : public mojom::GpuHost {
// because that will live in another process soon.
std::unique_ptr<GpuMain> gpu_main_impl_;
+ mojo::StrongBindingSet<mojom::Gpu> gpu_bindings_;
+
DISALLOW_COPY_AND_ASSIGN(GpuHost);
};

Powered by Google App Engine
This is Rietveld 408576698