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

Issue 22875045: cc: Remove unnecessary "default" cases from switch statements. (Closed)

Created:
7 years, 4 months ago by reveman
Modified:
7 years, 3 months ago
Reviewers:
danakj, vmpstr, enne (OOO)
CC:
chromium-reviews, cc-bugs_chromium.org
Visibility:
Public.

Description

cc: Remove unnecessary "default" cases from switch statements. Makes all cc/ code consistent and improves compile time error checking when adding new enums. TEST=compile,cc_unittests BUG=277861 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=219691

Patch Set 1 #

Total comments: 5

Patch Set 2 : remove changes to enums that require arraysize #

Total comments: 18

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Patch Set 5 : fix HasFilterThatMovesPixels()/HasFilterThatAffectsOpacity() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -45 lines) Patch
M cc/animation/transform_operation.cc View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M cc/layers/picture_layer_impl.cc View 1 4 chunks +7 lines, -5 lines 0 comments Download
M cc/output/filter_operation.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M cc/output/filter_operations.cc View 3 4 2 chunks +25 lines, -4 lines 0 comments Download
M cc/output/render_surface_filters.cc View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M cc/resources/managed_tile_state.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/resources/managed_tile_state.cc View 1 1 chunk +2 lines, -3 lines 0 comments Download
M cc/resources/platform_color.h View 1 2 2 chunks +8 lines, -12 lines 0 comments Download
M cc/resources/raster_mode.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M cc/resources/tile_priority.cc View 1 2 chunks +6 lines, -8 lines 0 comments Download
M cc/trees/layer_tree_host.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 28 (0 generated)
reveman
https://codereview.chromium.org/22875045/diff/1/cc/output/filter_operations.cc File cc/output/filter_operations.cc (right): https://codereview.chromium.org/22875045/diff/1/cc/output/filter_operations.cc#newcode121 cc/output/filter_operations.cc:121: return true; I changed the logic here as it ...
7 years, 4 months ago (2013-08-22 23:14:45 UTC) #1
vmpstr
The comment below applies to other enums as well https://codereview.chromium.org/22875045/diff/1/cc/resources/managed_tile_state.cc File cc/resources/managed_tile_state.cc (right): https://codereview.chromium.org/22875045/diff/1/cc/resources/managed_tile_state.cc#newcode42 cc/resources/managed_tile_state.cc:42: ...
7 years, 4 months ago (2013-08-22 23:33:34 UTC) #2
danakj
https://codereview.chromium.org/22875045/diff/1/cc/resources/managed_tile_state.h File cc/resources/managed_tile_state.h (right): https://codereview.chromium.org/22875045/diff/1/cc/resources/managed_tile_state.h#newcode27 cc/resources/managed_tile_state.h:27: MAX_BIN = NEVER_BIN On 2013/08/22 23:33:34, vmpstr wrote: > ...
7 years, 4 months ago (2013-08-23 00:38:13 UTC) #3
enne (OOO)
https://codereview.chromium.org/22875045/diff/1/cc/resources/tile_manager.cc File cc/resources/tile_manager.cc (right): https://codereview.chromium.org/22875045/diff/1/cc/resources/tile_manager.cc#newcode29 cc/resources/tile_manager.cc:29: kBinPolicyMap[MAX_TILE_MEMORY_LIMIT_POLICY + 1][MAX_BIN + 1] = { Ugh. I ...
7 years, 4 months ago (2013-08-23 00:44:38 UTC) #4
enne (OOO)
Sorry to be grumpy, but the separate enum also seems a little messy. Somebody could ...
7 years, 4 months ago (2013-08-23 00:49:58 UTC) #5
reveman
Thanks for the feedback. I like keeping switch statements as clean as possible as we ...
7 years, 4 months ago (2013-08-23 15:16:57 UTC) #6
enne (OOO)
On 2013/08/23 15:16:57, David Reveman wrote: > I like keeping switch statements as clean as ...
7 years, 4 months ago (2013-08-23 16:14:50 UTC) #7
vmpstr
On 2013/08/23 16:14:50, enne wrote: > On 2013/08/23 15:16:57, David Reveman wrote: > > > ...
7 years, 4 months ago (2013-08-23 16:39:52 UTC) #8
reveman
On 2013/08/23 16:14:50, enne wrote: > On 2013/08/23 15:16:57, David Reveman wrote: > > > ...
7 years, 4 months ago (2013-08-23 16:46:17 UTC) #9
enne (OOO)
On 2013/08/23 16:46:17, David Reveman wrote: > The kEnumMax would still be in the same ...
7 years, 4 months ago (2013-08-23 16:50:41 UTC) #10
danakj
I'm going to vote for NUM_THINGS: NOTREACHED(); Keeping this as simple as possible is good. ...
7 years, 4 months ago (2013-08-23 17:42:15 UTC) #11
reveman
On 2013/08/23 16:50:41, enne wrote: > On 2013/08/23 16:46:17, David Reveman wrote: > > > ...
7 years, 4 months ago (2013-08-23 19:57:56 UTC) #12
enne (OOO)
On 2013/08/23 19:57:56, David Reveman wrote: > > Are you suggesting this? > > > ...
7 years, 4 months ago (2013-08-23 20:31:33 UTC) #13
reveman
On 2013/08/23 20:31:33, enne wrote: > On 2013/08/23 19:57:56, David Reveman wrote: > > > ...
7 years, 4 months ago (2013-08-23 20:45:00 UTC) #14
reveman
Reduced this to the cases which I think we all agree on. PTAL. I uploaded ...
7 years, 3 months ago (2013-08-26 13:56:14 UTC) #15
vmpstr
lgtm https://codereview.chromium.org/22875045/diff/6001/cc/resources/raster_mode.cc File cc/resources/raster_mode.cc (right): https://codereview.chromium.org/22875045/diff/6001/cc/resources/raster_mode.cc#newcode24 cc/resources/raster_mode.cc:24: default: I think this can also be removed ...
7 years, 3 months ago (2013-08-26 15:38:29 UTC) #16
danakj
Looks good but in cases where all switch cases should return a value, I'd prefer ...
7 years, 3 months ago (2013-08-26 15:55:39 UTC) #17
vmpstr
https://codereview.chromium.org/22875045/diff/6001/cc/resources/platform_color.h File cc/resources/platform_color.h (right): https://codereview.chromium.org/22875045/diff/6001/cc/resources/platform_color.h#newcode33 cc/resources/platform_color.h:33: // fall-through On 2013/08/26 15:55:39, danakj wrote: > how ...
7 years, 3 months ago (2013-08-26 16:04:26 UTC) #18
reveman
https://codereview.chromium.org/22875045/diff/6001/cc/animation/transform_operation.cc File cc/animation/transform_operation.cc (right): https://codereview.chromium.org/22875045/diff/6001/cc/animation/transform_operation.cc#newcode300 cc/animation/transform_operation.cc:300: break; On 2013/08/26 15:55:39, danakj wrote: > can you ...
7 years, 3 months ago (2013-08-26 17:16:57 UTC) #19
vmpstr
https://codereview.chromium.org/22875045/diff/6001/cc/resources/raster_mode.cc File cc/resources/raster_mode.cc (right): https://codereview.chromium.org/22875045/diff/6001/cc/resources/raster_mode.cc#newcode24 cc/resources/raster_mode.cc:24: default: On 2013/08/26 17:16:57, David Reveman wrote: > On ...
7 years, 3 months ago (2013-08-26 17:19:17 UTC) #20
danakj
LGTM, thanks. https://codereview.chromium.org/22875045/diff/30001/cc/output/filter_operation.cc File cc/output/filter_operation.cc (right): https://codereview.chromium.org/22875045/diff/30001/cc/output/filter_operation.cc#newcode176 cc/output/filter_operation.cc:176: break; nit: return amount here?
7 years, 3 months ago (2013-08-26 17:22:53 UTC) #21
reveman
https://codereview.chromium.org/22875045/diff/30001/cc/output/filter_operation.cc File cc/output/filter_operation.cc (right): https://codereview.chromium.org/22875045/diff/30001/cc/output/filter_operation.cc#newcode176 cc/output/filter_operation.cc:176: break; On 2013/08/26 17:22:54, danakj wrote: > nit: return ...
7 years, 3 months ago (2013-08-26 20:05:13 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/22875045/35001
7 years, 3 months ago (2013-08-26 20:22:31 UTC) #23
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) aura_unittests, browser_tests, compositor_unittests, content_browsertests, content_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_aura&number=71903
7 years, 3 months ago (2013-08-26 22:01:14 UTC) #24
reveman
https://chromiumcodereview.appspot.com/22875045/diff/6001/cc/output/filter_operations.cc File cc/output/filter_operations.cc (right): https://chromiumcodereview.appspot.com/22875045/diff/6001/cc/output/filter_operations.cc#newcode99 cc/output/filter_operations.cc:99: break; On 2013/08/26 15:55:39, danakj wrote: > can you ...
7 years, 3 months ago (2013-08-26 23:38:40 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/22875045/60001
7 years, 3 months ago (2013-08-27 00:07:59 UTC) #26
danakj
https://chromiumcodereview.appspot.com/22875045/diff/6001/cc/output/filter_operations.cc File cc/output/filter_operations.cc (right): https://chromiumcodereview.appspot.com/22875045/diff/6001/cc/output/filter_operations.cc#newcode99 cc/output/filter_operations.cc:99: break; On 2013/08/26 23:38:41, David Reveman wrote: > On ...
7 years, 3 months ago (2013-08-27 00:18:54 UTC) #27
commit-bot: I haz the power
7 years, 3 months ago (2013-08-27 04:17:53 UTC) #28
Message was sent while issue was closed.
Change committed as 219691

Powered by Google App Engine
This is Rietveld 408576698