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

Issue 7823004: Convert SHA256_LENGTH from a constant-in-anonymous-enum to a static const. This defines the cons... (Closed)

Created:
9 years, 3 months ago by Peter Kasting
Modified:
9 years, 3 months ago
Reviewers:
wtc
CC:
chromium-reviews, cbentzel+watch_chromium.org, Erik does not do reviews, mihaip+watch_chromium.org, Aaron Boodman, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Convert SHA256_LENGTH from a constant-in-anonymous-enum to a static const. This defines the constant where it's declared to preserve the existing readability. Normally this makes things like DCHECK_EQ() unhappy, but when I'd originally tested this I didn't seem to need to make any changes due to that. Will be watching the trybots... The original motiviation for this change was to find a way to eliminate some cases of passing anonymous-typed values as template arguments (which happens when you use a value from the enum in e.g. EXPECT_EQ()), which is technically illegal in C++03, though we don't warn about it. Simply naming the enum would have done this, but in general naming enums used to declare constants like this is bizarre ("enum Constants { ... }"?). BUG=92247 TEST=Compiles Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=102369

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -45 lines) Patch
M chrome/browser/extensions/convert_user_script.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/convert_web_app.cc View 1 chunk +4 lines, -5 lines 1 comment Download
M chrome/browser/extensions/extension_updater.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/client_side_detection_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/client_side_detection_service_unittest.cc View 3 chunks +10 lines, -10 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_util.cc View 1 chunk +3 lines, -3 lines 1 comment Download
M crypto/secure_hash_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M crypto/sha2.h View 1 chunk +1 line, -3 lines 1 comment Download
M crypto/sha2.cc View 1 chunk +1 line, -1 line 0 comments Download
M crypto/sha2_unittest.cc View 4 chunks +8 lines, -8 lines 0 comments Download
M net/base/crl_set.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M net/base/dnssec_chain_verifier.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/transport_security_state.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Peter Kasting
9 years, 3 months ago (2011-08-31 21:23:25 UTC) #1
wtc
LGTM! http://codereview.chromium.org/7823004/diff/1/chrome/browser/extensions/convert_web_app.cc File chrome/browser/extensions/convert_web_app.cc (right): http://codereview.chromium.org/7823004/diff/1/chrome/browser/extensions/convert_web_app.cc#newcode52 chrome/browser/extensions/convert_web_app.cc:52: crypto::kSHA256Length); Nit: since 'raw' and crypto::kSHA256Length are related ...
9 years, 3 months ago (2011-09-02 17:08:42 UTC) #2
wtc
I found that base/sha1.h has an enumerator SHA1_LENGTH that should be fixed in the same ...
9 years, 3 months ago (2011-09-02 17:37:14 UTC) #3
Peter Kasting
On 2011/09/02 17:37:14, wtc wrote: > I found that base/sha1.h has an enumerator SHA1_LENGTH > ...
9 years, 3 months ago (2011-09-12 17:30:08 UTC) #4
wtc
9 years, 3 months ago (2011-09-12 19:37:39 UTC) #5
Yes, please make the SHA1_LENGTH change in a separate patch.

It is best to wait another week for the DigiNotar changes
to settle, but you can write the SHA1_LENGTH change and have
it reviewed first.

Powered by Google App Engine
This is Rietveld 408576698