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

Issue 2427633005: Improve GCM enum switch type safety (Closed)

Created:
4 years, 2 months ago by johnme
Modified:
4 years, 1 month ago
Reviewers:
Nicolas Zea
CC:
chromium-reviews, Peter Beverloo, johnme+watch_chromium.org, zea+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve GCM enum switch type safety Now that most/all of our compilers warn when enum values are omitted from a switch statement with no default case, it's better to omit the default case so that anyone adding new enum values gets compile failures if they forget to update one of the switches. Also converted two lists of == FOO || == BAR || == BAZ to switches for the same reason. And reordered a few switches to match the enums. Should have no functional changes, except that GetConnectionResetReasonString can now stringify NEW_HEARTBEAT_INTERVAL (an enum value that had been omitted). BUG=none Committed: https://crrev.com/133bfbad6055349368a955d16318c1997d39810b Cr-Commit-Position: refs/heads/master@{#426303}

Patch Set 1 #

Patch Set 2 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -71 lines) Patch
M components/gcm_driver/gcm_client_impl.cc View 7 chunks +11 lines, -22 lines 0 comments Download
M components/gcm_driver/gcm_desktop_utils.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M components/gcm_driver/gcm_stats_recorder_impl.cc View 6 chunks +15 lines, -11 lines 0 comments Download
M components/gcm_driver/instance_id/instance_id_impl.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M google_apis/gcm/engine/account_mapping.cc View 1 chunk +1 line, -2 lines 0 comments Download
M google_apis/gcm/engine/checkin_request.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M google_apis/gcm/engine/connection_handler_impl.cc View 2 chunks +0 lines, -4 lines 0 comments Download
M google_apis/gcm/engine/mcs_client.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M google_apis/gcm/engine/registration_request.cc View 1 chunk +19 lines, -8 lines 0 comments Download
M google_apis/gcm/engine/unregistration_request.cc View 4 chunks +25 lines, -11 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 19 (13 generated)
johnme
4 years, 2 months ago (2016-10-19 20:24:31 UTC) #11
Nicolas Zea
lgtm
4 years, 2 months ago (2016-10-19 20:40:19 UTC) #12
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/2427633005/20001
4 years, 2 months ago (2016-10-19 21:08:19 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 2 months ago (2016-10-19 22:14:19 UTC) #16
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/133bfbad6055349368a955d16318c1997d39810b Cr-Commit-Position: refs/heads/master@{#426303}
4 years, 2 months ago (2016-10-21 13:12:07 UTC) #18
johnme
4 years, 1 month ago (2016-11-03 18:09:06 UTC) #19
Message was sent while issue was closed.
Cherry-picked to M55 in https://codereview.chromium.org/2473093002 as
f6af6a205a30cb5d3bc2f9682072c5df85b4660b 2883@{#437}

Powered by Google App Engine
This is Rietveld 408576698