Index: content/common/gpu/client/gpu_channel_host.h |
diff --git a/content/common/gpu/client/gpu_channel_host.h b/content/common/gpu/client/gpu_channel_host.h |
index ad56d18d85a13aca16672a2eb0d79794a3808277..ea988997b3f7d349e1f0d59bbae443fd7f7a1bc0 100644 |
--- a/content/common/gpu/client/gpu_channel_host.h |
+++ b/content/common/gpu/client/gpu_channel_host.h |
@@ -75,6 +75,8 @@ class CONTENT_EXPORT GpuChannelHostFactory { |
int32 surface_id, |
const GPUCreateCommandBufferConfig& init_params, |
int32 route_id) = 0; |
+ virtual void WaitForPendingGpuMemoryBufferUsageToComplete( |
+ const base::Closure& callback) = 0; |
}; |
// Encapsulates an IPC channel between the client and one GPU process. |
@@ -161,6 +163,9 @@ class GpuChannelHost : public IPC::Sender, |
// Generate a route ID guaranteed to be unique for this channel. |
int32 GenerateRouteID(); |
+ void WaitForPendingGpuMemoryBufferUsageToComplete( |
+ const base::Closure& callback); |
+ |
private: |
friend class base::RefCountedThreadSafe<GpuChannelHost>; |
GpuChannelHost(GpuChannelHostFactory* factory, |
@@ -242,6 +247,17 @@ class GpuChannelHost : public IPC::Sender, |
typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; |
ProxyMap proxies_; |
+ void WaitForPendingGpuMemoryBufferUsageToCompleteOnMain( |
+ uint32 id, |
+ scoped_refptr<base::MessageLoopProxy> caller_message_loop); |
+ void WaitCompletedOnCallerThread(uint32 id); |
+ |
+ // Protects signal_tasks_. |
+ mutable base::Lock signal_lock_; |
+ typedef base::hash_map<uint32, base::Closure> SignalTaskMap; |
+ SignalTaskMap signal_tasks_; |
+ uint32 next_signal_id_; |
+ |
DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
}; |