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

Unified Diff: components/mus/public/cpp/lib/view_tree_client_impl.cc

Issue 1390353007: Adds MUSViewsInit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix windows Created 5 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: components/mus/public/cpp/lib/view_tree_client_impl.cc
diff --git a/components/mus/public/cpp/lib/view_tree_client_impl.cc b/components/mus/public/cpp/lib/view_tree_client_impl.cc
index 2a8516c29d6e0571ed860c0a1d2ba26459400717..bd2a8ebbd3572814370db9641ffe151a29db29c6 100644
--- a/components/mus/public/cpp/lib/view_tree_client_impl.cc
+++ b/components/mus/public/cpp/lib/view_tree_client_impl.cc
@@ -70,8 +70,12 @@ View* BuildViewTree(ViewTreeClientImpl* client,
ViewTreeConnection* ViewTreeConnection::Create(
ViewTreeDelegate* delegate,
- mojo::InterfaceRequest<mojo::ViewTreeClient> request) {
- return new ViewTreeClientImpl(delegate, request.Pass());
+ mojo::InterfaceRequest<mojo::ViewTreeClient> request,
+ CreateType create_type) {
+ ViewTreeClientImpl* client = new ViewTreeClientImpl(delegate, request.Pass());
+ if (create_type == CreateType::WAIT_FOR_EMBED)
+ client->WaitForEmbed();
+ return client;
}
ViewTreeClientImpl::ViewTreeClientImpl(
@@ -112,6 +116,13 @@ ViewTreeClientImpl::~ViewTreeClientImpl() {
delegate_->OnConnectionLost(this);
}
+void ViewTreeClientImpl::WaitForEmbed() {
+ DCHECK(!root_);
+ // OnEmbed() is the first function called.
+ binding_.WaitForIncomingMethodCall();
+ // TODO(sky): deal with pipe being closed before we get OnEmbed().
+}
+
void ViewTreeClientImpl::DestroyView(Id view_id) {
DCHECK(tree_);
tree_->DeleteView(view_id, ActionCompletedCallback());
« no previous file with comments | « components/mus/public/cpp/lib/view_tree_client_impl.h ('k') | components/mus/public/cpp/lib/view_tree_host_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698