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

Unified Diff: components/mus/ws/connection_manager.h

Issue 1750143002: Changes ownership of WindowTreeHostConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 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 | « components/mus/ws/BUILD.gn ('k') | components/mus/ws/connection_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/connection_manager.h
diff --git a/components/mus/ws/connection_manager.h b/components/mus/ws/connection_manager.h
index 94b4afd2a95c244017de36a85f110fe528b423d0..c35b03bcaa8af9f848533fdde9c2ace37242afe3 100644
--- a/components/mus/ws/connection_manager.h
+++ b/components/mus/ws/connection_manager.h
@@ -53,8 +53,10 @@ class ConnectionManager : public ServerWindowDelegate,
const scoped_refptr<mus::SurfacesState>& surfaces_state);
~ConnectionManager() override;
- // Adds a WindowTreeHost.
- void AddHost(WindowTreeHostConnection* connection);
+ // Adds/removes a WindowTreeHost. ConnectionManager owns the
+ // WindowTreeHostImpls.
+ void AddHost(WindowTreeHostImpl* host);
+ void DestroyHost(WindowTreeHostImpl* host);
// Creates a new ServerWindow. The return value is owned by the caller, but
// must be destroyed before ConnectionManager.
@@ -73,9 +75,7 @@ class ConnectionManager : public ServerWindowDelegate,
ClientConnection* GetClientConnection(WindowTreeImpl* window_tree);
- // Invoked when a WindowTreeHostConnection encounters an error or the
- // associated Display window is closed.
- void OnHostConnectionClosed(WindowTreeHostConnection* connection);
+ void OnHostConnectionClosed(WindowTreeHostImpl* host);
// See description of WindowTree::Embed() for details. This assumes
// |transport_window_id| is valid.
@@ -108,6 +108,9 @@ class ConnectionManager : public ServerWindowDelegate,
// Invoked when the WindowTreeHostImpl's display is closed.
void OnDisplayClosed();
+ // Called when the AcceleratedWidget is available for |host|.
+ void OnWindowTreeHostDisplayAvailable(WindowTreeHostImpl* host);
+
// Invoked when a connection messages a client about the change. This is used
// to avoid sending ServerChangeIdAdvanced() unnecessarily.
void OnConnectionMessagedClient(ConnectionSpecificId id);
@@ -134,9 +137,7 @@ class ConnectionManager : public ServerWindowDelegate,
WindowTreeHostImpl* GetActiveWindowTreeHost();
- bool has_tree_host_connections() const {
- return !host_connection_map_.empty();
- }
+ bool has_tree_host_connections() const { return !hosts_.empty(); }
void AddDisplayManagerBinding(
mojo::InterfaceRequest<mojom::DisplayManager> request);
@@ -303,8 +304,11 @@ class ConnectionManager : public ServerWindowDelegate,
// Set of WindowTreeImpls.
ConnectionMap connection_map_;
- // Set of WindowTreeHostImpls.
- HostConnectionMap host_connection_map_;
+ // WindowTreeHostImpls are initially added to |pending_hosts_|. When the
+ // display is initialized it is moved to |hosts_|.
+ // ConnectionManager owns the WindowTreeHostImpls.
+ std::set<WindowTreeHostImpl*> pending_hosts_;
+ std::set<WindowTreeHostImpl*> hosts_;
// If non-null then we're processing a client operation. The Operation is
// not owned by us (it's created on the stack by WindowTreeImpl).
« no previous file with comments | « components/mus/ws/BUILD.gn ('k') | components/mus/ws/connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698