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

Unified Diff: services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.h

Issue 2651443002: Fix potential shutdown deadlock in UI service (Closed)
Patch Set: Created 3 years, 11 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/public/cpp/gpu/client_gpu_memory_buffer_manager.h
diff --git a/services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.h b/services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.h
index 26d78ea5781ceb1ffc894cfd8784a668392ef2df..b42783d2f44daf44f7c434d5836e56e6a6a24f4c 100644
--- a/services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.h
+++ b/services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.h
@@ -6,6 +6,7 @@
#define SERVICES_UI_PUBLIC_CPP_GPU_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_
#include <memory>
+#include <set>
#include <vector>
#include "base/macros.h"
@@ -45,11 +46,19 @@ class ClientGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager {
gpu::SurfaceHandle surface_handle) override;
void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer,
const gpu::SyncToken& sync_token) override;
+
+ void DisconnectGpuOnThread();
+ void OnGpuMemoryBufferAllocatedOnThread(
sadrul 2017/01/21 02:54:31 Move these above to group with TearDownThread()/Al
Ken Rockot(use gerrit already) 2017/01/23 18:00:50 Done
+ gfx::GpuMemoryBufferHandle* ret_handle,
+ base::WaitableEvent* wait,
+ const gfx::GpuMemoryBufferHandle& handle);
+
int counter_ = 0;
// TODO(sad): Explore the option of doing this from an existing thread.
base::Thread thread_;
mojom::GpuPtr gpu_;
base::WeakPtr<ClientGpuMemoryBufferManager> weak_ptr_;
+ std::set<base::WaitableEvent*> pending_allocation_waiters_;
base::WeakPtrFactory<ClientGpuMemoryBufferManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ClientGpuMemoryBufferManager);

Powered by Google App Engine
This is Rietveld 408576698