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

Unified Diff: components/exo/compositor_frame_sink_holder.h

Issue 2584953002: exo::CompositorFrameSinkHolder's release callbacks hold ref (Closed)
Patch Set: Use ScopedClosureRunner Created 4 years 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: components/exo/compositor_frame_sink_holder.h
diff --git a/components/exo/compositor_frame_sink_holder.h b/components/exo/compositor_frame_sink_holder.h
index 59cc9879e8908be5adeeae3adf1a92fa5b83bd4c..363aea2c0bd00a7e214cbdcd5bddf91d58918f3a 100644
--- a/components/exo/compositor_frame_sink_holder.h
+++ b/components/exo/compositor_frame_sink_holder.h
@@ -79,14 +79,13 @@ class CompositorFrameSinkHolder
void UpdateNeedsBeginFrame();
- // Each release callback holds a reference to the CompositorFrameSinkHolder
- // itself to keep it alive. Running and erasing the callbacks might result in
- // the instance being destroyed. Therefore, we should not access any member
- // variables after running and erasing the callbacks.
+ // Each release callback should should take a
+ // scoped_refptr<CompositorFrameSinkHolder> so that CompositorFrameSinkHolder
+ // lives at least until all callbacks are run. Running the
+ // callbacks might result in the instance being destroyed. Therefore, we
+ // should not access any member variables after running the callbacks.
using ResourceReleaseCallbackMap =
- std::map<int,
- std::pair<scoped_refptr<CompositorFrameSinkHolder>,
- std::unique_ptr<cc::SingleReleaseCallback>>>;
+ std::map<int, std::unique_ptr<cc::SingleReleaseCallback>>;
ResourceReleaseCallbackMap release_callbacks_;
Surface* surface_;

Powered by Google App Engine
This is Rietveld 408576698