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

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

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.cc
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc
index f7f5d823eedb84285f08f16f93c8b609bcd80793..ea02803efa7f1ce84dd6dd3e9a9534a99d075800 100644
--- a/content/common/gpu/client/gpu_channel_host.cc
+++ b/content/common/gpu/client/gpu_channel_host.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/barrier_closure.h"
#include "base/bind.h"
#include "base/debug/trace_event.h"
#include "base/message_loop/message_loop.h"
@@ -319,6 +320,18 @@ int32 GpuChannelHost::GenerateRouteID() {
return next_route_id_.GetNext();
}
+void GpuChannelHost::WaitForPendingGpuMemoryBufferUsageToComplete(
+ const base::Closure& callback) {
+ base::Closure proxy_barrier_closure =
+ base::BarrierClosure(proxies_.size(), callback);
+
+ AutoLock lock(context_lock_);
+ for (ProxyMap::iterator it = proxies_.begin(); it != proxies_.end(); it++) {
+ it->second->WaitForPendingGpuMemoryBufferUsageToComplete(
+ proxy_barrier_closure);
+ }
+}
+
GpuChannelHost::~GpuChannelHost() {
// channel_ must be destroyed on the main thread.
if (!factory_->IsMainThread())

Powered by Google App Engine
This is Rietveld 408576698