| Index: mojo/services/view_manager/view_manager_init_service_impl.cc
|
| diff --git a/mojo/services/view_manager/view_manager_init_service_impl.cc b/mojo/services/view_manager/view_manager_init_service_impl.cc
|
| index 0a1c0249fd6fad35c2f31e7d7b40baec2d59cbee..44e521a16dd0cbad9e0b799d800969c2e241cc1f 100644
|
| --- a/mojo/services/view_manager/view_manager_init_service_impl.cc
|
| +++ b/mojo/services/view_manager/view_manager_init_service_impl.cc
|
| @@ -31,32 +31,32 @@ ViewManagerInitServiceImpl::ViewManagerInitServiceImpl(
|
| ViewManagerInitServiceImpl::~ViewManagerInitServiceImpl() {
|
| }
|
|
|
| -void ViewManagerInitServiceImpl::MaybeEmbedRoot(
|
| - const std::string& url,
|
| - const Callback<void(bool)>& callback) {
|
| +void ViewManagerInitServiceImpl::MaybeEmbedRoot() {
|
| if (!is_tree_host_ready_)
|
| return;
|
|
|
| - root_node_manager_.EmbedRoot(url);
|
| - callback.Run(true);
|
| + ScopedVector<ConnectParams>::const_iterator it = connect_params_.begin();
|
| + for (; it != connect_params_.end(); ++it) {
|
| + root_node_manager_.EmbedRoot((*it)->url);
|
| + (*it)->callback.Run(true);
|
| + }
|
| + connect_params_.clear();
|
| }
|
|
|
| void ViewManagerInitServiceImpl::EmbedRoot(
|
| const String& url,
|
| const Callback<void(bool)>& callback) {
|
| - // TODO(beng): This means you can only have one EmbedRoot in flight at a time.
|
| - // Keep a vector of these around instead.
|
| - connect_params_.reset(new ConnectParams);
|
| - connect_params_->url = url.To<std::string>();
|
| - connect_params_->callback = callback;
|
| - MaybeEmbedRoot(url.To<std::string>(), callback);
|
| + ConnectParams* params = new ConnectParams;
|
| + params->url = url.To<std::string>();
|
| + params->callback = callback;
|
| + connect_params_.push_back(params);
|
| + MaybeEmbedRoot();
|
| }
|
|
|
| void ViewManagerInitServiceImpl::OnRootViewManagerWindowTreeHostCreated() {
|
| DCHECK(!is_tree_host_ready_);
|
| is_tree_host_ready_ = true;
|
| - if (connect_params_)
|
| - MaybeEmbedRoot(connect_params_->url, connect_params_->callback);
|
| + MaybeEmbedRoot();
|
| }
|
|
|
| void ViewManagerInitServiceImpl::OnNativeViewportDeleted() {
|
|
|