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

Unified Diff: cc/surfaces/surface.h

Issue 2831213004: cc: Reject CompositorFrames to old child surfaces (Closed)
Patch Set: Updated comments as per danakj's suggestions Created 3 years, 7 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/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface.h
diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h
index b43b1dafcd055c203ba5b249d93cce8211b40522..63371d6000f996d1ef4c1ecc46510f86945e9716 100644
--- a/cc/surfaces/surface.h
+++ b/cc/surfaces/surface.h
@@ -137,6 +137,10 @@ class CC_SURFACES_EXPORT Surface {
WillDrawCallback will_draw_callback;
};
+ // Called to prevent additional CompositorFrames from being accepted into this
+ // surface. Once a Surface is closed, it cannot accept CompositorFrames again.
+ void Close();
+
void ActivatePendingFrame();
// Called when all of the surface's dependencies have been resolved.
void ActivateFrame(FrameData frame_data);
@@ -153,13 +157,14 @@ class CC_SURFACES_EXPORT Surface {
CompositorFrame* frame,
std::vector<ui::LatencyInfo>* latency_info);
- SurfaceId surface_id_;
+ const SurfaceId surface_id_;
SurfaceId previous_frame_surface_id_;
base::WeakPtr<SurfaceFactory> factory_;
base::Optional<FrameData> pending_frame_data_;
base::Optional<FrameData> active_frame_data_;
int frame_index_;
+ bool closed_ = false;
bool destroyed_;
std::vector<SurfaceSequence> destruction_dependencies_;
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698