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

Unified Diff: services/ui/ws/window_tree.cc

Issue 2878113002: mus: Embedder can request and observe BeginFrame for embedded client. (Closed)
Patch Set: . 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
Index: services/ui/ws/window_tree.cc
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
index 511a495c93d9e1159234e74f0a1f06b2825c9de6..78bf90785f0743418690749476f372ccabe783db 100644
--- a/services/ui/ws/window_tree.cc
+++ b/services/ui/ws/window_tree.cc
@@ -1573,6 +1573,20 @@ void WindowTree::SetWindowBounds(
client()->OnChangeCompleted(change_id, success);
}
+void WindowTree::RequestBeginFrames(Id window_id,
+ cc::mojom::FrameSinkObserverPtr observer) {
+ ServerWindow* window = GetWindowByClientId(ClientWindowId(window_id));
+ // This client must own |window_id| if it wants to be able to add a frame sink
+ // observer.
+ if (!window || window->id().client_id != id_)
+ return;
+ // This makes no sense if |window| is not embedding a client.
+ if (!window_server_->GetTreeWithRoot(window))
+ return;
+ window->GetOrCreateCompositorFrameSinkManager()->RequestBeginFrames(
+ std::move(observer));
+}
+
void WindowTree::SetWindowVisibility(uint32_t change_id,
Id transport_window_id,
bool visible) {

Powered by Google App Engine
This is Rietveld 408576698