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

Unified Diff: components/mus/ws/window_server.cc

Issue 1906623003: Convert //components/mus from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « components/mus/ws/window_server.h ('k') | components/mus/ws/window_server_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_server.cc
diff --git a/components/mus/ws/window_server.cc b/components/mus/ws/window_server.cc
index 3fff3c2de209adafebdf840583705782007657b3..bcdbff9132007111cbae1e6f20b42c0727b48763 100644
--- a/components/mus/ws/window_server.cc
+++ b/components/mus/ws/window_server.cc
@@ -5,6 +5,7 @@
#include "components/mus/ws/window_server.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "components/mus/ws/display.h"
#include "components/mus/ws/display_binding.h"
@@ -71,16 +72,17 @@ WindowTree* WindowServer::EmbedAtWindow(
ServerWindow* root,
const UserId& user_id,
mojom::WindowTreeClientPtr client,
- scoped_ptr<AccessPolicy> access_policy) {
- scoped_ptr<WindowTree> tree_ptr(
+ std::unique_ptr<AccessPolicy> access_policy) {
+ std::unique_ptr<WindowTree> tree_ptr(
new WindowTree(this, user_id, root, std::move(access_policy)));
WindowTree* tree = tree_ptr.get();
mojom::WindowTreePtr window_tree_ptr;
mojom::WindowTreeRequest window_tree_request = GetProxy(&window_tree_ptr);
- scoped_ptr<WindowTreeBinding> binding = delegate_->CreateWindowTreeBinding(
- WindowServerDelegate::BindingType::EMBED, this, tree,
- &window_tree_request, &client);
+ std::unique_ptr<WindowTreeBinding> binding =
+ delegate_->CreateWindowTreeBinding(
+ WindowServerDelegate::BindingType::EMBED, this, tree,
+ &window_tree_request, &client);
if (!binding) {
binding.reset(new ws::DefaultWindowTreeBinding(
tree, this, std::move(window_tree_request), std::move(client)));
@@ -91,8 +93,8 @@ WindowTree* WindowServer::EmbedAtWindow(
return tree;
}
-WindowTree* WindowServer::AddTree(scoped_ptr<WindowTree> tree_impl_ptr,
- scoped_ptr<WindowTreeBinding> binding,
+WindowTree* WindowServer::AddTree(std::unique_ptr<WindowTree> tree_impl_ptr,
+ std::unique_ptr<WindowTreeBinding> binding,
mojom::WindowTreePtr tree_ptr) {
CHECK_EQ(0u, tree_map_.count(tree_impl_ptr->id()));
WindowTree* tree = tree_impl_ptr.get();
@@ -109,14 +111,15 @@ WindowTree* WindowServer::CreateTreeForWindowManager(
mojom::DisplayPtr display_ptr = display->ToMojomDisplay();
mojom::WindowTreeClientPtr tree_client;
factory->CreateWindowManager(std::move(display_ptr), GetProxy(&tree_client));
- scoped_ptr<WindowTree> tree_ptr(new WindowTree(
- this, user_id, root, make_scoped_ptr(new WindowManagerAccessPolicy)));
+ std::unique_ptr<WindowTree> tree_ptr(new WindowTree(
+ this, user_id, root, base::WrapUnique(new WindowManagerAccessPolicy)));
WindowTree* tree = tree_ptr.get();
mojom::WindowTreePtr window_tree_ptr;
mojom::WindowTreeRequest tree_request;
- scoped_ptr<WindowTreeBinding> binding = delegate_->CreateWindowTreeBinding(
- WindowServerDelegate::BindingType::WINDOW_MANAGER, this, tree,
- &tree_request, &tree_client);
+ std::unique_ptr<WindowTreeBinding> binding =
+ delegate_->CreateWindowTreeBinding(
+ WindowServerDelegate::BindingType::WINDOW_MANAGER, this, tree,
+ &tree_request, &tree_client);
if (!binding) {
DefaultWindowTreeBinding* default_binding = new DefaultWindowTreeBinding(
tree_ptr.get(), this, std::move(tree_client));
@@ -129,7 +132,7 @@ WindowTree* WindowServer::CreateTreeForWindowManager(
}
void WindowServer::DestroyTree(WindowTree* tree) {
- scoped_ptr<WindowTree> tree_ptr;
+ std::unique_ptr<WindowTree> tree_ptr;
{
auto iter = tree_map_.find(tree->id());
DCHECK(iter != tree_map_.end());
« no previous file with comments | « components/mus/ws/window_server.h ('k') | components/mus/ws/window_server_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698