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

Unified Diff: components/exo/buffer.h

Issue 2584953002: exo::CompositorFrameSinkHolder's release callbacks hold ref (Closed)
Patch Set: All exo unit tests passed. Created 3 years, 12 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
« no previous file with comments | « no previous file | components/exo/buffer.cc » ('j') | components/exo/buffer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/buffer.h
diff --git a/components/exo/buffer.h b/components/exo/buffer.h
index e7b5b605c45e423e78ce5ce91cf92ee346110338..eeaf1c3e124057c6749d9f60a51b2171d88b3361 100644
--- a/components/exo/buffer.h
+++ b/components/exo/buffer.h
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "cc/resources/transferable_resource.h"
#include "ui/gfx/geometry/size.h"
namespace base {
@@ -18,17 +19,14 @@ class TracedValue;
}
}
-namespace cc {
-class SingleReleaseCallback;
-class TextureMailbox;
-}
-
namespace gfx {
class GpuMemoryBuffer;
}
namespace exo {
+class CompositorFrameSinkHolder;
+
// This class provides the content for a Surface. The mechanism by which a
// client provides and updates the contents is the responsibility of the client
// and not defined as part of this class.
@@ -53,10 +51,12 @@ class Buffer : public base::SupportsWeakPtr<Buffer> {
// buffer. Returns a release callback on success. The release callback should
// be called before a new texture mailbox can be acquired unless
// |non_client_usage| is true.
- std::unique_ptr<cc::SingleReleaseCallback> ProduceTextureMailbox(
- cc::TextureMailbox* mailbox,
+ bool ProduceTransferableResource(
+ CompositorFrameSinkHolder* compositor_frame_sink_holder,
+ cc::ResourceId resource_id,
bool secure_output_only,
- bool client_usage);
+ bool client_usage,
+ cc::TransferableResource* resource);
// This should be called when the buffer is attached to a Surface.
void OnAttach();
@@ -123,6 +123,12 @@ class Buffer : public base::SupportsWeakPtr<Buffer> {
// The client release callback.
base::Closure release_callback_;
+ // The CompositorFrameSinkHolder that has the ReleaseCallback of this buffer
+ // produced in ProduceTextureMailbox().
+ // Buffer holds a reference to the CompositorFrameSinkHolder to keep it alive.
+ // The refptr is reset when the release callback is called.
+ scoped_refptr<CompositorFrameSinkHolder> compositor_frame_sink_holder_;
+
DISALLOW_COPY_AND_ASSIGN(Buffer);
};
« no previous file with comments | « no previous file | components/exo/buffer.cc » ('j') | components/exo/buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698