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

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

Issue 2497303002: Fix ws::Display initialization order. (Closed)
Patch Set: Fix use after move in test. Created 4 years, 1 month 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 | « no previous file | services/ui/ws/display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/display.h
diff --git a/services/ui/ws/display.h b/services/ui/ws/display.h
index 901a5b1e962d484ef52722b7aa8bdfc3e8c62691..19abdc9ab6c37f18ba4f75d3c70bf47d39bad005 100644
--- a/services/ui/ws/display.h
+++ b/services/ui/ws/display.h
@@ -58,12 +58,13 @@ class Display : public PlatformDisplayDelegate,
public UserIdTrackerObserver,
public WindowManagerWindowTreeFactorySetObserver {
public:
- Display(WindowServer* window_server,
- const PlatformDisplayInitParams& platform_display_init_params);
+ explicit Display(WindowServer* window_server);
~Display() override;
- // Initializes state that depends on the existence of a Display.
- void Init(std::unique_ptr<DisplayBinding> binding);
+ // Initializes the display root ServerWindow and PlatformDisplay. Adds this to
+ // DisplayManager as a pending display, until accelerated widget is available.
+ void Init(const PlatformDisplayInitParams& init_params,
+ std::unique_ptr<DisplayBinding> binding);
int64_t GetId() const;
@@ -75,6 +76,7 @@ class Display : public PlatformDisplayDelegate,
// Returns a display::Display corresponding to this ws::Display.
display::Display ToDisplay() const;
+ // Returns the size of the display in physical pixels.
gfx::Size GetSize() const;
WindowServer* window_server() { return window_server_; }
@@ -147,7 +149,7 @@ class Display : public PlatformDisplayDelegate,
std::map<UserId, WindowManagerDisplayRoot*>;
// Inits the necessary state once the display is ready.
- void InitWindowManagerDisplayRootsIfNecessary();
+ void InitWindowManagerDisplayRoots();
// Creates the set of WindowManagerDisplayRoots from the
// WindowManagerWindowTreeFactorySet.
@@ -162,6 +164,7 @@ class Display : public PlatformDisplayDelegate,
// PlatformDisplayDelegate:
ServerWindow* GetRootWindow() override;
+ void OnAcceleratedWidgetAvailable() override;
bool IsInHighContrastMode() override;
void OnEvent(const ui::Event& event) override;
void OnNativeCaptureLost() override;
@@ -184,8 +187,6 @@ class Display : public PlatformDisplayDelegate,
WindowManagerWindowTreeFactory* factory) override;
std::unique_ptr<DisplayBinding> binding_;
- // Set once Init() has been called.
- bool init_called_ = false;
WindowServer* const window_server_;
std::unique_ptr<ServerWindow> root_;
std::unique_ptr<PlatformDisplay> platform_display_;
« no previous file with comments | « no previous file | services/ui/ws/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698