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

Issue 2481903002: Make checked_cast a constexpr (Closed)

Created:
4 years, 1 month ago by jschuh
Modified:
4 years, 1 month ago
Reviewers:
Tom Sepez
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make checked_cast a constexpr Wraps the CHECK in a handler. This makes the non-CHECK case a clean constexpr, and has the nice effect of throwing a compile error if the compile-time evaluation can determine that a runtime CHECK would hit. Also had to fix a few incorrect uses of base::checked_cast (hence the need for the NOPRESUBMIT to cover the media directory). BUG=612995 NOPRESUBMIT=true TBR=vabr@chromium.org,hubbe@chromium.org,dmurph@chromium.org Committed: https://crrev.com/00c1837ccba1c6da4cb1e9b26539a6c3801bb2fb Cr-Commit-Position: refs/heads/master@{#430519}

Patch Set 1 #

Patch Set 2 : compile fix #

Patch Set 3 : doc fix #

Total comments: 1

Patch Set 4 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -19 lines) Patch
M base/numerics/safe_conversions.h View 1 2 2 chunks +19 lines, -14 lines 0 comments Download
M base/numerics/safe_numerics_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M components/autofill/core/common/save_password_progress_logger.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M media/formats/mp2t/es_parser_h264.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M storage/browser/blob/blob_data_builder.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 30 (18 generated)
jschuh
nit
4 years, 1 month ago (2016-11-07 18:59:07 UTC) #1
jschuh
compile fix
4 years, 1 month ago (2016-11-07 23:20:17 UTC) #7
jschuh
compile fix
4 years, 1 month ago (2016-11-07 23:41:13 UTC) #15
jschuh
tsepez - ptal, the only significant change is in safe_conversions.h
4 years, 1 month ago (2016-11-07 23:42:27 UTC) #16
Tom Sepez
lgtm
4 years, 1 month ago (2016-11-07 23:46:56 UTC) #17
Tom Sepez
https://codereview.chromium.org/2481903002/diff/60001/components/autofill/core/common/save_password_progress_logger.cc File components/autofill/core/common/save_password_progress_logger.cc (right): https://codereview.chromium.org/2481903002/diff/60001/components/autofill/core/common/save_password_progress_logger.cc#newcode116 components/autofill/core/common/save_password_progress_logger.cc:116: int signed_number = checked_cast<int>(unsigned_number); nit: local not needed.
4 years, 1 month ago (2016-11-07 23:48:05 UTC) #18
jschuh
nit
4 years, 1 month ago (2016-11-08 00:00:58 UTC) #19
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/2481903002/80001
4 years, 1 month ago (2016-11-08 00:42:31 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/258072) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
4 years, 1 month ago (2016-11-08 02:44:32 UTC) #24
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/2481903002/80001
4 years, 1 month ago (2016-11-08 02:55:04 UTC) #26
commit-bot: I haz the power
Committed patchset #4 (id:80001)
4 years, 1 month ago (2016-11-08 05:00:02 UTC) #28
commit-bot: I haz the power
4 years, 1 month ago (2016-11-08 05:02:24 UTC) #30
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/00c1837ccba1c6da4cb1e9b26539a6c3801bb2fb
Cr-Commit-Position: refs/heads/master@{#430519}

Powered by Google App Engine
This is Rietveld 408576698