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

Issue 11410024: ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always. (Closed)

Created:
8 years, 1 month ago by danakj
Modified:
7 years, 11 months ago
Reviewers:
jeremya, Nico, sadrul, sky
CC:
chromium-reviews, cc-bugs_chromium.org, backer, piman
Visibility:
Public.

Description

ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always. This was added with the intention of using Size as a vector, replacing use of IntSize. Since we have Vector2d now, negative sizes should not exist, so clamp them in set_width/set_height and the constructor. Not covered by tests, as we can't test DCHECKs. TBR=sky BUG=160158 Relanding: https://codereview.chromium.org/11365160/ Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=167255 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175535

Patch Set 1 #

Patch Set 2 : fix dchecks in gesture code #

Patch Set 3 : no negative sizes #

Total comments: 4

Patch Set 4 : point_count=0 #

Patch Set 5 : emptybox #

Patch Set 6 : dcheck on nan #

Patch Set 7 : missedaheight #

Patch Set 8 : no-nan-dcheck #

Patch Set 9 : Rebase #

Patch Set 10 : negative-width #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -54 lines) Patch
M ash/system/user/tray_user.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -2 lines 0 comments Download
M cc/draw_quad_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/extensions/shell_window.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/extensions/shell_window.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -3 lines 0 comments Download
M ui/base/gestures/gesture_sequence.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M ui/gfx/rect_f.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -4 lines 0 comments Download
M ui/gfx/rect_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -4 lines 0 comments Download
M ui/gfx/size.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -5 lines 0 comments Download
M ui/gfx/size_base.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -13 lines 0 comments Download
A ui/gfx/size_base_impl.h View 6 7 1 chunk +37 lines, -0 lines 0 comments Download
M ui/gfx/size_f.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/size_unittest.cc View 3 chunks +0 lines, -18 lines 0 comments Download
M ui/ui.gyp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
danakj
Apparently there's already some aura unit tests that create negative sizes. ash_unittests: [ RUN ] ...
8 years, 1 month ago (2012-11-10 06:23:09 UTC) #1
danakj
@sadrul can you please review ui/base/gestures/gesture_sequence.cc
8 years, 1 month ago (2012-11-11 20:03:56 UTC) #2
danakj
@jeremya can you please review the chrome/browser changes?
8 years, 1 month ago (2012-11-11 23:35:49 UTC) #3
jeremya
lgtm :)
8 years, 1 month ago (2012-11-11 23:40:09 UTC) #4
danakj
8 years, 1 month ago (2012-11-12 01:25:33 UTC) #5
sadrul
http://codereview.chromium.org/11410024/diff/9001/ui/base/gestures/gesture_sequence.cc File ui/base/gestures/gesture_sequence.cc (right): http://codereview.chromium.org/11410024/diff/9001/ui/base/gestures/gesture_sequence.cc#newcode588 ui/base/gestures/gesture_sequence.cc:588: } else { You can set bounding_box_ to empty ...
8 years, 1 month ago (2012-11-12 01:28:01 UTC) #6
sky
https://codereview.chromium.org/11410024/diff/9001/ui/gfx/size_base_impl.h File ui/gfx/size_base_impl.h (right): https://codereview.chromium.org/11410024/diff/9001/ui/gfx/size_base_impl.h#newcode19 ui/gfx/size_base_impl.h:19: DCHECK(!(width < 0)); DCHECK_GE for all of these.
8 years, 1 month ago (2012-11-12 04:21:46 UTC) #7
danakj
PTAL sadrul, thanks. http://codereview.chromium.org/11410024/diff/9001/ui/base/gestures/gesture_sequence.cc File ui/base/gestures/gesture_sequence.cc (right): http://codereview.chromium.org/11410024/diff/9001/ui/base/gestures/gesture_sequence.cc#newcode588 ui/base/gestures/gesture_sequence.cc:588: } else { On 2012/11/12 01:28:02, ...
8 years, 1 month ago (2012-11-12 05:45:56 UTC) #8
danakj
https://codereview.chromium.org/11410024/diff/9001/ui/gfx/size_base_impl.h File ui/gfx/size_base_impl.h (right): https://codereview.chromium.org/11410024/diff/9001/ui/gfx/size_base_impl.h#newcode19 ui/gfx/size_base_impl.h:19: DCHECK(!(width < 0)); On 2012/11/12 04:21:46, sky wrote: > ...
8 years, 1 month ago (2012-11-12 05:52:57 UTC) #9
sadrul
gestures LGTM
8 years, 1 month ago (2012-11-12 06:03:20 UTC) #10
danakj
OK I discussed with vollick, and we're reasonably certain NaN shouldn't really happen in practice, ...
8 years, 1 month ago (2012-11-12 16:53:05 UTC) #11
danakj
And, it turns out there is a unit test in cc/ that verifies hit testing ...
8 years, 1 month ago (2012-11-12 17:49:06 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11410024/7002
8 years, 1 month ago (2012-11-12 17:50:27 UTC) #13
commit-bot: I haz the power
Retried try job too often for step(s) browser_tests
8 years, 1 month ago (2012-11-12 20:27:27 UTC) #14
danakj
I'm going to land this thing again, and we'll see what new fallout has occured ...
7 years, 11 months ago (2013-01-07 23:28:25 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11410024/16027
7 years, 11 months ago (2013-01-08 01:04:53 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11410024/16027
7 years, 11 months ago (2013-01-08 16:01:07 UTC) #17
commit-bot: I haz the power
Change committed as 175535
7 years, 11 months ago (2013-01-08 16:02:08 UTC) #18
Nico
This CL added 25kB of binary size: http://build.chromium.org/f/chromium/perf/linux-release-64/sizes/report.html?history=150&rev=-1 Is this expected for a CL that's ...
7 years, 11 months ago (2013-01-20 01:10:20 UTC) #19
danakj
On 2013/01/20 01:10:20, Nico wrote: > This CL added 25kB of binary size: > http://build.chromium.org/f/chromium/perf/linux-release-64/sizes/report.html?history=150&rev=-1 ...
7 years, 11 months ago (2013-01-20 01:58:25 UTC) #20
Nico
I don't think so.
7 years, 11 months ago (2013-01-20 03:33:36 UTC) #21
danakj
sky@ or piman@ any ideas? I don't really understand how it could happen. On Sat, ...
7 years, 11 months ago (2013-01-20 03:44:28 UTC) #22
piman
On Sat, Jan 19, 2013 at 5:58 PM, <danakj@chromium.org> wrote: > On 2013/01/20 01:10:20, Nico ...
7 years, 11 months ago (2013-01-20 06:14:51 UTC) #23
danakj
On 2013/01/20 06:14:51, piman wrote: > I suspect the DCHECKs in set_width/set_height (being templates, I ...
7 years, 11 months ago (2013-01-20 17:55:40 UTC) #24
sky
Maybe back it all out and land in small chunks to see which one caused ...
7 years, 11 months ago (2013-01-22 16:50:04 UTC) #25
danakj
7 years, 11 months ago (2013-01-22 17:39:51 UTC) #26
Ya, I guess so. Will do.

On Tue, Jan 22, 2013 at 11:50 AM, <sky@chromium.org> wrote:

> Maybe back it all out and land in small chunks to see which one caused the
> increase?
>
>
https://chromiumcodereview.**appspot.com/11410024/<https://chromiumcodereview...
>

Powered by Google App Engine
This is Rietveld 408576698