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

Unified Diff: ash/display/window_tree_host_manager.cc

Issue 2391253004: Use mojo Shelf interfaces for both mash and classic ash. (Closed)
Patch Set: Fix and workaround test issues. Created 4 years, 2 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
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];
}

Powered by Google App Engine
This is Rietveld 408576698