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

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

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.cc
diff --git a/services/ui/ws/gpu_host.cc b/services/ui/ws/gpu_host.cc
index bfa771d2719096c64545be4756218e0c0cb422b4..c2c3c40cd8c09bfe3089369f90d0b601dc166720 100644
--- a/services/ui/ws/gpu_host.cc
+++ b/services/ui/ws/gpu_host.cc
@@ -43,16 +43,20 @@ class GpuClient : public mojom::Gpu {
gpu_info_(gpu_info),
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
gpu_service_(gpu_service) {
+ LOG(ERROR) << "JR GpuClient device_id " << gpu_info->gpu.device_id << "\n";
DCHECK(gpu_memory_buffer_manager_);
DCHECK(gpu_service_);
}
~GpuClient() override {
+ LOG(ERROR) << "JR GpuClient death\n";
gpu_memory_buffer_manager_->DestroyAllGpuMemoryBufferForClient(client_id_);
}
private:
void OnGpuChannelEstablished(const EstablishGpuChannelCallback& callback,
mojo::ScopedMessagePipeHandle channel_handle) {
+ LOG(ERROR) << "JR OnGpuChannelEstablished device_id "
+ << gpu_info_->gpu.device_id << "\n";
callback.Run(client_id_, std::move(channel_handle), *gpu_info_);
}
@@ -61,6 +65,7 @@ class GpuClient : public mojom::Gpu {
const EstablishGpuChannelCallback& callback) override {
// TODO(sad): crbug.com/617415 figure out how to generate a meaningful
// tracing id.
+ LOG(ERROR) << "JR GpuClient EstablishGpuChannel\n";
const uint64_t client_tracing_id = 0;
constexpr bool is_gpu_host = false;
gpu_service_->EstablishGpuChannel(
@@ -118,14 +123,19 @@ GpuHost::GpuHost(GpuHostDelegate* delegate)
gpu_service_.get(), next_client_id_++);
}
-GpuHost::~GpuHost() {}
+GpuHost::~GpuHost() {
+ LOG(ERROR) << "JR GpuHost death\n";
+}
+
+mojom::Gpu* GpuHost::Add(mojom::GpuRequest request) {
+ // gpu_bindings_.AddBinding(
-void GpuHost::Add(mojom::GpuRequest request) {
- mojo::MakeStrongBinding(
- base::MakeUnique<GpuClient>(next_client_id_++, &gpu_info_,
- gpu_memory_buffer_manager_.get(),
- gpu_service_.get()),
- std::move(request));
+ return mojo::MakeStrongBinding(
+ base::MakeUnique<GpuClient>(next_client_id_++, &gpu_info_,
+ gpu_memory_buffer_manager_.get(),
+ gpu_service_.get()),
+ std::move(request))
+ ->impl();
}
void GpuHost::OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) {
@@ -153,7 +163,9 @@ void GpuHost::OnBadMessageFromGpu() {
}
void GpuHost::DidInitialize(const gpu::GPUInfo& gpu_info) {
+ LOG(ERROR) << "JR DidInitialize\n";
gpu_info_ = gpu_info;
+ // CHECK(false);
delegate_->OnGpuServiceInitialized();
}

Powered by Google App Engine
This is Rietveld 408576698