Chromium Code Reviews| 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..fb279a5408311feacdd54a25c1413949ec3aa7e1 100644 |
| --- a/ui/aura/mus/window_tree_client.cc |
| +++ b/ui/aura/mus/window_tree_client.cc |
| @@ -183,25 +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(); |
| + // Clients should properly delete all of their windows before shutdown. |
| + DCHECK(windows_.empty()); |
|
sky
2017/02/13 23:16:15
I'm ok with making this a CHECK as I suspect this
jonross
2017/02/14 20:35:21
Done.
|
| for (WindowTreeClientObserver& observer : observers_) |
|
sky
2017/02/13 23:16:15
At this point we don't need be OnWillDestroyClient
jonross
2017/02/14 20:35:21
Done.
|
| observer.OnDidDestroyClient(this); |