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

Unified Diff: content/common/gpu/client/gpu_channel_host.h

Issue 654223006: Cleanup GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: 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);
};

Powered by Google App Engine
This is Rietveld 408576698