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

Unified Diff: ash/display/display_layout_builder.cc

Issue 1819533002: Convert ScopedVector<DisplayPlacement> to std::vector<DisplayPlacement> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@jsonrefactor
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 | « ash/display/display_layout.cc ('k') | ash/display/display_layout_builder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_layout_builder.cc
diff --git a/ash/display/display_layout_builder.cc b/ash/display/display_layout_builder.cc
index 6a1919dfa579e3bbf61005bc9138b82047473d8f..579337fd774e4566364aeb4060e8baea7eb7e598 100644
--- a/ash/display/display_layout_builder.cc
+++ b/ash/display/display_layout_builder.cc
@@ -4,6 +4,8 @@
#include "ash/display/display_layout_builder.h"
+#include <algorithm>
+
namespace ash {
DisplayLayoutBuilder::DisplayLayoutBuilder(const DisplayLayout& layout)
@@ -37,12 +39,12 @@ DisplayLayoutBuilder& DisplayLayoutBuilder::AddDisplayPlacement(
int64_t parent_display_id,
DisplayPlacement::Position position,
int offset) {
- scoped_ptr<DisplayPlacement> placement(new DisplayPlacement);
- placement->position = position;
- placement->offset = offset;
- placement->display_id = display_id;
- placement->parent_display_id = parent_display_id;
- layout_->placement_list.push_back(std::move(placement));
+ DisplayPlacement placement;
+ placement.position = position;
+ placement.offset = offset;
+ placement.display_id = display_id;
+ placement.parent_display_id = parent_display_id;
+ layout_->placement_list.push_back(placement);
return *this;
}
@@ -57,8 +59,8 @@ DisplayLayoutBuilder& DisplayLayoutBuilder::SetSecondaryPlacement(
scoped_ptr<DisplayLayout> DisplayLayoutBuilder::Build() {
std::sort(layout_->placement_list.begin(), layout_->placement_list.end(),
- [](const DisplayPlacement* a, const DisplayPlacement* b) {
- return a->display_id < b->display_id;
+ [](const DisplayPlacement& a, const DisplayPlacement& b) {
+ return a.display_id < b.display_id;
});
return std::move(layout_);
}
« no previous file with comments | « ash/display/display_layout.cc ('k') | ash/display/display_layout_builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698