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

Issue 14367021: Rename ClampToMin and ClampToMax (Closed)

Created:
7 years, 8 months ago by Ian Vollick
Modified:
7 years, 6 months ago
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, jonathan.backer, tfarina, piman+watch_chromium.org, cc-bugs_chromium.org
Visibility:
Public.

Description

Rename ClampToMin and ClampToMax I find these function names confusing. I have to stop and read the code each time I try to use them to figure out what they're going to do. Part of the confusion is that ClampToMin sets the components to the _maximum_ of the two sizes/vectors. It's also not clear from the function name which of the two objects is acting as the 'Min'. This is mitigated by the parameter names and local variables passed to the function, but it would be nice if the name of the function itself made this clear. a.ClampToLowerBound(b) makes it clear both that b is acting as the lower bound and how and when a is going to be altered. Other names I've considered (for ClampToMin -- the suggestions for ClampToMax are analagous): ClampIfSmallerThan(other) SetComponentsToMax(other) Union(other) (for sizes) R=danakj,sky BUG=None Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203017

Patch Set 1 : . #

Total comments: 1

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -134 lines) Patch
M cc/input/page_scale_animation.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cc/layers/picture_layer_impl.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M cc/layers/scrollbar_layer.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/tiled_layer.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/app_list/app_list_service_mac.mm View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/app_list/app_list_controller_win.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/find_bar_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/location_bar/ev_bubble_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M ui/compositor/layer.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ui/gfx/point_base.h View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M ui/gfx/point_unittest.cc View 1 2 chunks +18 lines, -18 lines 0 comments Download
M ui/gfx/size_base.h View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M ui/gfx/size_unittest.cc View 1 2 chunks +18 lines, -18 lines 0 comments Download
M ui/gfx/vector2d.h View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M ui/gfx/vector2d_f.h View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M ui/gfx/vector2d_unittest.cc View 1 2 chunks +18 lines, -18 lines 0 comments Download
M ui/gfx/vector3d_f.h View 1 2 1 chunk +8 lines, -8 lines 0 comments Download
M ui/gfx/vector3d_unittest.cc View 1 1 chunk +12 lines, -12 lines 0 comments Download
M ui/message_center/views/message_center_view.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M ui/message_center/views/notifier_settings_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/bubble/bubble_border.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M ui/views/bubble/bubble_frame_view.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M ui/views/controls/button/label_button.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/controls/scrollbar/kennedy_scroll_bar.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/tabbed_pane/tabbed_pane.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/examples/progress_bar_example.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Ian Vollick
7 years, 8 months ago (2013-04-19 14:53:32 UTC) #1
danakj
I like the names. LGTM if it does to sky@.
7 years, 8 months ago (2013-04-19 15:59:40 UTC) #2
sky
https://codereview.chromium.org/14367021/diff/2001/ui/gfx/point_base.h File ui/gfx/point_base.h (right): https://codereview.chromium.org/14367021/diff/2001/ui/gfx/point_base.h#newcode46 ui/gfx/point_base.h:46: void ClampToUpperBound(const Class& max) { I agree the names ...
7 years, 8 months ago (2013-04-22 16:44:18 UTC) #3
danakj
Do you still plan to go ahead with this Cl or should we close it?
7 years, 7 months ago (2013-05-25 13:26:25 UTC) #4
Ian Vollick
On 2013/05/25 13:26:25, danakj wrote: > Do you still plan to go ahead with this ...
7 years, 6 months ago (2013-05-27 13:54:02 UTC) #5
sky
LGTM
7 years, 6 months ago (2013-05-28 14:30:32 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vollick@chromium.org/14367021/12001
7 years, 6 months ago (2013-05-28 15:02:45 UTC) #7
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-05-28 15:25:03 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vollick@chromium.org/14367021/33001
7 years, 6 months ago (2013-05-28 18:25:31 UTC) #9
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=5276
7 years, 6 months ago (2013-05-28 18:46:32 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vollick@chromium.org/14367021/33001
7 years, 6 months ago (2013-05-29 01:12:02 UTC) #11
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-05-29 01:38:45 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vollick@chromium.org/14367021/52001
7 years, 6 months ago (2013-05-29 20:23:22 UTC) #13
commit-bot: I haz the power
7 years, 6 months ago (2013-05-30 00:18:01 UTC) #14
Message was sent while issue was closed.
Change committed as 203017

Powered by Google App Engine
This is Rietveld 408576698