Chromium Code Reviews| Index: ash/display/window_tree_host_manager.cc |
| diff --git a/ash/display/window_tree_host_manager.cc b/ash/display/window_tree_host_manager.cc |
| index dc0f63d1e90b9bedfc89867396880f71d11f74d3..b24355b1ce5ab6d9433fb36d3ad97d0fc26f940e 100644 |
| --- a/ash/display/window_tree_host_manager.cc |
| +++ b/ash/display/window_tree_host_manager.cc |
| @@ -332,14 +332,13 @@ aura::Window* WindowTreeHostManager::GetPrimaryRootWindow() { |
| aura::Window* WindowTreeHostManager::GetRootWindowForDisplayId(int64_t id) { |
| AshWindowTreeHost* host = GetAshWindowTreeHostForDisplayId(id); |
| - CHECK(host); |
| - return GetWindow(host); |
| + return host ? GetWindow(host) : nullptr; |
| } |
| AshWindowTreeHost* WindowTreeHostManager::GetAshWindowTreeHostForDisplayId( |
| int64_t display_id) { |
| - CHECK_EQ(1u, window_tree_hosts_.count(display_id)) << "display id = " |
| - << display_id; |
| + if (window_tree_hosts_.count(display_id) == 0) |
|
sky
2016/10/11 02:40:37
use find and a conditional to avoid the double loo
msw
2016/10/11 15:38:00
Done.
|
| + return nullptr; |
| return window_tree_hosts_[display_id]; |
| } |