Index: components/exo/compositor_frame_sink_holder.cc |
diff --git a/components/exo/compositor_frame_sink_holder.cc b/components/exo/compositor_frame_sink_holder.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..509918f957c601978aea270d5708f366cc1c452c |
--- /dev/null |
+++ b/components/exo/compositor_frame_sink_holder.cc |
@@ -0,0 +1,23 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/exo/compositor_frame_sink_holder.h" |
+ |
+#include "cc/resources/returned_resource.h" |
+ |
+namespace exo { |
+ |
+CompositorFrameSinkHolder::CompositorFrameSinkHolder() {} |
+CompositorFrameSinkHolder::~CompositorFrameSinkHolder() {} |
+ |
+void CompositorFrameSinkHolder::ReclaimResources( |
+ const cc::ReturnedResourceArray& resources) { |
+ for (auto& resource : resources) { |
+ auto it = release_callbacks_.find(resource.id); |
+ DCHECK(it != release_callbacks_.end()); |
+ it->second.second->Run(resource.sync_token, resource.lost); |
+ release_callbacks_.erase(it); |
+ } |
+} |
+} // namespace exo |