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

Issue 1158923005: Use the exact-width integer types defined in <stdint.h> rather than (Closed)

Created:
5 years, 6 months ago by wtc
Modified:
5 years, 6 months ago
Reviewers:
eroman
CC:
chromium-reviews, cbentzel+watch_chromium.org, jshin+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use the exact-width integer types defined in <stdint.h> rather than "base/basictypes.h" in net/android, net/base, and net/cert. R=eroman@chromium.org BUG=488550 TEST=none Committed: https://crrev.com/69f8ea8811eabe16f4793d15c8e211805d29dbe7 Cr-Commit-Position: refs/heads/master@{#332742}

Patch Set 1 #

Patch Set 2 : Don't include "base/basictypes.h" in net/android and net/cert. #

Patch Set 3 : git cl format #

Patch Set 4 : Tweak comments. Exclude mime_sniffer*. Rebase. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+454 lines, -469 lines) Patch
M net/android/android_private_key.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M net/android/cert_verify_result_android.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M net/android/keystore.h View 1 2 6 chunks +8 lines, -12 lines 0 comments Download
M net/android/keystore.cc View 1 2 5 chunks +9 lines, -16 lines 0 comments Download
M net/android/keystore_openssl.cc View 1 6 chunks +6 lines, -6 lines 0 comments Download
M net/android/keystore_unittest.cc View 1 2 4 chunks +3 lines, -5 lines 0 comments Download
M net/android/net_jni_registrar.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M net/android/network_change_notifier_android.h View 1 1 chunk +1 line, -1 line 0 comments Download
M net/android/network_change_notifier_android_unittest.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M net/android/network_change_notifier_delegate_android.h View 1 1 chunk +1 line, -1 line 0 comments Download
M net/android/network_change_notifier_factory_android.h View 1 1 chunk +1 line, -1 line 0 comments Download
M net/android/network_library.h View 1 3 chunks +4 lines, -4 lines 0 comments Download
M net/android/network_library.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M net/base/address_list.h View 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/address_list.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/address_list_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/address_tracker_linux_unittest.cc View 1 2 5 chunks +13 lines, -10 lines 0 comments Download
M net/base/backoff_entry.h View 1 chunk +2 lines, -2 lines 0 comments Download
M net/base/backoff_entry.cc View 1 2 4 chunks +9 lines, -9 lines 0 comments Download
M net/base/backoff_entry_serializer.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/chunked_upload_data_stream.h View 1 chunk +1 line, -1 line 0 comments Download
M net/base/chunked_upload_data_stream.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/completion_callback.h View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M net/base/elements_upload_data_stream.h View 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/elements_upload_data_stream.cc View 1 2 4 chunks +6 lines, -6 lines 0 comments Download
M net/base/elements_upload_data_stream_unittest.cc View 1 2 5 chunks +7 lines, -7 lines 0 comments Download
M net/base/escape.h View 1 chunk +1 line, -1 line 0 comments Download
M net/base/escape.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/file_stream.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M net/base/file_stream.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/file_stream_context.h View 3 chunks +4 lines, -4 lines 0 comments Download
M net/base/file_stream_context.cc View 1 2 3 chunks +4 lines, -5 lines 0 comments Download
M net/base/file_stream_context_posix.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/base/file_stream_context_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/file_stream_unittest.cc View 1 2 18 chunks +23 lines, -23 lines 0 comments Download
M net/base/hash_value.h View 1 chunk +1 line, -1 line 0 comments Download
M net/base/hash_value.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/host_mapping_rules.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/host_port_pair.h View 1 2 3 chunks +4 lines, -8 lines 0 comments Download
M net/base/host_port_pair.cc View 1 2 2 chunks +5 lines, -4 lines 0 comments Download
M net/base/host_port_pair_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/ip_address_number.h View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M net/base/ip_address_number.cc View 1 2 3 chunks +4 lines, -5 lines 0 comments Download
M net/base/ip_address_number_unittest.cc View 1 chunk +6 lines, -6 lines 0 comments Download
M net/base/ip_endpoint.h View 2 chunks +3 lines, -3 lines 0 comments Download
M net/base/ip_endpoint.cc View 1 2 2 chunks +5 lines, -5 lines 0 comments Download
M net/base/ip_endpoint_unittest.cc View 8 chunks +9 lines, -9 lines 0 comments Download
M net/base/ip_pattern.h View 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/ip_pattern.cc View 6 chunks +12 lines, -12 lines 0 comments Download
M net/base/load_timing_info.h View 1 chunk +1 line, -1 line 0 comments Download
M net/base/mock_file_stream.h View 3 chunks +5 lines, -5 lines 0 comments Download
M net/base/mock_file_stream.cc View 1 2 4 chunks +6 lines, -4 lines 0 comments Download
M net/base/net_util.h View 1 2 3 5 chunks +8 lines, -7 lines 0 comments Download
M net/base/net_util.cc View 1 2 3 8 chunks +13 lines, -13 lines 0 comments Download
M net/base/net_util_icu.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/net_util_icu_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/net_util_unittest.cc View 1 2 3 6 chunks +6 lines, -6 lines 0 comments Download
M net/base/network_change_notifier.cc View 1 2 4 chunks +6 lines, -6 lines 0 comments Download
M net/base/network_interfaces.h View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M net/base/network_interfaces.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/base/network_interfaces_mac.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/base/network_interfaces_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/base/network_interfaces_win.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/base/network_quality_estimator_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/openssl_private_key_store_android.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/base/priority_queue.h View 1 chunk +1 line, -1 line 0 comments Download
M net/base/sdch_manager.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/test_completion_callback.h View 1 chunk +1 line, -1 line 0 comments Download
M net/base/upload_bytes_element_reader.h View 2 chunks +6 lines, -6 lines 0 comments Download
M net/base/upload_bytes_element_reader.cc View 1 2 3 chunks +5 lines, -7 lines 0 comments Download
M net/base/upload_data_stream.h View 4 chunks +8 lines, -8 lines 0 comments Download
M net/base/upload_data_stream.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/upload_element_reader.h View 1 chunk +2 lines, -2 lines 0 comments Download
M net/base/upload_file_element_reader.h View 4 chunks +12 lines, -12 lines 0 comments Download
M net/base/upload_file_element_reader.cc View 1 2 7 chunks +11 lines, -11 lines 0 comments Download
M net/base/upload_file_element_reader_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/base/upload_progress.h View 1 chunk +5 lines, -5 lines 0 comments Download
M net/cert/asn1_util.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/cert/cert_database.h View 1 1 chunk +1 line, -1 line 0 comments Download
M net/cert/cert_status_flags.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M net/cert/cert_verifier.h View 1 1 chunk +1 line, -1 line 0 comments Download
M net/cert/cert_verify_proc.cc View 1 5 chunks +4 lines, -5 lines 0 comments Download
M net/cert/cert_verify_proc_android.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/cert_verify_proc_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/cert_verify_proc_openssl.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/cert_verify_proc_win.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/cert/crl_set.h View 2 chunks +3 lines, -3 lines 0 comments Download
M net/cert/crl_set.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/cert/crl_set_storage.cc View 1 2 3 13 chunks +38 lines, -38 lines 4 comments Download
M net/cert/crl_set_unittest.cc View 9 chunks +9 lines, -9 lines 0 comments Download
M net/cert/ct_log_response_parser.cc View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M net/cert/ct_serialization.cc View 1 4 chunks +6 lines, -5 lines 0 comments Download
M net/cert/multi_threaded_cert_verifier.h View 1 3 chunks +8 lines, -7 lines 0 comments Download
M net/cert/nss_cert_database.h View 1 2 chunks +3 lines, -2 lines 0 comments Download
M net/cert/signed_certificate_timestamp.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/signed_tree_head.h View 2 chunks +2 lines, -2 lines 0 comments Download
M net/cert/test_root_certs_android.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/test_root_certs_win.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M net/cert/x509_cert_types_mac.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/cert/x509_cert_types_unittest.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M net/cert/x509_certificate.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M net/cert/x509_certificate_known_roots_mac.h View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/x509_certificate_known_roots_win.h View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/x509_certificate_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/x509_certificate_unittest.cc View 1 14 chunks +28 lines, -27 lines 0 comments Download
M net/cert/x509_certificate_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/x509_util.h View 1 3 chunks +3 lines, -2 lines 0 comments Download
M net/cert/x509_util.cc View 1 3 chunks +2 lines, -3 lines 0 comments Download
M net/cert/x509_util_mac.h View 1 1 chunk +1 line, -1 line 0 comments Download
M net/cert/x509_util_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cert/x509_util_nss.cc View 1 2 2 chunks +6 lines, -7 lines 0 comments Download
M net/cert/x509_util_openssl.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M net/cert/x509_util_openssl_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/cert/x509_util_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
eroman
* What stuff do you want me to review (as there are 2 reviewers) * ...
5 years, 6 months ago (2015-06-03 19:01:02 UTC) #2
eroman
Oh I see now this was not actually published, nevermind! (I sometimes go through the ...
5 years, 6 months ago (2015-06-03 19:02:20 UTC) #3
wtc
Eric: this CL is now ready for your review. Please review the entire CL. Thanks.
5 years, 6 months ago (2015-06-03 21:00:35 UTC) #5
eroman
lgtm https://codereview.chromium.org/1158923005/diff/60001/net/cert/crl_set_storage.cc File net/cert/crl_set_storage.cc (right): https://codereview.chromium.org/1158923005/diff/60001/net/cert/crl_set_storage.cc#newcode118 net/cert/crl_set_storage.cc:118: memcpy(&header_len, data->data(), 2); // Assumes little-endian. your translation ...
5 years, 6 months ago (2015-06-03 22:10:40 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1158923005/60001
5 years, 6 months ago (2015-06-03 22:32:16 UTC) #8
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 6 months ago (2015-06-04 00:08:23 UTC) #9
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/69f8ea8811eabe16f4793d15c8e211805d29dbe7 Cr-Commit-Position: refs/heads/master@{#332742}
5 years, 6 months ago (2015-06-04 00:09:29 UTC) #10
wtc
5 years, 6 months ago (2015-06-04 01:03:05 UTC) #11
Message was sent while issue was closed.
https://codereview.chromium.org/1158923005/diff/60001/net/cert/crl_set_storag...
File net/cert/crl_set_storage.cc (right):

https://codereview.chromium.org/1158923005/diff/60001/net/cert/crl_set_storag...
net/cert/crl_set_storage.cc:118: memcpy(&header_len, data->data(), 2);  //
Assumes little-endian.

On 2015/06/03 22:10:39, eroman wrote:
> your translation is correct fine. however it seems like this file would be
> better using sizeof(header_len) and the like throughout. In some cases it is
> hard-coded (here, however in others it uses the size of the type).

Done. See https://codereview.chromium.org/1170493002/

https://codereview.chromium.org/1158923005/diff/60001/net/cert/crl_set_storag...
net/cert/crl_set_storage.cc:152: memcpy(&num_serials, data->data(),
sizeof(uint32_t));

On 2015/06/03 22:10:39, eroman wrote:
> Also not sure how this file is used, but not sure that relying on little
> endian-ness is a good idea, since can't we run on architectures (i.e. arm)
which
> are not?

ARM, MIPS, and PowerPC can be configured to be big-endian or little-endian.
Because of the popularity of little-endian processors, ARM, etc. are often
configured in little-endian mode to make software porting easier. Also, even
if one wants to write endianness-neutral code, it is very difficult to find
a big-endian computer to test the code on.

This is why I think it is OK to just assume little endian in Chromium.

Powered by Google App Engine
This is Rietveld 408576698