| Index: cc/surfaces/surface_manager.h
|
| diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h
|
| index 47651b77c07bd88d9ca148480d19b661cf1e1119..ef6a73512a363292dee334deb02120c6aa0165a5 100644
|
| --- a/cc/surfaces/surface_manager.h
|
| +++ b/cc/surfaces/surface_manager.h
|
| @@ -137,6 +137,8 @@ class CC_SURFACES_EXPORT SurfaceManager
|
| }
|
|
|
| private:
|
| + friend class SurfaceManagerRefTest;
|
| +
|
| using SurfaceIdSet = std::unordered_set<SurfaceId, SurfaceIdHash>;
|
|
|
| void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id,
|
| @@ -158,6 +160,11 @@ class CC_SURFACES_EXPORT SurfaceManager
|
| void RemoveSurfaceReferenceImpl(const SurfaceId& parent_id,
|
| const SurfaceId& child_id);
|
|
|
| + // Adds a reference from parent id to child id without dealing with temporary
|
| + // references.
|
| + void AddSurfaceReferenceImpl(const SurfaceId& parent_id,
|
| + const SurfaceId& child_id);
|
| +
|
| #if DCHECK_IS_ON()
|
| // Recursively prints surface references starting at |surface_id| to |str|.
|
| void SurfaceReferencesToStringImpl(const SurfaceId& surface_id,
|
| @@ -227,6 +234,14 @@ class CC_SURFACES_EXPORT SurfaceManager
|
| // references.
|
| scoped_refptr<SurfaceReferenceFactory> reference_factory_;
|
|
|
| + // SurfaceIds that have temporary references from top level root so they
|
| + // aren't GC'd before a real reference is added. This is basically a
|
| + // collection of surface ids, for example:
|
| + // SurfaceId surface_id(key, value[index]);
|
| + // The LocalFrameIds are stored in the order the surfaces are created in.
|
| + std::unordered_map<FrameSinkId, std::vector<LocalFrameId>, FrameSinkIdHash>
|
| + temp_references_;
|
| +
|
| base::WeakPtrFactory<SurfaceManager> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SurfaceManager);
|
|
|