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

Issue 2814843007: Fix expected PlacementList sort order. (Closed)

Created:
3 years, 8 months ago by afakhry
Modified:
3 years, 4 months ago
Reviewers:
Nico, oshima
CC:
chromium-reviews, oshima+watch_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix expected PlacementList sort order. We sort the displays IDs list by the least significant 8 bits of the IDs. This list is used to fill in the placement list, however, DisplayLayout::Validate() expects the list to be sorted using the full display IDs. This resulted in false positives where we skip applying valid layouts. We also should never persist an invalid layout. BUG=700020 TEST=manually, +test. Review-Url: https://codereview.chromium.org/2814843007 Cr-Commit-Position: refs/heads/master@{#464654} Committed: https://chromium.googlesource.com/chromium/src/+/d3d4ea43bd26fafa27ae723b7db6ada167034248

Patch Set 1 #

Total comments: 1

Patch Set 2 : Don't register invalid layouts #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -34 lines) Patch
M chrome/browser/chromeos/display/display_preferences.cc View 1 2 chunks +10 lines, -0 lines 0 comments Download
M ui/display/display.h View 1 chunk +5 lines, -0 lines 0 comments Download
M ui/display/display.cc View 1 chunk +11 lines, -0 lines 1 comment Download
M ui/display/display_layout.cc View 2 chunks +7 lines, -5 lines 0 comments Download
M ui/display/display_layout_builder.cc View 2 chunks +3 lines, -1 line 0 comments Download
M ui/display/display_layout_unittest.cc View 2 chunks +36 lines, -9 lines 0 comments Download
M ui/display/manager/display_layout_store.cc View 1 1 chunk +11 lines, -3 lines 0 comments Download
M ui/display/manager/display_manager_utilities.h View 1 chunk +0 lines, -5 lines 0 comments Download
M ui/display/manager/display_manager_utilities.cc View 1 chunk +0 lines, -11 lines 0 comments Download

Messages

Total messages: 26 (20 generated)
afakhry
Oshima-san, please take a look at this change. Thanks! https://codereview.chromium.org/2814843007/diff/20001/ui/display/display.h File ui/display/display.h (right): https://codereview.chromium.org/2814843007/diff/20001/ui/display/display.h#newcode26 ui/display/display.h:26: ...
3 years, 8 months ago (2017-04-13 00:49:04 UTC) #9
afakhry
Oshima-san, as agreed, we don't allow to register invalid layouts, but revert to a default ...
3 years, 8 months ago (2017-04-14 00:59:17 UTC) #17
oshima
lgtm
3 years, 8 months ago (2017-04-14 01:19:41 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2814843007/60001
3 years, 8 months ago (2017-04-14 01:27:07 UTC) #21
commit-bot: I haz the power
Committed patchset #2 (id:60001) as https://chromium.googlesource.com/chromium/src/+/d3d4ea43bd26fafa27ae723b7db6ada167034248
3 years, 8 months ago (2017-04-14 02:03:14 UTC) #24
Nico
3 years, 4 months ago (2017-07-28 21:09:58 UTC) #26
Message was sent while issue was closed.
https://codereview.chromium.org/2814843007/diff/60001/ui/display/display.cc
File ui/display/display.cc (right):

https://codereview.chromium.org/2814843007/diff/60001/ui/display/display.cc#n...
ui/display/display.cc:63: DCHECK_NE(id1, id2);
This DCHECK is not correct. You're passing this to std::sort() which can call
this with the same element for lhs and rhs
(https://stackoverflow.com/questions/38966516/should-sorting-algorithm-pass-sa...).
We're trying to move cros builds to libc++
(https://chromium-review.googlesource.com/c/591775/) and one test fails due to
this incorrect DCHECK. I suppose this should be

  if (id1 == id2) return false;

instead?

Powered by Google App Engine
This is Rietveld 408576698