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

Unified Diff: cc/surfaces/surface_manager.h

Issue 2642123004: Fix surface reference assumptions in SurfaceManager. (Closed)
Patch Set: Rebase + fix test. Created 3 years, 11 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 | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_manager.h
diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h
index ef6a73512a363292dee334deb02120c6aa0165a5..3ca1da731fc91c2c913fbbe440aca7f0bb6bb6ae 100644
--- a/cc/surfaces/surface_manager.h
+++ b/cc/surfaces/surface_manager.h
@@ -145,26 +145,34 @@ class CC_SURFACES_EXPORT SurfaceManager
BeginFrameSource* source);
void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id,
BeginFrameSource* source);
+
// Returns true if |child namespace| is or has |search_frame_sink_id| as a
// child.
bool ChildContains(const FrameSinkId& child_frame_sink_id,
const FrameSinkId& search_frame_sink_id) const;
- // Garbage collects all destroyed surfaces not reachable from the root. Used
- // when |use_references_| is true.
- void GarbageCollectSurfacesFromRoot();
+ // Garbage collects all destroyed surfaces that aren't live.
void GarbageCollectSurfaces();
- // Removes reference from a parent surface to a child surface. Used to remove
- // references without triggered GC.
- void RemoveSurfaceReferenceImpl(const SurfaceId& parent_id,
- const SurfaceId& child_id);
+ // Returns set of live surfaces for |lifetime_manager_| is REFERENCES.
+ SurfaceIdSet GetLiveSurfacesForReferences();
- // Adds a reference from parent id to child id without dealing with temporary
- // references.
+ // Returns set of live surfaces for |lifetime_manager_| is SEQUENCES.
+ SurfaceIdSet GetLiveSurfacesForSequences();
+
+ // Adds a reference from |parent_id| to |child_id| without dealing with
+ // temporary references.
void AddSurfaceReferenceImpl(const SurfaceId& parent_id,
const SurfaceId& child_id);
+ // Removes a reference from a |parent_id| to |child_id|.
+ void RemoveSurfaceReferenceImpl(const SurfaceId& parent_id,
+ const SurfaceId& child_id);
+
+ // Removes all surface references to or from |surface_id|. Used when the
+ // surface is about to be deleted.
+ void RemoveAllSurfaceReferences(const SurfaceId& surface_id);
+
#if DCHECK_IS_ON()
// Recursively prints surface references starting at |surface_id| to |str|.
void SurfaceReferencesToStringImpl(const SurfaceId& surface_id,
« no previous file with comments | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698