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

Issue 7995014: Revert 102322 - For the SSL cert status, convert anonymous enum that gives bit values into a type... (Closed)

Created:
9 years, 3 months ago by Peter Kasting
Modified:
9 years, 3 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, cbentzel+watch_chromium.org, kkania, dpranke+watch-content_chromium.org, jam, Avi (use Gerrit), joi+watch-content_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., brettw-cc_chromium.org
Visibility:
Public.

Description

Revert 102322 - For the SSL cert status, convert anonymous enum that gives bit values into a typedefed uint32. This allows code all over Chromium to use an explicit type instead of "int". (This isn't possible by simply naming the enum as technically the enum doesn't define all of the possible combinations of bits.) This also means the individual named bit constants themselves have the same explicit type. I find the resulting code to be noticeably clearer. This also exposed a bug in SSLErrorInfo::GetErrorsForCertStatus() where not having an explicit type allowed a function argument ordering bug to creep in, so I claim this is safer too. I also added CERT_STATUS_NO_ERROR in place of "0" as a magic number. 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 this would have encouraged readers to actually use the enum name as a type, which for a bitfield is inappropriate for the reason given in the first paragraph. BUG=92247 TEST=Compiles Review URL: http://codereview.chromium.org/7819009 TBR=pkasting@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=102325

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+119 lines, -150 lines) Patch
M chrome/browser/automation/testing_automation_provider.h View 2 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/automation/testing_automation_provider.cc View 1 chunk +5 lines, -6 lines 0 comments Download
M chrome/browser/page_info_model.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ssl/ssl_browser_tests.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ssl/ssl_error_info.h View 3 chunks +4 lines, -6 lines 0 comments Download
M chrome/browser/ssl/ssl_error_info.cc View 2 chunks +3 lines, -3 lines 0 comments Download
MM chrome/browser/tab_contents/render_view_context_menu.cc View 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/ui/toolbar/toolbar_model.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/common/automation_messages_internal.h View 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/test/automation/tab_proxy.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/automation/tab_proxy.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/load_from_memory_cache_details.h View 2 chunks +3 lines, -4 lines 0 comments Download
M content/browser/load_from_memory_cache_details.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/resource_request_details.h View 3 chunks +2 lines, -3 lines 0 comments Download
M content/browser/ssl/ssl_manager.h View 2 chunks +6 lines, -8 lines 0 comments Download
M content/browser/ssl/ssl_manager.cc View 4 chunks +6 lines, -8 lines 0 comments Download
M content/browser/ssl/ssl_policy.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/ssl/ssl_request_info.h View 3 chunks +3 lines, -4 lines 0 comments Download
M content/browser/ssl/ssl_request_info.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/tab_contents/navigation_entry.h View 3 chunks +3 lines, -4 lines 0 comments Download
M content/browser/tab_contents/navigation_entry_unittest.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M content/browser/tab_contents/provisional_load_details.h View 3 chunks +2 lines, -3 lines 0 comments Download
M content/browser/tab_contents/tab_contents.cc View 1 chunk +1 line, -4 lines 0 comments Download
M net/base/cert_status_flags.h View 2 chunks +26 lines, -30 lines 0 comments Download
M net/base/cert_status_flags.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M net/base/cert_verify_result.h View 2 chunks +1 line, -2 lines 0 comments Download
M net/base/ssl_config_service.h View 3 chunks +3 lines, -4 lines 0 comments Download
M net/base/ssl_config_service.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/ssl_info.h View 2 chunks +1 line, -2 lines 0 comments Download
M net/base/x509_certificate_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/x509_certificate_nss.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M net/base/x509_certificate_openssl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/x509_certificate_unittest.cc View 6 chunks +9 lines, -9 lines 0 comments Download
M net/base/x509_certificate_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_response_info.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M net/http/http_transaction_unittest.h View 1 chunk +1 line, -1 line 0 comments Download
MM net/socket/ssl_client_socket_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
MM net/socket/ssl_client_socket_nss.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/socket/ssl_client_socket_openssl.cc View 1 chunk +1 line, -1 line 0 comments Download
MM net/socket/ssl_client_socket_win.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 1 (0 generated)
Peter Kasting
9 years, 3 months ago (2011-09-22 19:02:33 UTC) #1

          

Powered by Google App Engine
This is Rietveld 408576698