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

Unified Diff: services/ui/ws/display.cc

Issue 2684623002: [WIP] Move ownership of PlatformDisplay from ws::Display to ws::WindowServer (Closed)
Patch Set: 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 | « services/ui/ws/display.h ('k') | services/ui/ws/window_server.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/display.cc
diff --git a/services/ui/ws/display.cc b/services/ui/ws/display.cc
index 68e8657c2bf4f484cbd97736792965bf2f3bbdc3..fdf2ddb63766a636d79684d26678063839f8bb13 100644
--- a/services/ui/ws/display.cc
+++ b/services/ui/ws/display.cc
@@ -58,6 +58,9 @@ Display::~Display() {
->second->window_manager_state()
->window_tree());
}
+
+ if (platform_display_)
+ window_server_->RemovePlatformDisplay(platform_display_);
}
void Display::Init(const PlatformDisplayInitParams& init_params,
@@ -69,8 +72,11 @@ void Display::Init(const PlatformDisplayInitParams& init_params,
PlatformDisplayInitParams params_copy = init_params;
params_copy.root_window = root_.get();
- platform_display_ = PlatformDisplay::Create(params_copy);
+ std::unique_ptr<PlatformDisplay> platform_display =
+ PlatformDisplay::Create(params_copy);
+ platform_display_ = platform_display.get();
platform_display_->Init(this);
+ window_server_->AddPlatformDisplay(std::move(platform_display));
}
int64_t Display::GetId() const {
« no previous file with comments | « services/ui/ws/display.h ('k') | services/ui/ws/window_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698