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

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2696573003: Have WindowTreeClient detect error state earlier (Closed)
Patch Set: Fix test exposed by new check Created 3 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 | « no previous file | ui/aura/mus/window_tree_client_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index b71391bc5bab8f5977235c55f7e570fe3f791b1c..a646e8aeacd8ca3466395794a2804dde2a043a58 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -183,28 +183,8 @@ WindowTreeClient::~WindowTreeClient() {
for (WindowTreeClientObserver& observer : observers_)
observer.OnWillDestroyClient(this);
- std::vector<Window*> non_owned;
- WindowTracker tracker;
- while (!windows_.empty()) {
- IdToWindowMap::iterator it = windows_.begin();
- if (WasCreatedByThisClient(it->second)) {
- const Id window_id = it->second->server_id();
- delete it->second->GetWindow();
- DCHECK_EQ(0u, windows_.count(window_id));
- } else {
- tracker.Add(it->second->GetWindow());
- windows_.erase(it);
- }
- }
-
- // Delete the non-owned windows last. In the typical case these are roots. The
- // exception is the window manager and embed roots, which may know about
- // other random windows that it doesn't own.
- while (!tracker.windows().empty())
- delete tracker.windows().front();
-
- for (WindowTreeClientObserver& observer : observers_)
- observer.OnDidDestroyClient(this);
+ // Clients should properly delete all of their windows before shutdown.
+ CHECK(windows_.empty());
capture_synchronizer_.reset();
« no previous file with comments | « no previous file | ui/aura/mus/window_tree_client_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698