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

Unified Diff: cc/surfaces/surface_manager.h

Issue 2716553004: Add temporary reference ownership to SurfaceManager. (Closed)
Patch Set: Rebase Created 3 years, 10 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 | 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 fd5a785e56b999bd74eba0565d760c6dac108bfc..569c6e44c0306d3ae694b4adb5a1dd1a918ccd7f 100644
--- a/cc/surfaces/surface_manager.h
+++ b/cc/surfaces/surface_manager.h
@@ -147,6 +147,18 @@ class CC_SURFACES_EXPORT SurfaceManager {
// collection to delete unreachable surfaces.
void RemoveSurfaceReferences(const std::vector<SurfaceReference>& references);
+ // Assigns |frame_sink_id| as the owner of the temporary reference to
+ // |surface_id|. If |frame_sink_id| is invalidated the temporary reference
+ // will be removed. If a surface reference has already been added from the
+ // parent to |surface_id| then this will do nothing.
+ void AssignTemporaryReference(const SurfaceId& surface_id,
+ const FrameSinkId& owner);
+
+ // Drops the temporary reference for |surface_id|. If a surface reference has
+ // already been added from the parent to |surface_id| then this will do
+ // nothing.
+ void DropTemporaryReference(const SurfaceId& surface_id);
+
scoped_refptr<SurfaceReferenceFactory> reference_factory() {
return reference_factory_;
}
@@ -195,7 +207,8 @@ class CC_SURFACES_EXPORT SurfaceManager {
bool HasTemporaryReference(const SurfaceId& surface_id) const;
- // Adds a temporary reference to |surface_id|.
+ // Adds a temporary reference to |surface_id|. The reference will not have an
+ // owner initially.
void AddTemporaryReference(const SurfaceId& surface_id);
// Removes temporary reference to |surface_id|. If |remove_range| is true then
@@ -273,8 +286,8 @@ class CC_SURFACES_EXPORT SurfaceManager {
scoped_refptr<SurfaceReferenceFactory> reference_factory_;
// A map of surfaces that have temporary references to them. The key is the
- // SurfaceId and the value is the owner.
- // TODO(kylechar): Use owner value.
+ // SurfaceId and the value is the owner. The owner will initially be empty and
+ // set later by AssignTemporaryReference().
std::unordered_map<SurfaceId, base::Optional<FrameSinkId>, SurfaceIdHash>
temporary_references_;
« no previous file with comments | « no previous file | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698