Commit 15302e6a authored by Scott Violet's avatar Scott Violet

chromeos: fix use of uninitialized value in DisplayManager

DisplayManager's constructor is called from WindowServer's
constructor. This means DisplayManager shouldn't call to WindowServer,
else we get use of unitialized values like this.

BUG=822246
TEST=covered by tests

Change-Id: I296911502021a135276a9db49b98927efea95618
Reviewed-on: https://chromium-review.googlesource.com/963831Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543437}
parent 93d6eba0
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
namespace ui { namespace ui {
namespace ws { namespace ws {
DisplayManager::DisplayManager(WindowServer* window_server) DisplayManager::DisplayManager(WindowServer* window_server, bool is_hosting_viz)
: window_server_(window_server), : window_server_(window_server),
cursor_location_manager_(std::make_unique<CursorLocationManager>()) { cursor_location_manager_(std::make_unique<CursorLocationManager>()) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
if (window_server->is_hosting_viz()) { if (is_hosting_viz) {
// TODO: http://crbug.com/701468 fix function key preferences and sticky // TODO: http://crbug.com/701468 fix function key preferences and sticky
// keys. // keys.
ui::EventRewriterChromeOS::Delegate* delegate = nullptr; ui::EventRewriterChromeOS::Delegate* delegate = nullptr;
......
...@@ -34,7 +34,7 @@ class WindowServer; ...@@ -34,7 +34,7 @@ class WindowServer;
// those that do. // those that do.
class DisplayManager : public display::ScreenManagerDelegate { class DisplayManager : public display::ScreenManagerDelegate {
public: public:
explicit DisplayManager(WindowServer* window_server); DisplayManager(WindowServer* window_server, bool is_hosting_viz);
~DisplayManager() override; ~DisplayManager() override;
// Called once WindowServer::display_creation_config() has been determined. // Called once WindowServer::display_creation_config() has been determined.
......
...@@ -135,7 +135,7 @@ struct WindowServer::CurrentDragLoopState { ...@@ -135,7 +135,7 @@ struct WindowServer::CurrentDragLoopState {
WindowServer::WindowServer(WindowServerDelegate* delegate, bool should_host_viz) WindowServer::WindowServer(WindowServerDelegate* delegate, bool should_host_viz)
: delegate_(delegate), : delegate_(delegate),
next_client_id_(kWindowServerClientId + 1), next_client_id_(kWindowServerClientId + 1),
display_manager_(std::make_unique<DisplayManager>(this)), display_manager_(std::make_unique<DisplayManager>(this, should_host_viz)),
current_operation_(nullptr), current_operation_(nullptr),
in_destructor_(false), in_destructor_(false),
next_wm_change_id_(0), next_wm_change_id_(0),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment