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

Unified Diff: services/ui/ws/server_window_surface.h

Issue 2400723003: Mus+Ash: Use standard cc mechanism for surface lifetime. (Closed)
Patch Set: Addressed Rob's comments Created 4 years, 2 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
Index: services/ui/ws/server_window_surface.h
diff --git a/services/ui/ws/server_window_surface.h b/services/ui/ws/server_window_surface.h
index a4514dd4a6e5930d83345fe218c88d65a9b6f95e..8b5dfd9b9d8c8967be375e9185f5abe23611a06b 100644
--- a/services/ui/ws/server_window_surface.h
+++ b/services/ui/ws/server_window_surface.h
@@ -50,15 +50,25 @@ class ServerWindowSurface : public mojom::Surface,
cc::CompositorFrame frame,
const SubmitCompositorFrameCallback& callback) override;
+ // There is a 1-1 correspondence between FrameSinks and frame sources.
+ // The FrameSinkId uniquely identifies the FrameSink, and since there is
+ // one FrameSink per ServerWindowSurface, it allows the window server
+ // to uniquely identify the window, and the thus the client that generated the
+ // frame.
+ const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
+
+ // The LocalFrameId can be thought of as an identifier to a bucket of
+ // sequentially submitted CompositorFrames in the same FrameSink all sharing
+ // the same size and device scale factor.
const cc::LocalFrameId& local_frame_id() const { return local_frame_id_; }
+ bool has_frame() const { return !local_frame_id_.is_null(); }
+
cc::SurfaceId GetSurfaceId() const;
- // Destroys old surfaces that have been outdated by a new surface.
- void DestroySurfacesScheduledForDestruction();
+ ServerWindow* window();
private:
- ServerWindow* window();
// SurfaceFactoryClient implementation.
void ReturnResources(const cc::ReturnedResourceArray& resources) override;
@@ -77,9 +87,6 @@ class ServerWindowSurface : public mojom::Surface,
mojom::SurfaceClientPtr client_;
mojo::Binding<Surface> binding_;
- // Set of surface ids that need to be destroyed.
- std::set<cc::LocalFrameId> surfaces_scheduled_for_destruction_;
-
bool may_contain_video_ = false;
DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface);

Powered by Google App Engine
This is Rietveld 408576698