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

Issue 7969023: For the SSL cert status, convert anonymous enum that gives bit values into a typedefed uint32. Th... (Closed)

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

Description

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 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. 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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=102415

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -123 lines) Patch
M chrome/browser/automation/testing_automation_provider.h View 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/automation/testing_automation_provider.cc View 1 chunk +6 lines, -5 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 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ssl/ssl_error_info.h View 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/ssl/ssl_error_info.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu.cc View 1 chunk +4 lines, -1 line 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 +4 lines, -3 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 +4 lines, -3 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 +3 lines, -2 lines 0 comments Download
M content/browser/ssl/ssl_manager.h View 2 chunks +8 lines, -6 lines 0 comments Download
M content/browser/ssl/ssl_manager.cc View 4 chunks +8 lines, -6 lines 0 comments Download
M content/browser/ssl/ssl_policy.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/ssl/ssl_request_info.h View 3 chunks +4 lines, -3 lines 0 comments Download
M content/browser/ssl/ssl_request_info.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/tab_contents/navigation_entry.h View 3 chunks +4 lines, -3 lines 0 comments Download
M content/browser/tab_contents/navigation_entry_unittest.cc View 1 2 chunks +4 lines, -3 lines 0 comments Download
M content/browser/tab_contents/provisional_load_details.h View 3 chunks +3 lines, -2 lines 0 comments Download
M content/browser/tab_contents/tab_contents.cc View 1 chunk +4 lines, -1 line 0 comments Download
M net/base/cert_database_nss_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/cert_status_flags.h View 1 chunk +29 lines, -25 lines 0 comments Download
M net/base/cert_status_flags.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/cert_verify_result.h View 2 chunks +2 lines, -1 line 0 comments Download
M net/base/ssl_config_service.h View 3 chunks +4 lines, -3 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 +2 lines, -1 line 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 1 2 9 chunks +12 lines, -12 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 2 chunks +2 lines, -2 lines 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
M net/socket/ssl_client_socket_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M 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
M net/socket/ssl_client_socket_win.cc View 1 chunk +1 line, -1 line 0 comments Download

Powered by Google App Engine
This is Rietveld 408576698