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

Unified Diff: ui/views/mus/screen_mus.cc

Issue 1793793002: Remove ShellConnection::WaitForInitialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « ui/views/mus/screen_mus.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/screen_mus.cc
diff --git a/ui/views/mus/screen_mus.cc b/ui/views/mus/screen_mus.cc
index 7c763e7c22d13bc0a4f48b0ad76101acdd2fbc9e..ede6d9570a2346aa5755d7a572453ec293b18cd2 100644
--- a/ui/views/mus/screen_mus.cc
+++ b/ui/views/mus/screen_mus.cc
@@ -4,7 +4,6 @@
#include "ui/views/mus/screen_mus.h"
-// #include "components/mus/public/interfaces/window_manager_constants.mojom.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/shell/public/cpp/connection.h"
#include "mojo/shell/public/cpp/connector.h"
@@ -82,8 +81,10 @@ void ScreenMus::Init(mojo::Connector* connector) {
display_manager_->AddObserver(
display_manager_observer_binding_.CreateInterfacePtrAndBind());
+
// We need the set of displays before we can continue. Wait for it.
- display_manager_observer_binding_.WaitForIncomingMethodCall();
+ wait_for_displays_loop_.reset(new base::RunLoop);
+ wait_for_displays_loop_->Run();
// The WaitForIncomingMethodCall() should have supplied the set of Displays.
DCHECK(displays_.size());
@@ -203,6 +204,9 @@ void ScreenMus::OnDisplays(mojo::Array<mus::mojom::DisplayPtr> displays) {
WindowManagerFrameValues::SetInstance(frame_values);
}
}
+
+ DCHECK(wait_for_displays_loop_);
+ wait_for_displays_loop_->Quit();
}
void ScreenMus::OnDisplaysChanged(
« no previous file with comments | « ui/views/mus/screen_mus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698