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

Unified Diff: cc/surfaces/surface_reference_manager.h

Issue 2541683004: Add/remove surface references via MojoCompositorFrameSink. (Closed)
Patch Set: 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: cc/surfaces/surface_reference_manager.h
diff --git a/cc/surfaces/surface_reference_manager.h b/cc/surfaces/surface_reference_manager.h
index 66d55c67a4e96f703ed131bd4341537b90802808..ad85537e67f103da674515825562de0adc68e6b0 100644
--- a/cc/surfaces/surface_reference_manager.h
+++ b/cc/surfaces/surface_reference_manager.h
@@ -19,12 +19,14 @@ class SurfaceReferenceManager {
// Adds a reference from a parent surface to a child surface. Any surface
// embedding a child surface should have a reference added so that the child
- // surface is not garbage collected until after the parent surface.
- virtual void AddSurfaceReference(const SurfaceId& parent_id,
+ // surface is not garbage collected until after the parent surface. Returns
+ // false if the reference was invalid or already exists and wasn't added.
+ virtual bool AddSurfaceReference(const SurfaceId& parent_id,
const SurfaceId& child_id) = 0;
- // Removes a reference from a parent surface to a child surface.
- virtual void RemoveSurfaceReference(const SurfaceId& parent_id,
+ // Removes a reference from a parent surface to a child surface. Return false
+ // if the reference doesn't exist and wasn't removed.
+ virtual bool RemoveSurfaceReference(const SurfaceId& parent_id,
const SurfaceId& child_id) = 0;
// Returns the number of surfaces that have references to |surface_id|. When

Powered by Google App Engine
This is Rietveld 408576698