Commit c36b54a4 authored by sadrul's avatar sadrul Committed by Commit bot

ash/mus: Store the InterfaceRequest<>s directly in the vector.

Instead of wrapping the InterfaceRequest<>s in a unique_ptr<> and storing
that in a vector, just store the requests directly.

BUG=none

Review-Url: https://codereview.chromium.org/2107383003
Cr-Commit-Position: refs/heads/master@{#403277}
parent 0466de34
......@@ -90,8 +90,7 @@ void WindowManagerApplication::Create(
if (!window_manager_->GetRootWindowControllers().empty()) {
shelf_layout_bindings_.AddBinding(shelf_layout_.get(), std::move(request));
} else {
shelf_layout_requests_.push_back(base::WrapUnique(
new mojo::InterfaceRequest<mojom::ShelfLayout>(std::move(request))));
shelf_layout_requests_.push_back(std::move(request));
}
}
......@@ -102,9 +101,7 @@ void WindowManagerApplication::Create(
user_window_controller_bindings_.AddBinding(user_window_controller_.get(),
std::move(request));
} else {
user_window_controller_requests_.push_back(base::WrapUnique(
new mojo::InterfaceRequest<mojom::UserWindowController>(
std::move(request))));
user_window_controller_requests_.push_back(std::move(request));
}
}
......@@ -149,13 +146,13 @@ void WindowManagerApplication::OnRootWindowControllerAdded(
user_window_controller_->Initialize(controller);
for (auto& request : user_window_controller_requests_)
user_window_controller_bindings_.AddBinding(user_window_controller_.get(),
std::move(*request));
std::move(request));
user_window_controller_requests_.clear();
// TODO(msw): figure out if this should be per display, or global.
shelf_layout_->Initialize(controller);
for (auto& request : shelf_layout_requests_)
shelf_layout_bindings_.AddBinding(shelf_layout_.get(), std::move(*request));
shelf_layout_bindings_.AddBinding(shelf_layout_.get(), std::move(request));
shelf_layout_requests_.clear();
}
......
......@@ -106,7 +106,7 @@ class WindowManagerApplication
// time |shelf_layout_requests_| stores pending interface requests.
std::unique_ptr<ShelfLayoutImpl> shelf_layout_;
mojo::BindingSet<mojom::ShelfLayout> shelf_layout_bindings_;
std::vector<std::unique_ptr<mojo::InterfaceRequest<mojom::ShelfLayout>>>
std::vector<mojo::InterfaceRequest<mojom::ShelfLayout>>
shelf_layout_requests_;
// |user_window_controller_| is created once OnEmbed() is called. Until that
......@@ -114,8 +114,7 @@ class WindowManagerApplication
std::unique_ptr<UserWindowControllerImpl> user_window_controller_;
mojo::BindingSet<mojom::UserWindowController>
user_window_controller_bindings_;
std::vector<
std::unique_ptr<mojo::InterfaceRequest<mojom::UserWindowController>>>
std::vector<mojo::InterfaceRequest<mojom::UserWindowController>>
user_window_controller_requests_;
std::unique_ptr<WindowManager> window_manager_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment