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

Side by Side Diff: components/mus/ws/connection_manager.cc

Issue 1757403002: More user id tracking for mus: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/mus/ws/connection_manager.h" 5 #include "components/mus/ws/connection_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "components/mus/ws/client_connection.h" 9 #include "components/mus/ws/client_connection.h"
10 #include "components/mus/ws/connection_manager_delegate.h" 10 #include "components/mus/ws/connection_manager_delegate.h"
(...skipping 17 matching lines...) Expand all
28 ConnectionManagerDelegate* delegate, 28 ConnectionManagerDelegate* delegate,
29 const scoped_refptr<mus::SurfacesState>& surfaces_state) 29 const scoped_refptr<mus::SurfacesState>& surfaces_state)
30 : delegate_(delegate), 30 : delegate_(delegate),
31 surfaces_state_(surfaces_state), 31 surfaces_state_(surfaces_state),
32 next_connection_id_(1), 32 next_connection_id_(1),
33 next_host_id_(0), 33 next_host_id_(0),
34 current_operation_(nullptr), 34 current_operation_(nullptr),
35 in_destructor_(false), 35 in_destructor_(false),
36 next_wm_change_id_(0), 36 next_wm_change_id_(0),
37 got_valid_frame_decorations_(false), 37 got_valid_frame_decorations_(false),
38 window_manager_factory_registry_(this) {} 38 window_manager_factory_registry_(this, &user_id_tracker_) {}
39 39
40 ConnectionManager::~ConnectionManager() { 40 ConnectionManager::~ConnectionManager() {
41 in_destructor_ = true; 41 in_destructor_ = true;
42 42
43 while (!pending_hosts_.empty()) 43 while (!pending_hosts_.empty())
44 DestroyHost(*pending_hosts_.begin()); 44 DestroyHost(*pending_hosts_.begin());
45 DCHECK(pending_hosts_.empty()); 45 DCHECK(pending_hosts_.empty());
46 46
47 // DestroyHost() removes from |hosts_| and deletes the WindowTreeHostImpl. 47 // DestroyHost() removes from |hosts_| and deletes the WindowTreeHostImpl.
48 while (!hosts_.empty()) 48 while (!hosts_.empty())
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 WindowTreeHostImpl* ConnectionManager::GetActiveWindowTreeHost() { 305 WindowTreeHostImpl* ConnectionManager::GetActiveWindowTreeHost() {
306 // TODO(sky): this isn't active, but first. Make it active. 306 // TODO(sky): this isn't active, but first. Make it active.
307 return hosts_.size() ? *hosts_.begin() : nullptr; 307 return hosts_.size() ? *hosts_.begin() : nullptr;
308 } 308 }
309 309
310 void ConnectionManager::AddDisplayManagerBinding( 310 void ConnectionManager::AddDisplayManagerBinding(
311 mojo::InterfaceRequest<mojom::DisplayManager> request) { 311 mojo::InterfaceRequest<mojom::DisplayManager> request) {
312 display_manager_bindings_.AddBinding(this, std::move(request)); 312 display_manager_bindings_.AddBinding(this, std::move(request));
313 } 313 }
314 314
315 void ConnectionManager::CreateWindowManagerFactoryService( 315 void ConnectionManager::OnFirstWindowManagerFactorySet() {
316 uint32_t user_id,
317 mojo::InterfaceRequest<mojom::WindowManagerFactoryService> request) {
318 window_manager_factory_registry_.Register(user_id, std::move(request));
319 }
320
321 void ConnectionManager::OnWindowManagerFactorySet() {
322 if (!hosts_.empty() || !pending_hosts_.empty()) 316 if (!hosts_.empty() || !pending_hosts_.empty())
323 return; 317 return;
324 318
325 // We've been supplied a WindowManagerFactory and no windowtreehosts have been 319 // We've been supplied a WindowManagerFactory and no windowtreehosts have been
326 // created yet. Treat this as a signal to create a WindowTreeHost. 320 // created yet. Treat this as a signal to create a WindowTreeHost.
327 // TODO(sky): we need a better way to determine this, most likely a switch. 321 // TODO(sky): we need a better way to determine this, most likely a switch.
328 delegate_->CreateDefaultWindowTreeHosts(); 322 delegate_->CreateDefaultWindowTreeHosts();
329 } 323 }
330 324
331 uint32_t ConnectionManager::GenerateWindowManagerChangeId( 325 uint32_t ConnectionManager::GenerateWindowManagerChangeId(
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 if (!got_valid_frame_decorations_) { 763 if (!got_valid_frame_decorations_) {
770 display_manager_observers_.AddInterfacePtr(std::move(observer)); 764 display_manager_observers_.AddInterfacePtr(std::move(observer));
771 return; 765 return;
772 } 766 }
773 CallOnDisplays(observer.get()); 767 CallOnDisplays(observer.get());
774 display_manager_observers_.AddInterfacePtr(std::move(observer)); 768 display_manager_observers_.AddInterfacePtr(std::move(observer));
775 } 769 }
776 770
777 } // namespace ws 771 } // namespace ws
778 } // namespace mus 772 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698