Switch to standard integer types in net/.
BUG=488550
[email protected]
Review URL: https://codereview.chromium.org/1535363003 .
Cr-Commit-Position: refs/heads/master@{#366297}
diff --git a/net/android/dummy_spnego_authenticator.h b/net/android/dummy_spnego_authenticator.h
index 92e46047..1f37bd3 100644
--- a/net/android/dummy_spnego_authenticator.h
+++ b/net/android/dummy_spnego_authenticator.h
@@ -6,6 +6,8 @@
#define NET_ANDROID_DUMMY_SPNEGO_AUTHENTICATOR_H_
#include <jni.h>
+#include <stdint.h>
+
#include <cstdint>
#include <list>
#include <string>
diff --git a/net/android/network_change_notifier_android.cc b/net/android/network_change_notifier_android.cc
index cafa2cd..a7655adb 100644
--- a/net/android/network_change_notifier_android.cc
+++ b/net/android/network_change_notifier_android.cc
@@ -60,6 +60,7 @@
#include "net/android/network_change_notifier_android.h"
#include "base/android/build_info.h"
+#include "base/macros.h"
#include "base/threading/thread.h"
#include "net/base/address_tracker_linux.h"
#include "net/dns/dns_config_service_posix.h"
diff --git a/net/android/network_library.h b/net/android/network_library.h
index 5befcdf..ddfb5e9 100644
--- a/net/android/network_library.h
+++ b/net/android/network_library.h
@@ -6,6 +6,7 @@
#define NET_ANDROID_NETWORK_LIBRARY_H_
#include <jni.h>
+#include <stddef.h>
#include <stdint.h>
#include <string>
diff --git a/net/base/address_list.h b/net/base/address_list.h
index 0f908009..7c8f706d 100644
--- a/net/base/address_list.h
+++ b/net/base/address_list.h
@@ -5,10 +5,11 @@
#ifndef NET_BASE_ADDRESS_LIST_H_
#define NET_BASE_ADDRESS_LIST_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "net/base/ip_address_number.h"
#include "net/base/ip_endpoint.h"
diff --git a/net/base/address_tracker_linux.h b/net/base/address_tracker_linux.h
index 87e36dd..da5c893 100644
--- a/net/base/address_tracker_linux.h
+++ b/net/base/address_tracker_linux.h
@@ -10,13 +10,14 @@
#define net net_kernel
#include <linux/rtnetlink.h>
#undef net
+#include <stddef.h>
#include <map>
-#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
diff --git a/net/base/chunked_upload_data_stream.h b/net/base/chunked_upload_data_stream.h
index 6f7d284..7b5e2df 100644
--- a/net/base/chunked_upload_data_stream.h
+++ b/net/base/chunked_upload_data_stream.h
@@ -5,6 +5,9 @@
#ifndef NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_
#define NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <vector>
#include "base/macros.h"
diff --git a/net/base/completion_callback.h b/net/base/completion_callback.h
index 3b3e605..a41caa5 100644
--- a/net/base/completion_callback.h
+++ b/net/base/completion_callback.h
@@ -5,6 +5,8 @@
#ifndef NET_BASE_COMPLETION_CALLBACK_H__
#define NET_BASE_COMPLETION_CALLBACK_H__
+#include <stdint.h>
+
#include "base/callback.h"
#include "base/cancelable_callback.h"
diff --git a/net/base/crypto_module.h b/net/base/crypto_module.h
index 164df3c..e3765e9 100644
--- a/net/base/crypto_module.h
+++ b/net/base/crypto_module.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
diff --git a/net/base/data_url.cc b/net/base/data_url.cc
index 26720c5..07b8fb0 100644
--- a/net/base/data_url.cc
+++ b/net/base/data_url.cc
@@ -9,7 +9,6 @@
#include "net/base/data_url.h"
#include "base/base64.h"
-#include "base/basictypes.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "net/base/escape.h"
diff --git a/net/base/data_url_unittest.cc b/net/base/data_url_unittest.cc
index fb7dc76..4bd02519 100644
--- a/net/base/data_url_unittest.cc
+++ b/net/base/data_url_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/basictypes.h"
#include "net/base/data_url.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
diff --git a/net/base/elements_upload_data_stream.h b/net/base/elements_upload_data_stream.h
index e4773298..c3221c2 100644
--- a/net/base/elements_upload_data_stream.h
+++ b/net/base/elements_upload_data_stream.h
@@ -5,9 +5,11 @@
#ifndef NET_BASE_ELEMENTS_UPLOAD_DATA_STREAM_H_
#define NET_BASE_ELEMENTS_UPLOAD_DATA_STREAM_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <vector>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
diff --git a/net/base/elements_upload_data_stream_unittest.cc b/net/base/elements_upload_data_stream_unittest.cc
index 07e3dd7..1671ce7 100644
--- a/net/base/elements_upload_data_stream_unittest.cc
+++ b/net/base/elements_upload_data_stream_unittest.cc
@@ -10,7 +10,6 @@
#include <limits>
#include <vector>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
diff --git a/net/base/escape.h b/net/base/escape.h
index 9c500b0..c31dcf9 100644
--- a/net/base/escape.h
+++ b/net/base/escape.h
@@ -5,10 +5,11 @@
#ifndef NET_BASE_ESCAPE_H_
#define NET_BASE_ESCAPE_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "base/strings/utf_offset_string_conversions.h"
#include "net/base/net_export.h"
diff --git a/net/base/escape_unittest.cc b/net/base/escape_unittest.cc
index b6f0229..cec7f32 100644
--- a/net/base/escape_unittest.cc
+++ b/net/base/escape_unittest.cc
@@ -7,7 +7,6 @@
#include "net/base/escape.h"
-#include "base/basictypes.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/net/base/expiring_cache.h b/net/base/expiring_cache.h
index 3fbde65..a22497b 100644
--- a/net/base/expiring_cache.h
+++ b/net/base/expiring_cache.h
@@ -5,11 +5,13 @@
#ifndef NET_BASE_EXPIRING_CACHE_H_
#define NET_BASE_EXPIRING_CACHE_H_
+#include <stddef.h>
+
#include <map>
#include <utility>
-#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/time/time.h"
namespace net {
diff --git a/net/base/file_stream.h b/net/base/file_stream.h
index f0408e45..64a3435 100644
--- a/net/base/file_stream.h
+++ b/net/base/file_stream.h
@@ -10,7 +10,10 @@
#ifndef NET_BASE_FILE_STREAM_H_
#define NET_BASE_FILE_STREAM_H_
+#include <stdint.h>
+
#include "base/files/file.h"
+#include "base/macros.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
diff --git a/net/base/file_stream_context.h b/net/base/file_stream_context.h
index a42634d..32703d80 100644
--- a/net/base/file_stream_context.h
+++ b/net/base/file_stream_context.h
@@ -27,7 +27,10 @@
#ifndef NET_BASE_FILE_STREAM_CONTEXT_H_
#define NET_BASE_FILE_STREAM_CONTEXT_H_
+#include <stdint.h>
+
#include "base/files/file.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/move.h"
diff --git a/net/base/file_stream_context_posix.cc b/net/base/file_stream_context_posix.cc
index 9991c69..f84b7df 100644
--- a/net/base/file_stream_context_posix.cc
+++ b/net/base/file_stream_context_posix.cc
@@ -6,7 +6,6 @@
#include <errno.h>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
diff --git a/net/base/file_stream_unittest.cc b/net/base/file_stream_unittest.cc
index a36e5ce..4304668 100644
--- a/net/base/file_stream_unittest.cc
+++ b/net/base/file_stream_unittest.cc
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/run_loop.h"
diff --git a/net/base/hash_value.h b/net/base/hash_value.h
index f2d217f..b967443 100644
--- a/net/base/hash_value.h
+++ b/net/base/hash_value.h
@@ -5,12 +5,13 @@
#ifndef NET_BASE_HASH_VALUE_H_
#define NET_BASE_HASH_VALUE_H_
+#include <stddef.h>
+#include <stdint.h>
#include <string.h>
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/strings/string_piece.h"
#include "build/build_config.h"
#include "net/base/net_export.h"
diff --git a/net/base/host_mapping_rules.h b/net/base/host_mapping_rules.h
index e1d2cd2..8c7bc0b 100644
--- a/net/base/host_mapping_rules.h
+++ b/net/base/host_mapping_rules.h
@@ -7,7 +7,8 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
+
+#include "base/macros.h"
#include "net/base/net_export.h"
namespace net {
diff --git a/net/base/host_port_pair.h b/net/base/host_port_pair.h
index 489b971c..8fa9b3e1 100644
--- a/net/base/host_port_pair.h
+++ b/net/base/host_port_pair.h
@@ -5,10 +5,11 @@
#ifndef NET_BASE_HOST_PORT_PAIR_H_
#define NET_BASE_HOST_PORT_PAIR_H_
+#include <stdint.h>
+
#include <string>
#include <tuple>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
class GURL;
diff --git a/net/base/io_buffer.h b/net/base/io_buffer.h
index d157963..5e9ff21 100644
--- a/net/base/io_buffer.h
+++ b/net/base/io_buffer.h
@@ -5,6 +5,8 @@
#ifndef NET_BASE_IO_BUFFER_H_
#define NET_BASE_IO_BUFFER_H_
+#include <stddef.h>
+
#include <string>
#include "base/memory/ref_counted.h"
diff --git a/net/base/iovec.h b/net/base/iovec.h
index 8c70912..a98ed21 100644
--- a/net/base/iovec.h
+++ b/net/base/iovec.h
@@ -5,6 +5,8 @@
#ifndef NET_BASE_IOVEC_H_
#define NET_BASE_IOVEC_H_
+#include <stddef.h>
+
#if defined(OS_POSIX) && !defined(OS_NACL)
#include <sys/uio.h>
#else
diff --git a/net/base/ip_address.h b/net/base/ip_address.h
index 37a5ab6..bba5fc3 100644
--- a/net/base/ip_address.h
+++ b/net/base/ip_address.h
@@ -5,9 +5,11 @@
#ifndef NET_BASE_IP_ADDRESS_NET_H_
#define NET_BASE_IP_ADDRESS_NET_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
diff --git a/net/base/ip_address_number.h b/net/base/ip_address_number.h
index 1d0dd30..2671a24d 100644
--- a/net/base/ip_address_number.h
+++ b/net/base/ip_address_number.h
@@ -5,10 +5,12 @@
#ifndef NET_BASE_IP_ADDRESS_NUMBER_H_
#define NET_BASE_IP_ADDRESS_NUMBER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
diff --git a/net/base/ip_endpoint.h b/net/base/ip_endpoint.h
index 784ee03..575040f 100644
--- a/net/base/ip_endpoint.h
+++ b/net/base/ip_endpoint.h
@@ -5,9 +5,10 @@
#ifndef NET_BASE_IP_ENDPOINT_H_
#define NET_BASE_IP_ENDPOINT_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "net/base/address_family.h"
#include "net/base/ip_address_number.h"
diff --git a/net/base/ip_pattern.cc b/net/base/ip_pattern.cc
index 61c8c2e..a5e2127 100644
--- a/net/base/ip_pattern.cc
+++ b/net/base/ip_pattern.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
diff --git a/net/base/ip_pattern.h b/net/base/ip_pattern.h
index 28919279..f52220c 100644
--- a/net/base/ip_pattern.h
+++ b/net/base/ip_pattern.h
@@ -5,10 +5,12 @@
#ifndef NET_BASE_IP_PATTERN_H_
#define NET_BASE_IP_PATTERN_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/ip_address_number.h"
#include "net/base/net_export.h"
diff --git a/net/base/keygen_handler_win.cc b/net/base/keygen_handler_win.cc
index e7f10d6..d7eacd8 100644
--- a/net/base/keygen_handler_win.cc
+++ b/net/base/keygen_handler_win.cc
@@ -12,7 +12,6 @@
#include <vector>
#include "base/base64.h"
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
diff --git a/net/base/linked_hash_map.h b/net/base/linked_hash_map.h
index 9a39439..b86654bd 100644
--- a/net/base/linked_hash_map.h
+++ b/net/base/linked_hash_map.h
@@ -15,6 +15,8 @@
#ifndef UTIL_GTL_LINKED_HASH_MAP_H_
#define UTIL_GTL_LINKED_HASH_MAP_H_
+#include <stddef.h>
+
#include <list>
#include <utility>
diff --git a/net/base/load_timing_info.h b/net/base/load_timing_info.h
index 4714222..22a59082 100644
--- a/net/base/load_timing_info.h
+++ b/net/base/load_timing_info.h
@@ -5,7 +5,8 @@
#ifndef NET_BASE_LOAD_TIMING_INFO_H_
#define NET_BASE_LOAD_TIMING_INFO_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "base/time/time.h"
#include "net/base/net_export.h"
diff --git a/net/base/mime_sniffer.h b/net/base/mime_sniffer.h
index 371a330..3c93815 100644
--- a/net/base/mime_sniffer.h
+++ b/net/base/mime_sniffer.h
@@ -5,6 +5,8 @@
#ifndef NET_BASE_MIME_SNIFFER_H__
#define NET_BASE_MIME_SNIFFER_H__
+#include <stddef.h>
+
#include <string>
#include "net/base/net_export.h"
diff --git a/net/base/mime_util.h b/net/base/mime_util.h
index 34fceda..d58ddb0 100644
--- a/net/base/mime_util.h
+++ b/net/base/mime_util.h
@@ -17,6 +17,8 @@
// All constants in mime_util.cc must be written in lower case, except parameter
// values, which can be any case.
+#include <stddef.h>
+
#include <string>
#include <vector>
diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc
index 440582b..8bc61bc 100644
--- a/net/base/mime_util_unittest.cc
+++ b/net/base/mime_util_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/basictypes.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
diff --git a/net/base/mock_file_stream.h b/net/base/mock_file_stream.h
index 0d18884..ca5e030 100644
--- a/net/base/mock_file_stream.h
+++ b/net/base/mock_file_stream.h
@@ -7,7 +7,8 @@
#ifndef NET_BASE_MOCK_FILE_STREAM_H_
#define NET_BASE_MOCK_FILE_STREAM_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/base/net_errors.h b/net/base/net_errors.h
index a3b6040e..27a2e51 100644
--- a/net/base/net_errors.h
+++ b/net/base/net_errors.h
@@ -8,7 +8,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/files/file.h"
#include "base/logging.h"
#include "net/base/net_export.h"
diff --git a/net/base/net_module.h b/net/base/net_module.h
index 4ac8ab3..40359b25 100644
--- a/net/base/net_module.h
+++ b/net/base/net_module.h
@@ -5,7 +5,7 @@
#ifndef NET_BASE_NET_MODULE_H__
#define NET_BASE_NET_MODULE_H__
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index d318e8c..8ce1a8a2 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -24,7 +24,6 @@
#include <unistd.h>
#endif // defined(OS_POSIX)
-#include "base/basictypes.h"
#include "base/json/string_escape.h"
#include "base/logging.h"
#include "base/strings/string_split.h"
diff --git a/net/base/net_util.h b/net/base/net_util.h
index c3b38bc..08510a8 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -15,7 +15,9 @@
#include <ws2tcpip.h>
#endif
+#include <stddef.h>
#include <stdint.h>
+
#include <string>
#include <vector>
diff --git a/net/base/network_activity_monitor.h b/net/base/network_activity_monitor.h
index 531947732..7f3dbed 100644
--- a/net/base/network_activity_monitor.h
+++ b/net/base/network_activity_monitor.h
@@ -5,8 +5,10 @@
#ifndef NET_BASE_NETWORK_ACTIVITY_MONITOR_H_
#define NET_BASE_NETWORK_ACTIVITY_MONITOR_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "base/lazy_instance.h"
+#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index 187923c..52e5ce34 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -6,6 +6,7 @@
#include <limits>
+#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
#include "base/synchronization/lock.h"
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h
index 7ebff8103..f532889 100644
--- a/net/base/network_change_notifier.h
+++ b/net/base/network_change_notifier.h
@@ -5,9 +5,10 @@
#ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_
#define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_
+#include <stdint.h>
+
#include <vector>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/observer_list_threadsafe.h"
#include "base/time/time.h"
diff --git a/net/base/network_change_notifier_linux.cc b/net/base/network_change_notifier_linux.cc
index 40099676..e1e7de0 100644
--- a/net/base/network_change_notifier_linux.cc
+++ b/net/base/network_change_notifier_linux.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/threading/thread.h"
#include "net/base/address_tracker_linux.h"
#include "net/dns/dns_config_service.h"
diff --git a/net/base/network_change_notifier_linux.h b/net/base/network_change_notifier_linux.h
index 0da7d0c6..85238cf9 100644
--- a/net/base/network_change_notifier_linux.h
+++ b/net/base/network_change_notifier_linux.h
@@ -5,8 +5,8 @@
#ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_
#define NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/base/network_change_notifier.h"
diff --git a/net/base/network_change_notifier_mac.cc b/net/base/network_change_notifier_mac.cc
index bd1f2d8a..4105159 100644
--- a/net/base/network_change_notifier_mac.cc
+++ b/net/base/network_change_notifier_mac.cc
@@ -7,7 +7,7 @@
#include <netinet/in.h>
#include <resolv.h>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "net/dns/dns_config_service.h"
diff --git a/net/base/network_change_notifier_mac.h b/net/base/network_change_notifier_mac.h
index 6f34087..28228b1 100644
--- a/net/base/network_change_notifier_mac.h
+++ b/net/base/network_change_notifier_mac.h
@@ -7,9 +7,9 @@
#include <SystemConfiguration/SystemConfiguration.h>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/mac/scoped_cftyperef.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
diff --git a/net/base/network_change_notifier_win.cc b/net/base/network_change_notifier_win.cc
index e768352..320801f 100644
--- a/net/base/network_change_notifier_win.cc
+++ b/net/base/network_change_notifier_win.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
diff --git a/net/base/network_change_notifier_win.h b/net/base/network_change_notifier_win.h
index 113de9f9..d3a010b 100644
--- a/net/base/network_change_notifier_win.h
+++ b/net/base/network_change_notifier_win.h
@@ -7,8 +7,8 @@
#include <windows.h>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
diff --git a/net/base/network_change_notifier_win_unittest.cc b/net/base/network_change_notifier_win_unittest.cc
index 14bf01a..083a744 100644
--- a/net/base/network_change_notifier_win_unittest.cc
+++ b/net/base/network_change_notifier_win_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "net/base/network_change_notifier.h"
#include "net/base/network_change_notifier_factory.h"
diff --git a/net/base/network_config_watcher_mac.cc b/net/base/network_config_watcher_mac.cc
index bdf75c3..07dc2dfd 100644
--- a/net/base/network_config_watcher_mac.cc
+++ b/net/base/network_config_watcher_mac.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/threading/thread.h"
diff --git a/net/base/network_config_watcher_mac.h b/net/base/network_config_watcher_mac.h
index 850ad8a..ef09f54 100644
--- a/net/base/network_config_watcher_mac.h
+++ b/net/base/network_config_watcher_mac.h
@@ -7,8 +7,8 @@
#include <SystemConfiguration/SCDynamicStore.h>
-#include "base/basictypes.h"
#include "base/mac/scoped_cftyperef.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
namespace base {
diff --git a/net/base/network_interfaces.h b/net/base/network_interfaces.h
index 6b21f51..a234f2f 100644
--- a/net/base/network_interfaces.h
+++ b/net/base/network_interfaces.h
@@ -15,10 +15,12 @@
#include <sys/socket.h>
#endif
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string16.h"
#include "base/strings/utf_offset_string_conversions.h"
#include "net/base/address_family.h"
diff --git a/net/base/network_quality_estimator.cc b/net/base/network_quality_estimator.cc
index 2c0f1e1..2344a02a 100644
--- a/net/base/network_quality_estimator.cc
+++ b/net/base/network_quality_estimator.cc
@@ -402,7 +402,7 @@
if (actual_value_msec == 0)
return;
- int32 ratio = (estimated_value_msec * 100) / actual_value_msec;
+ int32_t ratio = (estimated_value_msec * 100) / actual_value_msec;
// Record the accuracy of estimation by recording the ratio of estimated
// value to the actual value.
diff --git a/net/base/network_quality_estimator.h b/net/base/network_quality_estimator.h
index ea4eaa1d..ad10d324 100644
--- a/net/base/network_quality_estimator.h
+++ b/net/base/network_quality_estimator.h
@@ -5,6 +5,7 @@
#ifndef NET_BASE_NETWORK_QUALITY_ESTIMATOR_H_
#define NET_BASE_NETWORK_QUALITY_ESTIMATOR_H_
+#include <stddef.h>
#include <stdint.h>
#include <deque>
diff --git a/net/base/network_quality_estimator_unittest.cc b/net/base/network_quality_estimator_unittest.cc
index 729af9d..93cd009 100644
--- a/net/base/network_quality_estimator_unittest.cc
+++ b/net/base/network_quality_estimator_unittest.cc
@@ -10,9 +10,9 @@
#include <map>
#include <vector>
-#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_samples.h"
#include "base/run_loop.h"
diff --git a/net/base/openssl_private_key_store.h b/net/base/openssl_private_key_store.h
index 0ad3b1a9..ee4bc35 100644
--- a/net/base/openssl_private_key_store.h
+++ b/net/base/openssl_private_key_store.h
@@ -10,7 +10,7 @@
// Avoid including <openssl/evp.h>
typedef struct evp_pkey_st EVP_PKEY;
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
class GURL;
diff --git a/net/base/openssl_private_key_store_memory.cc b/net/base/openssl_private_key_store_memory.cc
index e258eb5..49e6e1d 100644
--- a/net/base/openssl_private_key_store_memory.cc
+++ b/net/base/openssl_private_key_store_memory.cc
@@ -9,6 +9,7 @@
#include <openssl/evp.h>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/singleton.h"
#include "base/synchronization/lock.h"
diff --git a/net/base/port_util.h b/net/base/port_util.h
index 85e9160..99a1ec48 100644
--- a/net/base/port_util.h
+++ b/net/base/port_util.h
@@ -5,9 +5,11 @@
#ifndef NET_BASE_NET_PORT_UTIL_
#define NET_BASE_NET_PORT_UTIL_
+#include <stddef.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
namespace net {
diff --git a/net/base/prioritized_dispatcher.h b/net/base/prioritized_dispatcher.h
index e4f1019d..8da8a1a 100644
--- a/net/base/prioritized_dispatcher.h
+++ b/net/base/prioritized_dispatcher.h
@@ -5,8 +5,11 @@
#ifndef NET_BASE_PRIORITIZED_DISPATCHER_H_
#define NET_BASE_PRIORITIZED_DISPATCHER_H_
+#include <stddef.h>
+
#include <vector>
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/base/priority_queue.h"
diff --git a/net/base/priority_queue.h b/net/base/priority_queue.h
index 6b53ecc4..a955e6a 100644
--- a/net/base/priority_queue.h
+++ b/net/base/priority_queue.h
@@ -5,11 +5,14 @@
#ifndef NET_BASE_PRIORITY_QUEUE_H_
#define NET_BASE_PRIORITY_QUEUE_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <list>
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/threading/non_thread_safe.h"
#include "net/base/net_export.h"
diff --git a/net/base/registry_controlled_domains/registry_controlled_domain.h b/net/base/registry_controlled_domains/registry_controlled_domain.h
index efca00f..67f5e38 100644
--- a/net/base/registry_controlled_domains/registry_controlled_domain.h
+++ b/net/base/registry_controlled_domains/registry_controlled_domain.h
@@ -113,9 +113,10 @@
#ifndef NET_BASE_REGISTRY_CONTROLLED_DOMAINS_REGISTRY_CONTROLLED_DOMAIN_H_
#define NET_BASE_REGISTRY_CONTROLLED_DOMAINS_REGISTRY_CONTROLLED_DOMAIN_H_
+#include <stddef.h>
+
#include <string>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
class GURL;
diff --git a/net/base/sdch_dictionary.h b/net/base/sdch_dictionary.h
index f7c3706..fcbecdc 100644
--- a/net/base/sdch_dictionary.h
+++ b/net/base/sdch_dictionary.h
@@ -5,6 +5,8 @@
#ifndef NET_BASE_SDCH_DICTIONARY_H_
#define NET_BASE_SDCH_DICTIONARY_H_
+#include <stddef.h>
+
#include <set>
#include <string>
diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h
index c06c9b0e..b06bfef 100644
--- a/net/base/sdch_manager.h
+++ b/net/base/sdch_manager.h
@@ -18,6 +18,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
diff --git a/net/base/sdch_manager_unittest.cc b/net/base/sdch_manager_unittest.cc
index 0dfcb5402..6a21fcb7 100644
--- a/net/base/sdch_manager_unittest.cc
+++ b/net/base/sdch_manager_unittest.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/test/simple_test_clock.h"
diff --git a/net/base/static_cookie_policy.h b/net/base/static_cookie_policy.h
index 0231531..5adc194 100644
--- a/net/base/static_cookie_policy.h
+++ b/net/base/static_cookie_policy.h
@@ -5,7 +5,7 @@
#ifndef NET_BASE_STATIC_COOKIE_POLICY_H_
#define NET_BASE_STATIC_COOKIE_POLICY_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
class GURL;
diff --git a/net/base/test_completion_callback.h b/net/base/test_completion_callback.h
index 236c9b3..631dc5c 100644
--- a/net/base/test_completion_callback.h
+++ b/net/base/test_completion_callback.h
@@ -5,8 +5,11 @@
#ifndef NET_BASE_TEST_COMPLETION_CALLBACK_H_
#define NET_BASE_TEST_COMPLETION_CALLBACK_H_
+#include <stdint.h>
+
#include "base/callback.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
#include "net/base/net_errors.h"
diff --git a/net/base/test_completion_callback_unittest.cc b/net/base/test_completion_callback_unittest.cc
index 454da5d..9a40b240f 100644
--- a/net/base/test_completion_callback_unittest.cc
+++ b/net/base/test_completion_callback_unittest.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/worker_pool.h"
diff --git a/net/base/upload_bytes_element_reader.h b/net/base/upload_bytes_element_reader.h
index a5ee8a7..90148ec0 100644
--- a/net/base/upload_bytes_element_reader.h
+++ b/net/base/upload_bytes_element_reader.h
@@ -5,11 +5,13 @@
#ifndef NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_
#define NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/base/upload_element_reader.h"
diff --git a/net/base/upload_bytes_element_reader_unittest.cc b/net/base/upload_bytes_element_reader_unittest.cc
index 1d2f52f..1dce3fb 100644
--- a/net/base/upload_bytes_element_reader_unittest.cc
+++ b/net/base/upload_bytes_element_reader_unittest.cc
@@ -4,7 +4,6 @@
#include "net/base/upload_bytes_element_reader.h"
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
diff --git a/net/base/upload_data_stream.h b/net/base/upload_data_stream.h
index ebb20af..2d06b44 100644
--- a/net/base/upload_data_stream.h
+++ b/net/base/upload_data_stream.h
@@ -5,9 +5,10 @@
#ifndef NET_BASE_UPLOAD_DATA_STREAM_H_
#define NET_BASE_UPLOAD_DATA_STREAM_H_
+#include <stdint.h>
+
#include <vector>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
diff --git a/net/base/upload_element_reader.h b/net/base/upload_element_reader.h
index 2814efa..049f38e 100644
--- a/net/base/upload_element_reader.h
+++ b/net/base/upload_element_reader.h
@@ -5,7 +5,9 @@
#ifndef NET_BASE_UPLOAD_ELEMENT_READER_H_
#define NET_BASE_UPLOAD_ELEMENT_READER_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
diff --git a/net/base/upload_file_element_reader.h b/net/base/upload_file_element_reader.h
index bf46350e..f246553 100644
--- a/net/base/upload_file_element_reader.h
+++ b/net/base/upload_file_element_reader.h
@@ -5,10 +5,13 @@
#ifndef NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_
#define NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_
+#include <stdint.h>
+
#include "base/compiler_specific.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/base/upload_progress.h b/net/base/upload_progress.h
index 1389ecc..25194aa 100644
--- a/net/base/upload_progress.h
+++ b/net/base/upload_progress.h
@@ -5,7 +5,7 @@
#ifndef NET_BASE_UPLOAD_PROGRESS_H_
#define NET_BASE_UPLOAD_PROGRESS_H_
-#include "base/basictypes.h"
+#include <stdint.h>
namespace net {
diff --git a/net/base/url_util.h b/net/base/url_util.h
index 15502e4..cab75a9 100644
--- a/net/base/url_util.h
+++ b/net/base/url_util.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "url/third_party/mozilla/url_parse.h"
diff --git a/net/base/zap.h b/net/base/zap.h
index 5be113a..be60828 100644
--- a/net/base/zap.h
+++ b/net/base/zap.h
@@ -5,7 +5,10 @@
#ifndef NET_BASE_ZAP_H_
#define NET_BASE_ZAP_H_
+#include <stddef.h>
+
#include <string>
+
#include "base/strings/string16.h"
namespace net {
diff --git a/net/cert/cert_net_fetcher.h b/net/cert/cert_net_fetcher.h
index 2d19e14..afe878e 100644
--- a/net/cert/cert_net_fetcher.h
+++ b/net/cert/cert_net_fetcher.h
@@ -5,9 +5,12 @@
#ifndef NET_CERT_CERT_NET_FETCHER_H_
#define NET_CERT_CERT_NET_FETCHER_H_
+#include <stdint.h>
+
#include <vector>
#include "base/callback.h"
+#include "base/macros.h"
#include "net/base/net_errors.h"
#include "net/base/net_export.h"
diff --git a/net/cert/cert_verify_proc.h b/net/cert/cert_verify_proc.h
index fdc1205..629fde8 100644
--- a/net/cert/cert_verify_proc.h
+++ b/net/cert/cert_verify_proc.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
#include "net/cert/x509_cert_types.h"
diff --git a/net/cert/cert_verify_proc_nss.cc b/net/cert/cert_verify_proc_nss.cc
index b4443d5..ca8e811 100644
--- a/net/cert/cert_verify_proc_nss.cc
+++ b/net/cert/cert_verify_proc_nss.cc
@@ -15,6 +15,7 @@
#include <sslerr.h>
#include "base/logging.h"
+#include "base/macros.h"
#include "build/build_config.h"
#include "crypto/nss_util.h"
#include "crypto/scoped_nss_types.h"
diff --git a/net/cert/cert_verify_proc_unittest.cc b/net/cert/cert_verify_proc_unittest.cc
index a3c1fd8..9028534 100644
--- a/net/cert/cert_verify_proc_unittest.cc
+++ b/net/cert/cert_verify_proc_unittest.cc
@@ -10,6 +10,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "crypto/sha2.h"
diff --git a/net/cert/cert_verify_proc_whitelist.h b/net/cert/cert_verify_proc_whitelist.h
index c4a5aae0..47ce983 100644
--- a/net/cert/cert_verify_proc_whitelist.h
+++ b/net/cert/cert_verify_proc_whitelist.h
@@ -5,6 +5,7 @@
#ifndef NET_CERT_CERT_VERIFY_PROC_WHITELIST_H_
#define NET_CERT_CERT_VERIFY_PROC_WHITELIST_H_
+#include <stddef.h>
#include <stdint.h>
#include "crypto/sha2.h"
diff --git a/net/cert/crl_set.h b/net/cert/crl_set.h
index f54e346..2a84d2ae1 100644
--- a/net/cert/crl_set.h
+++ b/net/cert/crl_set.h
@@ -5,6 +5,9 @@
#ifndef NET_CERT_CRL_SET_H_
#define NET_CERT_CRL_SET_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <utility>
#include <vector>
diff --git a/net/cert/ct_known_logs_static.h b/net/cert/ct_known_logs_static.h
index e87e5c4..a1e30f1f 100644
--- a/net/cert/ct_known_logs_static.h
+++ b/net/cert/ct_known_logs_static.h
@@ -6,6 +6,8 @@
#ifndef NET_CERT_CT_KNOWN_LOGS_STATIC_H_
#define NET_CERT_CT_KNOWN_LOGS_STATIC_H_
+#include <stddef.h>
+
struct CTLogInfo {
const char* const log_key;
const size_t log_key_length;
diff --git a/net/cert/ct_objects_extractor_nss.cc b/net/cert/ct_objects_extractor_nss.cc
index b4c1da3..09fe314 100644
--- a/net/cert/ct_objects_extractor_nss.cc
+++ b/net/cert/ct_objects_extractor_nss.cc
@@ -10,6 +10,7 @@
#include <secoid.h>
#include "base/lazy_instance.h"
+#include "base/macros.h"
#include "base/sha1.h"
#include "crypto/scoped_nss_types.h"
#include "crypto/sha2.h"
diff --git a/net/cert/ev_root_ca_metadata.h b/net/cert/ev_root_ca_metadata.h
index 10227a2..508e188 100644
--- a/net/cert/ev_root_ca_metadata.h
+++ b/net/cert/ev_root_ca_metadata.h
@@ -16,6 +16,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/cert/x509_certificate.h"
diff --git a/net/cert/internal/name_constraints.h b/net/cert/internal/name_constraints.h
index ae5f2a37..46cb0dad 100644
--- a/net/cert/internal/name_constraints.h
+++ b/net/cert/internal/name_constraints.h
@@ -5,6 +5,8 @@
#ifndef NET_CERT_INTERNAL_NAME_CONSTRAINTS_H_
#define NET_CERT_INTERNAL_NAME_CONSTRAINTS_H_
+#include <stdint.h>
+
#include <vector>
#include "base/compiler_specific.h"
diff --git a/net/cert/internal/parse_certificate.h b/net/cert/internal/parse_certificate.h
index 75f7700..e7a1670 100644
--- a/net/cert/internal/parse_certificate.h
+++ b/net/cert/internal/parse_certificate.h
@@ -5,9 +5,10 @@
#ifndef NET_CERT_INTERNAL_PARSE_CERTIFICATE_H_
#define NET_CERT_INTERNAL_PARSE_CERTIFICATE_H_
+#include <stdint.h>
+
#include <map>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "net/base/net_export.h"
#include "net/der/input.h"
diff --git a/net/cert/internal/signature_algorithm.h b/net/cert/internal/signature_algorithm.h
index 5d8141a..de35a29 100644
--- a/net/cert/internal/signature_algorithm.h
+++ b/net/cert/internal/signature_algorithm.h
@@ -7,8 +7,8 @@
#include <stdint.h>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/cert/internal/signature_policy.h b/net/cert/internal/signature_policy.h
index 72ff945..3acf17b9 100644
--- a/net/cert/internal/signature_policy.h
+++ b/net/cert/internal/signature_policy.h
@@ -5,6 +5,8 @@
#ifndef NET_CERT_INTERNAL_SIGNATURE_POLICY_H_
#define NET_CERT_INTERNAL_SIGNATURE_POLICY_H_
+#include <stddef.h>
+
#include "base/compiler_specific.h"
#include "net/base/net_export.h"
#include "net/cert/internal/signature_algorithm.h"
diff --git a/net/cert/internal/test_helpers.h b/net/cert/internal/test_helpers.h
index 9e76e54d..ad9ef18 100644
--- a/net/cert/internal/test_helpers.h
+++ b/net/cert/internal/test_helpers.h
@@ -5,6 +5,8 @@
#ifndef NET_CERT_INTERNAL_TEST_HELPERS_H_
#define NET_CERT_INTERNAL_TEST_HELPERS_H_
+#include <stddef.h>
+
#include <ostream>
#include <string>
#include <vector>
diff --git a/net/cert/internal/verify_certificate_chain.h b/net/cert/internal/verify_certificate_chain.h
index c0f8a2a..8f7e21f8 100644
--- a/net/cert/internal/verify_certificate_chain.h
+++ b/net/cert/internal/verify_certificate_chain.h
@@ -10,7 +10,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/cert/multi_log_ct_verifier.h b/net/cert/multi_log_ct_verifier.h
index 109d921..0d8667e 100644
--- a/net/cert/multi_log_ct_verifier.h
+++ b/net/cert/multi_log_ct_verifier.h
@@ -8,6 +8,7 @@
#include <map>
#include <string>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
#include "net/cert/ct_verifier.h"
diff --git a/net/cert/multi_threaded_cert_verifier.h b/net/cert/multi_threaded_cert_verifier.h
index fb8c3c5..30234ff9 100644
--- a/net/cert/multi_threaded_cert_verifier.h
+++ b/net/cert/multi_threaded_cert_verifier.h
@@ -5,7 +5,9 @@
#ifndef NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_
#define NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_
+#include <stddef.h>
#include <stdint.h>
+
#include <set>
#include <string>
#include <vector>
diff --git a/net/cert/nss_cert_database.cc b/net/cert/nss_cert_database.cc
index 3bfb4a5..3d37433 100644
--- a/net/cert/nss_cert_database.cc
+++ b/net/cert/nss_cert_database.cc
@@ -13,6 +13,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list_threadsafe.h"
#include "base/task_runner.h"
diff --git a/net/cert/nss_cert_database.h b/net/cert/nss_cert_database.h
index f67a4a3..ff96af0 100644
--- a/net/cert/nss_cert_database.h
+++ b/net/cert/nss_cert_database.h
@@ -6,6 +6,7 @@
#define NET_CERT_NSS_CERT_DATABASE_H_
#include <stdint.h>
+
#include <string>
#include <vector>
diff --git a/net/cert/nss_cert_database_chromeos.h b/net/cert/nss_cert_database_chromeos.h
index 930f9f23..4eb27a7 100644
--- a/net/cert/nss_cert_database_chromeos.h
+++ b/net/cert/nss_cert_database_chromeos.h
@@ -6,6 +6,7 @@
#define NET_CERT_NSS_CERT_DATABASE_CHROMEOS_
#include "base/callback.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "crypto/scoped_nss_types.h"
#include "net/base/net_export.h"
diff --git a/net/cert/pem_tokenizer.h b/net/cert/pem_tokenizer.h
index bb41c446..808acbd 100644
--- a/net/cert/pem_tokenizer.h
+++ b/net/cert/pem_tokenizer.h
@@ -5,9 +5,12 @@
#ifndef NET_CERT_PEM_TOKENIZER_H_
#define NET_CERT_PEM_TOKENIZER_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
diff --git a/net/cert/signed_certificate_timestamp.h b/net/cert/signed_certificate_timestamp.h
index 671c250..02697dc7 100644
--- a/net/cert/signed_certificate_timestamp.h
+++ b/net/cert/signed_certificate_timestamp.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "net/base/hash_value.h"
diff --git a/net/cert/signed_tree_head.h b/net/cert/signed_tree_head.h
index fdbcdc4..1613736 100644
--- a/net/cert/signed_tree_head.h
+++ b/net/cert/signed_tree_head.h
@@ -5,6 +5,8 @@
#ifndef NET_CERT_SIGNED_TREE_HEAD_H_
#define NET_CERT_SIGNED_TREE_HEAD_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
diff --git a/net/cert/test_root_certs.h b/net/cert/test_root_certs.h
index 32eb999..a7d0fd2 100644
--- a/net/cert/test_root_certs.h
+++ b/net/cert/test_root_certs.h
@@ -6,6 +6,7 @@
#define NET_CERT_TEST_ROOT_CERTS_H_
#include "base/lazy_instance.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "net/base/net_export.h"
diff --git a/net/cert/test_root_certs_nss.cc b/net/cert/test_root_certs_nss.cc
index f7d855c5..bcd4add 100644
--- a/net/cert/test_root_certs_nss.cc
+++ b/net/cert/test_root_certs_nss.cc
@@ -7,6 +7,7 @@
#include <cert.h>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/stl_util.h"
#include "crypto/nss_util.h"
#include "net/cert/x509_certificate.h"
diff --git a/net/cert/x509_cert_types.h b/net/cert/x509_cert_types.h
index 4e9340a..d2a55fe 100644
--- a/net/cert/x509_cert_types.h
+++ b/net/cert/x509_cert_types.h
@@ -5,6 +5,7 @@
#ifndef NET_CERT_X509_CERT_TYPES_H_
#define NET_CERT_X509_CERT_TYPES_H_
+#include <stddef.h>
#include <string.h>
#include <map>
diff --git a/net/cert/x509_certificate.cc b/net/cert/x509_certificate.cc
index 7f08f03..23786cf 100644
--- a/net/cert/x509_certificate.cc
+++ b/net/cert/x509_certificate.cc
@@ -14,6 +14,7 @@
#include "base/base64.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/metrics/histogram_macros.h"
diff --git a/net/cert/x509_certificate.h b/net/cert/x509_certificate.h
index 7904722f..c22a0d5 100644
--- a/net/cert/x509_certificate.h
+++ b/net/cert/x509_certificate.h
@@ -5,12 +5,14 @@
#ifndef NET_CERT_X509_CERTIFICATE_H_
#define NET_CERT_X509_CERTIFICATE_H_
+#include <stddef.h>
#include <string.h>
#include <string>
#include <vector>
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_piece.h"
#include "base/time/time.h"
diff --git a/net/cert/x509_certificate_known_roots_win.h b/net/cert/x509_certificate_known_roots_win.h
index ce7dce8..995ee13 100644
--- a/net/cert/x509_certificate_known_roots_win.h
+++ b/net/cert/x509_certificate_known_roots_win.h
@@ -5,6 +5,8 @@
#ifndef NET_CERT_X509_CERTIFICATE_KNOWN_ROOTS_WIN_H_
#define NET_CERT_X509_CERTIFICATE_KNOWN_ROOTS_WIN_H_
+#include <stdint.h>
+
// This is a union of Microsoft trust roots over time, from 29 April
// 2013 through 15 May 2015.
//
diff --git a/net/cert/x509_certificate_openssl.cc b/net/cert/x509_certificate_openssl.cc
index 5084fb5..ec31e6e 100644
--- a/net/cert/x509_certificate_openssl.cc
+++ b/net/cert/x509_certificate_openssl.cc
@@ -13,6 +13,7 @@
#include <openssl/ssl.h>
#include <openssl/x509v3.h>
+#include "base/macros.h"
#include "base/memory/singleton.h"
#include "base/numerics/safe_conversions.h"
#include "base/pickle.h"
diff --git a/net/cert/x509_util.h b/net/cert/x509_util.h
index 816a3c5..fb8c20f0 100644
--- a/net/cert/x509_util.h
+++ b/net/cert/x509_util.h
@@ -6,6 +6,7 @@
#define NET_CERT_X509_UTIL_H_
#include <stdint.h>
+
#include <string>
#include "base/memory/ref_counted.h"
diff --git a/net/cert/x509_util_nss.h b/net/cert/x509_util_nss.h
index 060b6e3..55e562ef 100644
--- a/net/cert/x509_util_nss.h
+++ b/net/cert/x509_util_nss.h
@@ -5,6 +5,8 @@
#ifndef NET_CERT_X509_UTIL_NSS_H_
#define NET_CERT_X509_UTIL_NSS_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
diff --git a/net/cert/x509_util_openssl.cc b/net/cert/x509_util_openssl.cc
index 4d0c5d85..7eb86a4 100644
--- a/net/cert/x509_util_openssl.cc
+++ b/net/cert/x509_util_openssl.cc
@@ -11,6 +11,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "crypto/ec_private_key.h"
diff --git a/net/cert_net/cert_net_fetcher_impl.cc b/net/cert_net/cert_net_fetcher_impl.cc
index bec90b2..7fcce5a 100644
--- a/net/cert_net/cert_net_fetcher_impl.cc
+++ b/net/cert_net/cert_net_fetcher_impl.cc
@@ -9,6 +9,7 @@
#include "base/callback_helpers.h"
#include "base/containers/linked_list.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/numerics/safe_math.h"
#include "base/stl_util.h"
#include "base/timer/timer.h"
diff --git a/net/cert_net/cert_net_fetcher_impl.h b/net/cert_net/cert_net_fetcher_impl.h
index ac5cd90..c3a1fb6 100644
--- a/net/cert_net/cert_net_fetcher_impl.h
+++ b/net/cert_net/cert_net_fetcher_impl.h
@@ -8,6 +8,7 @@
#include <set>
#include "base/callback.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread_checker.h"
#include "net/base/net_errors.h"
diff --git a/net/cert_net/nss_ocsp.cc b/net/cert_net/nss_ocsp.cc
index 835993f8..1c74d475 100644
--- a/net/cert_net/nss_ocsp.cc
+++ b/net/cert_net/nss_ocsp.cc
@@ -15,12 +15,12 @@
#include <algorithm>
#include <string>
-#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
diff --git a/net/cert_net/nss_ocsp_unittest.cc b/net/cert_net/nss_ocsp_unittest.cc
index 29adebc..b43b770 100644
--- a/net/cert_net/nss_ocsp_unittest.cc
+++ b/net/cert_net/nss_ocsp_unittest.cc
@@ -9,6 +9,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc
index fafb334..2eead173 100644
--- a/net/cookies/canonical_cookie.cc
+++ b/net/cookies/canonical_cookie.cc
@@ -44,7 +44,6 @@
#include "net/cookies/canonical_cookie.h"
-#include "base/basictypes.h"
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
@@ -194,7 +193,7 @@
const Time& current,
const Time& server_time) {
// First, try the Max-Age attribute.
- uint64 max_age = 0;
+ uint64_t max_age = 0;
if (pc.HasMaxAge() &&
#ifdef COMPILER_MSVC
sscanf_s(
@@ -432,11 +431,9 @@
std::string CanonicalCookie::DebugString() const {
return base::StringPrintf(
- "name: %s value: %s domain: %s path: %s creation: %"
- PRId64,
- name_.c_str(), value_.c_str(),
- domain_.c_str(), path_.c_str(),
- static_cast<int64>(creation_date_.ToTimeT()));
+ "name: %s value: %s domain: %s path: %s creation: %" PRId64,
+ name_.c_str(), value_.c_str(), domain_.c_str(), path_.c_str(),
+ static_cast<int64_t>(creation_date_.ToTimeT()));
}
bool CanonicalCookie::PartialCompare(const CanonicalCookie& other) const {
diff --git a/net/cookies/canonical_cookie.h b/net/cookies/canonical_cookie.h
index db26fda..9c3a1c9c 100644
--- a/net/cookies/canonical_cookie.h
+++ b/net/cookies/canonical_cookie.h
@@ -8,7 +8,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
diff --git a/net/cookies/cookie_constants_unittest.cc b/net/cookies/cookie_constants_unittest.cc
index 87fa1c1b..53cdc52 100644
--- a/net/cookies/cookie_constants_unittest.cc
+++ b/net/cookies/cookie_constants_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/cookies/cookie_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index 03b2e9434..2227711 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -48,11 +48,11 @@
#include <functional>
#include <set>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
@@ -1573,7 +1573,7 @@
for (std::vector<CanonicalCookie*>::const_iterator it = cookies.begin();
it != cookies.end(); ++it) {
- int64 cookie_creation_time = (*it)->CreationDate().ToInternalValue();
+ int64_t cookie_creation_time = (*it)->CreationDate().ToInternalValue();
if (creation_times_.insert(cookie_creation_time).second) {
CookieMap::iterator inserted =
diff --git a/net/cookies/cookie_monster.h b/net/cookies/cookie_monster.h
index 20d3f4f1..94c3813 100644
--- a/net/cookies/cookie_monster.h
+++ b/net/cookies/cookie_monster.h
@@ -7,6 +7,9 @@
#ifndef NET_COOKIES_COOKIE_MONSTER_H_
#define NET_COOKIES_COOKIE_MONSTER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <deque>
#include <map>
#include <queue>
@@ -15,9 +18,9 @@
#include <utility>
#include <vector>
-#include "base/basictypes.h"
#include "base/callback_forward.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -787,7 +790,7 @@
// avoid ever letting cookies with duplicate creation times into the store;
// that way we don't have to worry about what sections of code are safe
// to call while it's in that state.
- std::set<int64> creation_times_;
+ std::set<int64_t> creation_times_;
std::vector<std::string> cookieable_schemes_;
diff --git a/net/cookies/cookie_monster_perftest.cc b/net/cookies/cookie_monster_perftest.cc
index cb7c1c2..dd35638e 100644
--- a/net/cookies/cookie_monster_perftest.cc
+++ b/net/cookies/cookie_monster_perftest.cc
@@ -284,7 +284,7 @@
// We want to setup a fairly large backing store, with 300 domains of 50
// cookies each. Creation times must be unique.
- int64 time_tick(base::Time::Now().ToInternalValue());
+ int64_t time_tick(base::Time::Now().ToInternalValue());
for (int domain_num = 0; domain_num < 300; domain_num++) {
std::string domain_name(base::StringPrintf(".Domain_%d.com", domain_num));
diff --git a/net/cookies/cookie_monster_store_test.cc b/net/cookies/cookie_monster_store_test.cc
index 3a369734..8c004ef6 100644
--- a/net/cookies/cookie_monster_store_test.cc
+++ b/net/cookies/cookie_monster_store_test.cc
@@ -168,21 +168,21 @@
}
void MockSimplePersistentCookieStore::AddCookie(const CanonicalCookie& cookie) {
- int64 creation_time = cookie.CreationDate().ToInternalValue();
+ int64_t creation_time = cookie.CreationDate().ToInternalValue();
EXPECT_TRUE(cookies_.find(creation_time) == cookies_.end());
cookies_[creation_time] = cookie;
}
void MockSimplePersistentCookieStore::UpdateCookieAccessTime(
const CanonicalCookie& cookie) {
- int64 creation_time = cookie.CreationDate().ToInternalValue();
+ int64_t creation_time = cookie.CreationDate().ToInternalValue();
ASSERT_TRUE(cookies_.find(creation_time) != cookies_.end());
cookies_[creation_time].SetLastAccessDate(base::Time::Now());
}
void MockSimplePersistentCookieStore::DeleteCookie(
const CanonicalCookie& cookie) {
- int64 creation_time = cookie.CreationDate().ToInternalValue();
+ int64_t creation_time = cookie.CreationDate().ToInternalValue();
CanonicalCookieMap::iterator it = cookies_.find(creation_time);
ASSERT_TRUE(it != cookies_.end());
cookies_.erase(it);
diff --git a/net/cookies/cookie_monster_store_test.h b/net/cookies/cookie_monster_store_test.h
index 083677e..686bb07a 100644
--- a/net/cookies/cookie_monster_store_test.h
+++ b/net/cookies/cookie_monster_store_test.h
@@ -10,10 +10,14 @@
#ifndef NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_
#define NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_
+#include <stdint.h>
+
#include <map>
#include <string>
#include <utility>
#include <vector>
+
+#include "base/macros.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_monster.h"
@@ -166,7 +170,7 @@
~MockSimplePersistentCookieStore() override;
private:
- typedef std::map<int64, CanonicalCookie> CanonicalCookieMap;
+ typedef std::map<int64_t, CanonicalCookie> CanonicalCookieMap;
CanonicalCookieMap cookies_;
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index bd4c8d89..efeadd9 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -8,7 +8,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
@@ -1936,11 +1935,11 @@
// Now we check
CookieList cookie_list(GetAllCookies(cm.get()));
EXPECT_EQ(9u, cookie_list.size());
- typedef std::map<int64, CanonicalCookie> TimeCookieMap;
+ typedef std::map<int64_t, CanonicalCookie> TimeCookieMap;
TimeCookieMap check_map;
for (CookieList::const_iterator it = cookie_list.begin();
it != cookie_list.end(); it++) {
- const int64 creation_date = it->CreationDate().ToInternalValue();
+ const int64_t creation_date = it->CreationDate().ToInternalValue();
TimeCookieMap::const_iterator existing_cookie_it(
check_map.find(creation_date));
EXPECT_TRUE(existing_cookie_it == check_map.end())
diff --git a/net/cookies/cookie_store.h b/net/cookies/cookie_store.h
index 9f5e1f19..e2e2440 100644
--- a/net/cookies/cookie_store.h
+++ b/net/cookies/cookie_store.h
@@ -10,7 +10,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/callback.h"
#include "base/callback_list.h"
#include "base/memory/ref_counted.h"
diff --git a/net/cookies/cookie_util_unittest.cc b/net/cookies/cookie_util_unittest.cc
index e76d8c9..5414be1 100644
--- a/net/cookies/cookie_util_unittest.cc
+++ b/net/cookies/cookie_util_unittest.cc
@@ -5,7 +5,6 @@
#include <string>
#include <utility>
-#include "base/basictypes.h"
#include "base/strings/string_split.h"
#include "net/cookies/cookie_util.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/cookies/parsed_cookie.h b/net/cookies/parsed_cookie.h
index 029728d..8317609 100644
--- a/net/cookies/parsed_cookie.h
+++ b/net/cookies/parsed_cookie.h
@@ -5,10 +5,12 @@
#ifndef NET_COOKIES_PARSED_COOKIE_H_
#define NET_COOKIES_PARSED_COOKIE_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/cookies/cookie_constants.h"
diff --git a/net/der/input.h b/net/der/input.h
index b5d1eb66..3772d0d 100644
--- a/net/der/input.h
+++ b/net/der/input.h
@@ -5,7 +5,9 @@
#ifndef NET_DER_INPUT_H_
#define NET_DER_INPUT_H_
+#include <stddef.h>
#include <stdint.h>
+
#include <string>
#include "base/compiler_specific.h"
diff --git a/net/der/parse_values.h b/net/der/parse_values.h
index a4ea8aa..4f50356 100644
--- a/net/der/parse_values.h
+++ b/net/der/parse_values.h
@@ -5,6 +5,8 @@
#ifndef NET_DER_PARSE_VALUES_H_
#define NET_DER_PARSE_VALUES_H_
+#include <stdint.h>
+
#include "base/compiler_specific.h"
#include "net/base/net_export.h"
#include "net/der/input.h"
diff --git a/net/der/parser.h b/net/der/parser.h
index 37f1f85..2192371d 100644
--- a/net/der/parser.h
+++ b/net/der/parser.h
@@ -5,7 +5,10 @@
#ifndef NET_DER_PARSER_H_
#define NET_DER_PARSER_H_
+#include <stdint.h>
+
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
#include "net/der/input.h"
@@ -146,7 +149,7 @@
// Expects the current tag to be kInteger, and calls ParseUint64 on the
// current value. Note that DER-encoded integers are arbitrary precision,
// so this method will fail for valid input that represents an integer
- // outside the range of an int64.
+ // outside the range of an int64_t.
//
// Note that on failure the Parser is left in an undefined state (the
// input may or may not have been advanced).
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index 7bb6046..2d36def0 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -4,7 +4,6 @@
#include <stdint.h>
-#include "base/basictypes.h"
#include "base/files/file_util.h"
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
@@ -521,7 +520,7 @@
// Tests that we deal with file-level pending operations at destruction time.
void DiskCacheBackendTest::BackendShutdownWithPendingFileIO(bool fast) {
ASSERT_TRUE(CleanupCacheDir());
- uint32 flags = disk_cache::kNoBuffering;
+ uint32_t flags = disk_cache::kNoBuffering;
if (!fast)
flags |= disk_cache::kNoRandom;
@@ -623,7 +622,7 @@
ASSERT_TRUE(cache_thread.StartWithOptions(
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)));
- uint32 flags = disk_cache::kNoBuffering;
+ uint32_t flags = disk_cache::kNoBuffering;
if (!fast)
flags |= disk_cache::kNoRandom;
@@ -1774,7 +1773,7 @@
ASSERT_TRUE(CopyTestCache(name));
DisableFirstCleanup();
- uint32 mask;
+ uint32_t mask;
if (load) {
mask = 0xf;
SetMaxSize(0x100000);
@@ -3075,7 +3074,7 @@
// Test the six regions of the curve that determines the max cache size.
TEST_F(DiskCacheTest, AutomaticMaxSize) {
using disk_cache::kDefaultCacheSize;
- int64 large_size = kDefaultCacheSize;
+ int64_t large_size = kDefaultCacheSize;
// Region 1: expected = available * 0.8
EXPECT_EQ((kDefaultCacheSize - 1) * 8 / 10,
@@ -3108,7 +3107,7 @@
disk_cache::PreferredCacheSize(large_size * 250 - 1));
// Region 5: expected = available * 0.1
- int64 largest_size = kDefaultCacheSize * 4;
+ int64_t largest_size = kDefaultCacheSize * 4;
EXPECT_EQ(kDefaultCacheSize * 25 / 10,
disk_cache::PreferredCacheSize(large_size * 250));
EXPECT_EQ(largest_size - 1,
diff --git a/net/disk_cache/blockfile/addr_unittest.cc b/net/disk_cache/blockfile/addr_unittest.cc
index eaed659..b62e31f 100644
--- a/net/disk_cache/blockfile/addr_unittest.cc
+++ b/net/disk_cache/blockfile/addr_unittest.cc
@@ -13,7 +13,7 @@
EXPECT_FALSE(addr1.is_initialized());
// The object should not be more expensive than the actual address.
- EXPECT_EQ(sizeof(uint32), sizeof(addr1));
+ EXPECT_EQ(sizeof(uint32_t), sizeof(addr1));
}
TEST_F(DiskCacheTest, CacheAddr_ValidValues) {
diff --git a/net/disk_cache/blockfile/backend_impl.h b/net/disk_cache/blockfile/backend_impl.h
index c5177a2..89edef2e 100644
--- a/net/disk_cache/blockfile/backend_impl.h
+++ b/net/disk_cache/blockfile/backend_impl.h
@@ -11,6 +11,7 @@
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/timer/timer.h"
#include "net/disk_cache/blockfile/block_files.h"
diff --git a/net/disk_cache/blockfile/backend_impl_v3.h b/net/disk_cache/blockfile/backend_impl_v3.h
index d935a9db..df51c21 100644
--- a/net/disk_cache/blockfile/backend_impl_v3.h
+++ b/net/disk_cache/blockfile/backend_impl_v3.h
@@ -11,6 +11,7 @@
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/timer/timer.h"
#include "net/disk_cache/blockfile/block_bitmaps_v3.h"
diff --git a/net/disk_cache/blockfile/backend_worker_v3.cc b/net/disk_cache/blockfile/backend_worker_v3.cc
index 2fddb9b8..897ee3c 100644
--- a/net/disk_cache/blockfile/backend_worker_v3.cc
+++ b/net/disk_cache/blockfile/backend_worker_v3.cc
@@ -42,7 +42,7 @@
// Avoid trimming the cache for the first 5 minutes (10 timer ticks).
const int kTrimDelay = 10;
-int DesiredIndexTableLen(int32 storage_size) {
+int DesiredIndexTableLen(int32_t storage_size) {
if (storage_size <= k64kEntriesStore)
return kBaseTableLen;
if (storage_size <= k64kEntriesStore * 2)
@@ -52,7 +52,7 @@
if (storage_size <= k64kEntriesStore * 8)
return kBaseTableLen * 8;
- // The biggest storage_size for int32 requires a 4 MB table.
+ // The biggest storage_size for int32_t requires a 4 MB table.
return kBaseTableLen * 16;
}
diff --git a/net/disk_cache/blockfile/backend_worker_v3.h b/net/disk_cache/blockfile/backend_worker_v3.h
index 6874228..fc8b317 100644
--- a/net/disk_cache/blockfile/backend_worker_v3.h
+++ b/net/disk_cache/blockfile/backend_worker_v3.h
@@ -9,6 +9,7 @@
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/disk_cache/blockfile/addr.h"
#include "net/disk_cache/blockfile/backend_impl_v3.h"
diff --git a/net/disk_cache/blockfile/bitmap.cc b/net/disk_cache/blockfile/bitmap.cc
index cfbf8460..7e241bca 100644
--- a/net/disk_cache/blockfile/bitmap.cc
+++ b/net/disk_cache/blockfile/bitmap.cc
@@ -11,7 +11,7 @@
namespace {
// Returns the number of trailing zeros.
-int FindLSBSetNonZero(uint32 word) {
+int FindLSBSetNonZero(uint32_t word) {
// Get the LSB, put it on the exponent of a 32 bit float and remove the
// mantisa and the bias. This code requires IEEE 32 bit float compliance.
float f = static_cast<float>(word & -static_cast<int>(word));
@@ -19,7 +19,7 @@
// We use a union to go around strict-aliasing complains.
union {
float ieee_float;
- uint32 as_uint;
+ uint32_t as_uint;
} x;
x.ieee_float = f;
@@ -28,7 +28,7 @@
// Returns the index of the first bit set to |value| from |word|. This code
// assumes that we'll be able to find that bit.
-int FindLSBNonEmpty(uint32 word, bool value) {
+int FindLSBNonEmpty(uint32_t word, bool value) {
// If we are looking for 0, negate |word| and look for 1.
if (!value)
word = ~word;
@@ -44,21 +44,20 @@
: num_bits_(num_bits),
array_size_(RequiredArraySize(num_bits)),
alloc_(true) {
- map_ = new uint32[array_size_];
+ map_ = new uint32_t[array_size_];
// Initialize all of the bits.
if (clear_bits)
Clear();
}
-Bitmap::Bitmap(uint32* map, int num_bits, int num_words)
+Bitmap::Bitmap(uint32_t* map, int num_bits, int num_words)
: map_(map),
num_bits_(num_bits),
// If size is larger than necessary, trim because array_size_ is used
// as a bound by various methods.
array_size_(std::min(RequiredArraySize(num_bits), num_words)),
- alloc_(false) {
-}
+ alloc_(false) {}
Bitmap::~Bitmap() {
if (alloc_)
@@ -72,7 +71,7 @@
array_size_ = RequiredArraySize(num_bits);
if (array_size_ != old_array_size) {
- uint32* new_map = new uint32[array_size_];
+ uint32_t* new_map = new uint32_t[array_size_];
// Always clear the unused bits in the last word.
new_map[array_size_ - 1] = 0;
memcpy(new_map, map_,
@@ -116,19 +115,19 @@
map_[j] ^= (1 << i);
}
-void Bitmap::SetMapElement(int array_index, uint32 value) {
+void Bitmap::SetMapElement(int array_index, uint32_t value) {
DCHECK_LT(array_index, array_size_);
DCHECK_GE(array_index, 0);
map_[array_index] = value;
}
-uint32 Bitmap::GetMapElement(int array_index) const {
+uint32_t Bitmap::GetMapElement(int array_index) const {
DCHECK_LT(array_index, array_size_);
DCHECK_GE(array_index, 0);
return map_[array_index];
}
-void Bitmap::SetMap(const uint32* map, int size) {
+void Bitmap::SetMap(const uint32_t* map, int size) {
memcpy(map_, map, std::min(size, array_size_) * sizeof(*map_));
}
@@ -176,7 +175,7 @@
int last_offset = (end - 1) & (kIntBits - 1);
// If we are looking for zeros, negate the data from the map.
- uint32 this_word = map_[word];
+ uint32_t this_word = map_[word];
if (!value)
this_word = ~this_word;
@@ -200,7 +199,7 @@
// Test the portion of the last word that lies within the range. (This logic
// also handles the case where the entire range lies within a single word.)
- const uint32 mask = ((2 << (last_offset - offset)) - 1) << offset;
+ const uint32_t mask = ((2 << (last_offset - offset)) - 1) << offset;
this_word = map_[last_word];
if (!value)
@@ -222,7 +221,7 @@
// From now on limit != 0, since if it was we would have returned false.
int word_index = bit_index >> kLogIntBits;
- uint32 one_word = map_[word_index];
+ uint32_t one_word = map_[word_index];
// Simple optimization where we can immediately return true if the first
// bit is set. This helps for cases where many bits are set, and doesn't
@@ -233,14 +232,14 @@
const int first_bit_offset = bit_index & (kIntBits - 1);
// First word is special - we need to mask off leading bits.
- uint32 mask = 0xFFFFFFFF << first_bit_offset;
+ uint32_t mask = 0xFFFFFFFF << first_bit_offset;
if (value) {
one_word &= mask;
} else {
one_word |= ~mask;
}
- uint32 empty_value = value ? 0 : 0xFFFFFFFF;
+ uint32_t empty_value = value ? 0 : 0xFFFFFFFF;
// Loop through all but the last word. Note that 'limit' is one
// past the last bit we want to check, and we don't want to read
@@ -299,7 +298,7 @@
int word = start / kIntBits;
int offset = start % kIntBits;
- uint32 to_add = 0xffffffff << len;
+ uint32_t to_add = 0xffffffff << len;
to_add = (~to_add) << offset;
if (value) {
map_[word] |= to_add;
diff --git a/net/disk_cache/blockfile/bitmap.h b/net/disk_cache/blockfile/bitmap.h
index dc05157..54e4162 100644
--- a/net/disk_cache/blockfile/bitmap.h
+++ b/net/disk_cache/blockfile/bitmap.h
@@ -5,7 +5,9 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_BITMAP_H_
#define NET_DISK_CACHE_BLOCKFILE_BITMAP_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/base/net_export.h"
namespace disk_cache {
@@ -15,14 +17,14 @@
public:
Bitmap() : map_(NULL), num_bits_(0), array_size_(0), alloc_(false) {}
- // This constructor will allocate on a uint32 boundary. If |clear_bits| is
+ // This constructor will allocate on a uint32_t boundary. If |clear_bits| is
// false, the bitmap bits will not be initialized.
Bitmap(int num_bits, bool clear_bits);
// Constructs a Bitmap with the actual storage provided by the caller. |map|
// has to be valid until this object destruction. |num_bits| is the number of
// bits in the bitmap, and |num_words| is the size of |map| in 32-bit words.
- Bitmap(uint32* map, int num_bits, int num_words);
+ Bitmap(uint32_t* map, int num_bits, int num_words);
~Bitmap();
@@ -54,18 +56,18 @@
// Directly sets an element of the internal map. Requires |array_index| <
// ArraySize();
- void SetMapElement(int array_index, uint32 value);
+ void SetMapElement(int array_index, uint32_t value);
// Gets an entry of the internal map. Requires array_index <
// ArraySize()
- uint32 GetMapElement(int array_index) const;
+ uint32_t GetMapElement(int array_index) const;
// Directly sets the whole internal map. |size| is the number of 32-bit words
// to set from |map|. If |size| > array_size(), it ignores the end of |map|.
- void SetMap(const uint32* map, int size);
+ void SetMap(const uint32_t* map, int size);
// Gets a pointer to the internal map.
- const uint32* GetMap() const { return map_; }
+ const uint32_t* GetMap() const { return map_; }
// Sets a range of bits to |value|.
void SetRange(int begin, int end, bool value);
@@ -116,14 +118,14 @@
}
private:
- static const int kIntBits = sizeof(uint32) * 8;
+ static const int kIntBits = sizeof(uint32_t) * 8;
static const int kLogIntBits = 5; // 2^5 == 32 bits per word.
// Sets |len| bits from |start| to |value|. All the bits to be set should be
// stored in the same word, and len < kIntBits.
void SetWordBits(int start, int len, bool value);
- uint32* map_; // The bitmap.
+ uint32_t* map_; // The bitmap.
int num_bits_; // The upper bound of the bitmap.
int array_size_; // The physical size (in uint32s) of the bitmap.
bool alloc_; // Whether or not we allocated the memory.
diff --git a/net/disk_cache/blockfile/bitmap_unittest.cc b/net/disk_cache/blockfile/bitmap_unittest.cc
index a0748bf..29d8739 100644
--- a/net/disk_cache/blockfile/bitmap_unittest.cc
+++ b/net/disk_cache/blockfile/bitmap_unittest.cc
@@ -24,7 +24,7 @@
TEST(BitmapTest, Basics) {
disk_cache::Bitmap bitmap(80, true);
- const uint32 kValue = 0x74f10060;
+ const uint32_t kValue = 0x74f10060;
// Test proper allocation size.
EXPECT_EQ(80, bitmap.Size());
@@ -94,7 +94,7 @@
local_map[i] = static_cast<char>(i);
disk_cache::Bitmap bitmap(kMapSize * 8, false);
- bitmap.SetMap(reinterpret_cast<uint32*>(local_map), kMapSize / 4);
+ bitmap.SetMap(reinterpret_cast<uint32_t*>(local_map), kMapSize / 4);
for (int i = 0; i < kMapSize; i++) {
if (i % 2)
EXPECT_TRUE(bitmap.Get(i * 8));
@@ -105,7 +105,7 @@
EXPECT_EQ(0, memcmp(local_map, bitmap.GetMap(), kMapSize));
// Now let's create a bitmap that shares local_map as storage.
- disk_cache::Bitmap bitmap2(reinterpret_cast<uint32*>(local_map),
+ disk_cache::Bitmap bitmap2(reinterpret_cast<uint32_t*>(local_map),
kMapSize * 8, kMapSize / 4);
EXPECT_EQ(0, memcmp(local_map, bitmap2.GetMap(), kMapSize));
diff --git a/net/disk_cache/blockfile/block_bitmaps_v3.cc b/net/disk_cache/blockfile/block_bitmaps_v3.cc
index 21a52c9..70208ae 100644
--- a/net/disk_cache/blockfile/block_bitmaps_v3.cc
+++ b/net/disk_cache/blockfile/block_bitmaps_v3.cc
@@ -71,7 +71,7 @@
void BlockBitmaps::ReportStats() {
int used_blocks[kFirstAdditionalBlockFile];
int load[kFirstAdditionalBlockFile];
- for (int16 i = 0; i < kFirstAdditionalBlockFile; i++) {
+ for (int16_t i = 0; i < kFirstAdditionalBlockFile; i++) {
GetFileStats(i, &used_blocks[i], &load[i]);
}
UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_0", used_blocks[0]);
diff --git a/net/disk_cache/blockfile/block_bitmaps_v3.h b/net/disk_cache/blockfile/block_bitmaps_v3.h
index 40eefb1..b2ca4614 100644
--- a/net/disk_cache/blockfile/block_bitmaps_v3.h
+++ b/net/disk_cache/blockfile/block_bitmaps_v3.h
@@ -8,6 +8,7 @@
#define NET_DISK_CACHE_BLOCKFILE_BLOCK_BITMAPS_V3_H_
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/disk_cache/blockfile/addr.h"
#include "net/disk_cache/blockfile/block_files.h"
diff --git a/net/disk_cache/blockfile/block_bitmaps_v3_unittest.cc b/net/disk_cache/blockfile/block_bitmaps_v3_unittest.cc
index bf22d882..64ca115c 100644
--- a/net/disk_cache/blockfile/block_bitmaps_v3_unittest.cc
+++ b/net/disk_cache/blockfile/block_bitmaps_v3_unittest.cc
@@ -19,7 +19,7 @@
memset(&headers[i], 0, sizeof(headers[i]));
headers[i].magic = disk_cache::kBlockMagic;
headers[i].version = disk_cache::kBlockCurrentVersion;
- headers[i].this_file = static_cast<int16>(i);
+ headers[i].this_file = static_cast<int16_t>(i);
headers[i].empty[3] = 200;
headers[i].max_entries = 800;
bitmaps.push_back(disk_cache::BlockHeader(&headers[i]));
@@ -51,7 +51,7 @@
// The first part of the allocation map should be completely filled. We used
// 10 bits per each of four entries, so 250 bits total. All entries should go
// to the third file.
- uint8* buffer = reinterpret_cast<uint8*>(&headers[2].allocation_map);
+ uint8_t* buffer = reinterpret_cast<uint8_t*>(&headers[2].allocation_map);
for (int i = 0; i < 29; i++) {
SCOPED_TRACE(i);
EXPECT_EQ(0xff, buffer[i]);
diff --git a/net/disk_cache/blockfile/block_files.h b/net/disk_cache/blockfile/block_files.h
index 1cc700c..1de3bed 100644
--- a/net/disk_cache/blockfile/block_files.h
+++ b/net/disk_cache/blockfile/block_files.h
@@ -13,6 +13,7 @@
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/disk_cache/blockfile/addr.h"
diff --git a/net/disk_cache/blockfile/block_files_unittest.cc b/net/disk_cache/blockfile/block_files_unittest.cc
index 343485a..ca1e019 100644
--- a/net/disk_cache/blockfile/block_files_unittest.cc
+++ b/net/disk_cache/blockfile/block_files_unittest.cc
@@ -329,7 +329,7 @@
// 10 bits per each four entries, so 250 bits total.
BlockFileHeader* header =
reinterpret_cast<BlockFileHeader*>(files.GetFile(address[0])->buffer());
- uint8* buffer = reinterpret_cast<uint8*>(&header->allocation_map);
+ uint8_t* buffer = reinterpret_cast<uint8_t*>(&header->allocation_map);
for (int i =0; i < 29; i++) {
SCOPED_TRACE(i);
EXPECT_EQ(0xff, buffer[i]);
diff --git a/net/disk_cache/blockfile/disk_cache_perftest.cc b/net/disk_cache/blockfile/disk_cache_perftest.cc
index 9aaa7f4..80806532 100644
--- a/net/disk_cache/blockfile/disk_cache_perftest.cc
+++ b/net/disk_cache/blockfile/disk_cache_perftest.cc
@@ -4,7 +4,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/hash.h"
diff --git a/net/disk_cache/blockfile/disk_format.h b/net/disk_cache/blockfile/disk_format.h
index b2e666a..a621ec1 100644
--- a/net/disk_cache/blockfile/disk_format.h
+++ b/net/disk_cache/blockfile/disk_format.h
@@ -45,44 +45,47 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_DISK_FORMAT_H_
#define NET_DISK_CACHE_BLOCKFILE_DISK_FORMAT_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
#include "net/base/net_export.h"
#include "net/disk_cache/blockfile/disk_format_base.h"
namespace disk_cache {
const int kIndexTablesize = 0x10000;
-const uint32 kIndexMagic = 0xC103CAC3;
-const uint32 kCurrentVersion = 0x20000; // Version 2.0.
+const uint32_t kIndexMagic = 0xC103CAC3;
+const uint32_t kCurrentVersion = 0x20000; // Version 2.0.
struct LruData {
- int32 pad1[2];
- int32 filled; // Flag to tell when we filled the cache.
- int32 sizes[5];
+ int32_t pad1[2];
+ int32_t filled; // Flag to tell when we filled the cache.
+ int32_t sizes[5];
CacheAddr heads[5];
CacheAddr tails[5];
CacheAddr transaction; // In-flight operation target.
- int32 operation; // Actual in-flight operation.
- int32 operation_list; // In-flight operation list.
- int32 pad2[7];
+ int32_t operation; // Actual in-flight operation.
+ int32_t operation_list; // In-flight operation list.
+ int32_t pad2[7];
};
// Header for the master index file.
struct NET_EXPORT_PRIVATE IndexHeader {
IndexHeader();
- uint32 magic;
- uint32 version;
- int32 num_entries; // Number of entries currently stored.
- int32 num_bytes; // Total size of the stored data.
- int32 last_file; // Last external file created.
- int32 this_id; // Id for all entries being changed (dirty flag).
+ uint32_t magic;
+ uint32_t version;
+ int32_t num_entries; // Number of entries currently stored.
+ int32_t num_bytes; // Total size of the stored data.
+ int32_t last_file; // Last external file created.
+ int32_t this_id; // Id for all entries being changed (dirty flag).
CacheAddr stats; // Storage for usage data.
- int32 table_len; // Actual size of the table (0 == kIndexTablesize).
- int32 crash; // Signals a previous crash.
- int32 experiment; // Id of an ongoing test.
- uint64 create_time; // Creation time for this set of files.
- int32 pad[52];
+ int32_t table_len; // Actual size of the table (0 == kIndexTablesize).
+ int32_t crash; // Signals a previous crash.
+ int32_t experiment; // Id of an ongoing test.
+ uint64_t create_time; // Creation time for this set of files.
+ int32_t pad[52];
LruData lru; // Eviction control data.
};
@@ -99,20 +102,20 @@
// After that point, the whole key will be stored as a data block or external
// file.
struct EntryStore {
- uint32 hash; // Full hash of the key.
+ uint32_t hash; // Full hash of the key.
CacheAddr next; // Next entry with the same hash or bucket.
CacheAddr rankings_node; // Rankings node for this entry.
- int32 reuse_count; // How often is this entry used.
- int32 refetch_count; // How often is this fetched from the net.
- int32 state; // Current state.
- uint64 creation_time;
- int32 key_len;
+ int32_t reuse_count; // How often is this entry used.
+ int32_t refetch_count; // How often is this fetched from the net.
+ int32_t state; // Current state.
+ uint64_t creation_time;
+ int32_t key_len;
CacheAddr long_key; // Optional address of a long key.
- int32 data_size[4]; // We can store up to 4 data streams for each
+ int32_t data_size[4]; // We can store up to 4 data streams for each
CacheAddr data_addr[4]; // entry.
- uint32 flags; // Any combination of EntryFlags.
- int32 pad[4];
- uint32 self_hash; // The hash of EntryStore up to this point.
+ uint32_t flags; // Any combination of EntryFlags.
+ int32_t pad[4];
+ uint32_t self_hash; // The hash of EntryStore up to this point.
char key[256 - 24 * 4]; // null terminated
};
@@ -136,13 +139,13 @@
#pragma pack(push, 4)
// Rankings information for a given entry.
struct RankingsNode {
- uint64 last_used; // LRU info.
- uint64 last_modified; // LRU info.
+ uint64_t last_used; // LRU info.
+ uint64_t last_modified; // LRU info.
CacheAddr next; // LRU list.
CacheAddr prev; // LRU list.
CacheAddr contents; // Address of the EntryStore.
- int32 dirty; // The entry is being modifyied.
- uint32 self_hash; // RankingsNode's hash.
+ int32_t dirty; // The entry is being modifyied.
+ uint32_t self_hash; // RankingsNode's hash.
};
#pragma pack(pop)
diff --git a/net/disk_cache/blockfile/disk_format_v3.h b/net/disk_cache/blockfile/disk_format_v3.h
index f16648b..3ec43e8 100644
--- a/net/disk_cache/blockfile/disk_format_v3.h
+++ b/net/disk_cache/blockfile/disk_format_v3.h
@@ -45,14 +45,15 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_DISK_FORMAT_V3_H_
#define NET_DISK_CACHE_BLOCKFILE_DISK_FORMAT_V3_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "net/disk_cache/blockfile/disk_format_base.h"
namespace disk_cache {
const int kBaseTableLen = 0x400;
-const uint32 kIndexMagicV3 = 0xC103CAC3;
-const uint32 kVersion3 = 0x30000; // Version 3.0.
+const uint32_t kIndexMagicV3 = 0xC103CAC3;
+const uint32_t kVersion3 = 0x30000; // Version 3.0.
// Flags for a given cache.
enum CacheFlags {
@@ -63,30 +64,30 @@
// Header for the master index file.
struct IndexHeaderV3 {
- uint32 magic;
- uint32 version;
- int32 num_entries; // Number of entries currently stored.
- int32 num_bytes; // Total size of the stored data.
- int32 last_file; // Last external file created.
- int32 reserved1;
+ uint32_t magic;
+ uint32_t version;
+ int32_t num_entries; // Number of entries currently stored.
+ int32_t num_bytes; // Total size of the stored data.
+ int32_t last_file; // Last external file created.
+ int32_t reserved1;
CacheAddr stats; // Storage for usage data.
- int32 table_len; // Actual size of the table.
- int32 crash; // Signals a previous crash.
- int32 experiment; // Id of an ongoing test.
- int32 max_bytes; // Total maximum size of the stored data.
- uint32 flags;
- int32 used_cells;
- int32 max_bucket;
- uint64 create_time; // Creation time for this set of files.
- uint64 base_time; // Current base for timestamps.
- uint64 old_time; // Previous time used for timestamps.
- int32 max_block_file;
- int32 num_no_use_entries;
- int32 num_low_use_entries;
- int32 num_high_use_entries;
- int32 reserved;
- int32 num_evicted_entries;
- int32 pad[6];
+ int32_t table_len; // Actual size of the table.
+ int32_t crash; // Signals a previous crash.
+ int32_t experiment; // Id of an ongoing test.
+ int32_t max_bytes; // Total maximum size of the stored data.
+ uint32_t flags;
+ int32_t used_cells;
+ int32_t max_bucket;
+ uint64_t create_time; // Creation time for this set of files.
+ uint64_t base_time; // Current base for timestamps.
+ uint64_t old_time; // Previous time used for timestamps.
+ int32_t max_block_file;
+ int32_t num_no_use_entries;
+ int32_t num_low_use_entries;
+ int32_t num_high_use_entries;
+ int32_t reserved;
+ int32_t num_evicted_entries;
+ int32_t pad[6];
};
const int kBaseBitmapBytes = 3968;
@@ -95,7 +96,7 @@
// given time. The required file size can be computed from header.table_len.
struct IndexBitmap {
IndexHeaderV3 header;
- uint32 bitmap[kBaseBitmapBytes / 4]; // First page of the bitmap.
+ uint32_t bitmap[kBaseBitmapBytes / 4]; // First page of the bitmap.
};
static_assert(sizeof(IndexBitmap) == 4096, "bad IndexHeader");
@@ -180,16 +181,16 @@
// If that same Addr is stored on a large table, the location field would be
// 0x61234
- uint64 first_part;
- uint8 last_part;
+ uint64_t first_part;
+ uint8_t last_part;
};
static_assert(sizeof(IndexCell) == 9, "bad IndexCell");
const int kCellsPerBucket = 4;
struct IndexBucket {
IndexCell cells[kCellsPerBucket];
- int32 next;
- uint32 hash; // The high order byte is reserved (should be zero).
+ int32_t next;
+ uint32_t hash; // The high order byte is reserved (should be zero).
};
static_assert(sizeof(IndexBucket) == 44, "bad IndexBucket");
const int kBytesPerCell = 44 / kCellsPerBucket;
@@ -209,35 +210,35 @@
};
struct EntryRecord {
- uint32 hash;
- uint32 pad1;
- uint8 reuse_count;
- uint8 refetch_count;
- int8 state; // Current EntryState.
- uint8 flags; // Any combination of EntryFlags.
- int32 key_len;
- int32 data_size[4]; // We can store up to 4 data streams for each
+ uint32_t hash;
+ uint32_t pad1;
+ uint8_t reuse_count;
+ uint8_t refetch_count;
+ int8_t state; // Current EntryState.
+ uint8_t flags; // Any combination of EntryFlags.
+ int32_t key_len;
+ int32_t data_size[4]; // We can store up to 4 data streams for each
CacheAddr data_addr[4]; // entry.
- uint32 data_hash[4];
- uint64 creation_time;
- uint64 last_modified_time;
- uint64 last_access_time;
- int32 pad[3];
- uint32 self_hash;
+ uint32_t data_hash[4];
+ uint64_t creation_time;
+ uint64_t last_modified_time;
+ uint64_t last_access_time;
+ int32_t pad[3];
+ uint32_t self_hash;
};
static_assert(sizeof(EntryRecord) == 104, "bad EntryRecord");
struct ShortEntryRecord {
- uint32 hash;
- uint32 pad1;
- uint8 reuse_count;
- uint8 refetch_count;
- int8 state; // Current EntryState.
- uint8 flags;
- int32 key_len;
- uint64 last_access_time;
- uint32 long_hash[5];
- uint32 self_hash;
+ uint32_t hash;
+ uint32_t pad1;
+ uint8_t reuse_count;
+ uint8_t refetch_count;
+ int8_t state; // Current EntryState.
+ uint8_t flags;
+ int32_t key_len;
+ uint64_t last_access_time;
+ uint32_t long_hash[5];
+ uint32_t self_hash;
};
static_assert(sizeof(ShortEntryRecord) == 48, "bad ShortEntryRecord");
diff --git a/net/disk_cache/blockfile/entry_impl.cc b/net/disk_cache/blockfile/entry_impl.cc
index 1d86e08..6020464 100644
--- a/net/disk_cache/blockfile/entry_impl.cc
+++ b/net/disk_cache/blockfile/entry_impl.cc
@@ -7,6 +7,7 @@
#include <limits>
#include "base/hash.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "net/base/io_buffer.h"
diff --git a/net/disk_cache/blockfile/entry_impl.h b/net/disk_cache/blockfile/entry_impl.h
index 5a485e8..336ccc9 100644
--- a/net/disk_cache/blockfile/entry_impl.h
+++ b/net/disk_cache/blockfile/entry_impl.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/disk_cache/blockfile/disk_format.h"
#include "net/disk_cache/blockfile/storage_block-inl.h"
diff --git a/net/disk_cache/blockfile/entry_impl_v3.cc b/net/disk_cache/blockfile/entry_impl_v3.cc
index f6e1531..883a6f2 100644
--- a/net/disk_cache/blockfile/entry_impl_v3.cc
+++ b/net/disk_cache/blockfile/entry_impl_v3.cc
@@ -7,6 +7,7 @@
#include <limits>
#include "base/hash.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "net/base/io_buffer.h"
diff --git a/net/disk_cache/blockfile/entry_impl_v3.h b/net/disk_cache/blockfile/entry_impl_v3.h
index 000362e..a9a5df5 100644
--- a/net/disk_cache/blockfile/entry_impl_v3.h
+++ b/net/disk_cache/blockfile/entry_impl_v3.h
@@ -9,6 +9,7 @@
#include <string>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/disk_cache/blockfile/disk_format_v3.h"
#include "net/disk_cache/blockfile/storage_block.h"
diff --git a/net/disk_cache/blockfile/eviction.h b/net/disk_cache/blockfile/eviction.h
index e49883b..baea659 100644
--- a/net/disk_cache/blockfile/eviction.h
+++ b/net/disk_cache/blockfile/eviction.h
@@ -5,7 +5,7 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_EVICTION_H_
#define NET_DISK_CACHE_BLOCKFILE_EVICTION_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/disk_cache/blockfile/rankings.h"
diff --git a/net/disk_cache/blockfile/eviction_v3.h b/net/disk_cache/blockfile/eviction_v3.h
index 01fe613..a9b48f41 100644
--- a/net/disk_cache/blockfile/eviction_v3.h
+++ b/net/disk_cache/blockfile/eviction_v3.h
@@ -5,7 +5,7 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_EVICTION_V3_H_
#define NET_DISK_CACHE_BLOCKFILE_EVICTION_V3_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/disk_cache/blockfile/disk_format_v3.h"
#include "net/disk_cache/blockfile/index_table_v3.h"
diff --git a/net/disk_cache/blockfile/experiments.h b/net/disk_cache/blockfile/experiments.h
index 53b6582..a2ca9600 100644
--- a/net/disk_cache/blockfile/experiments.h
+++ b/net/disk_cache/blockfile/experiments.h
@@ -5,7 +5,6 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_EXPERIMENTS_H_
#define NET_DISK_CACHE_BLOCKFILE_EXPERIMENTS_H_
-
namespace disk_cache {
// This lists the experiment groups that we care about. Only add new groups at
diff --git a/net/disk_cache/blockfile/file.h b/net/disk_cache/blockfile/file.h
index 9425d59..0e34fab 100644
--- a/net/disk_cache/blockfile/file.h
+++ b/net/disk_cache/blockfile/file.h
@@ -7,7 +7,10 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_FILE_H_
#define NET_DISK_CACHE_BLOCKFILE_FILE_H_
+#include <stddef.h>
+
#include "base/files/file.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
diff --git a/net/disk_cache/blockfile/file_block.h b/net/disk_cache/blockfile/file_block.h
index fdcfcd0..4250dd1 100644
--- a/net/disk_cache/blockfile/file_block.h
+++ b/net/disk_cache/blockfile/file_block.h
@@ -7,6 +7,8 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_FILE_BLOCK_H_
#define NET_DISK_CACHE_BLOCKFILE_FILE_BLOCK_H_
+#include <stddef.h>
+
namespace disk_cache {
// This interface exposes common functionality for a single block of data
diff --git a/net/disk_cache/blockfile/file_ios.cc b/net/disk_cache/blockfile/file_ios.cc
index b00c246..96c988f 100644
--- a/net/disk_cache/blockfile/file_ios.cc
+++ b/net/disk_cache/blockfile/file_ios.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/threading/worker_pool.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/blockfile/in_flight_io.h"
diff --git a/net/disk_cache/blockfile/in_flight_backend_io.cc b/net/disk_cache/blockfile/in_flight_backend_io.cc
index b7fa8a45..6dda26b7 100644
--- a/net/disk_cache/blockfile/in_flight_backend_io.cc
+++ b/net/disk_cache/blockfile/in_flight_backend_io.cc
@@ -176,8 +176,10 @@
truncate_ = truncate;
}
-void BackendIO::ReadSparseData(EntryImpl* entry, int64 offset,
- net::IOBuffer* buf, int buf_len) {
+void BackendIO::ReadSparseData(EntryImpl* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len) {
operation_ = OP_READ_SPARSE;
entry_ = entry;
offset64_ = offset;
@@ -185,8 +187,10 @@
buf_len_ = buf_len;
}
-void BackendIO::WriteSparseData(EntryImpl* entry, int64 offset,
- net::IOBuffer* buf, int buf_len) {
+void BackendIO::WriteSparseData(EntryImpl* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len) {
operation_ = OP_WRITE_SPARSE;
entry_ = entry;
offset64_ = offset;
@@ -194,8 +198,10 @@
buf_len_ = buf_len;
}
-void BackendIO::GetAvailableRange(EntryImpl* entry, int64 offset, int len,
- int64* start) {
+void BackendIO::GetAvailableRange(EntryImpl* entry,
+ int64_t offset,
+ int len,
+ int64_t* start) {
operation_ = OP_GET_RANGE;
entry_ = entry;
offset64_ = offset;
@@ -464,7 +470,10 @@
}
void InFlightBackendIO::ReadSparseData(
- EntryImpl* entry, int64 offset, net::IOBuffer* buf, int buf_len,
+ EntryImpl* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len,
const net::CompletionCallback& callback) {
scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->ReadSparseData(entry, offset, buf, buf_len);
@@ -472,7 +481,10 @@
}
void InFlightBackendIO::WriteSparseData(
- EntryImpl* entry, int64 offset, net::IOBuffer* buf, int buf_len,
+ EntryImpl* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len,
const net::CompletionCallback& callback) {
scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->WriteSparseData(entry, offset, buf, buf_len);
@@ -480,7 +492,10 @@
}
void InFlightBackendIO::GetAvailableRange(
- EntryImpl* entry, int64 offset, int len, int64* start,
+ EntryImpl* entry,
+ int64_t offset,
+ int len,
+ int64_t* start,
const net::CompletionCallback& callback) {
scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->GetAvailableRange(entry, offset, len, start);
diff --git a/net/disk_cache/blockfile/in_flight_backend_io.h b/net/disk_cache/blockfile/in_flight_backend_io.h
index b661466..5ac0bf4 100644
--- a/net/disk_cache/blockfile/in_flight_backend_io.h
+++ b/net/disk_cache/blockfile/in_flight_backend_io.h
@@ -5,9 +5,12 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_
#define NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_
+#include <stdint.h>
+
#include <list>
#include <string>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
@@ -68,11 +71,18 @@
int buf_len);
void WriteData(EntryImpl* entry, int index, int offset, net::IOBuffer* buf,
int buf_len, bool truncate);
- void ReadSparseData(EntryImpl* entry, int64 offset, net::IOBuffer* buf,
+ void ReadSparseData(EntryImpl* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
int buf_len);
- void WriteSparseData(EntryImpl* entry, int64 offset, net::IOBuffer* buf,
+ void WriteSparseData(EntryImpl* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
int buf_len);
- void GetAvailableRange(EntryImpl* entry, int64 offset, int len, int64* start);
+ void GetAvailableRange(EntryImpl* entry,
+ int64_t offset,
+ int len,
+ int64_t* start);
void CancelSparseIO(EntryImpl* entry);
void ReadyForSparseIO(EntryImpl* entry);
@@ -137,8 +147,8 @@
scoped_refptr<net::IOBuffer> buf_;
int buf_len_;
bool truncate_;
- int64 offset64_;
- int64* start_;
+ int64_t offset64_;
+ int64_t* start_;
base::TimeTicks start_time_;
base::Closure task_;
@@ -182,11 +192,20 @@
void WriteData(
EntryImpl* entry, int index, int offset, net::IOBuffer* buf,
int buf_len, bool truncate, const net::CompletionCallback& callback);
- void ReadSparseData(EntryImpl* entry, int64 offset, net::IOBuffer* buf,
- int buf_len, const net::CompletionCallback& callback);
- void WriteSparseData(EntryImpl* entry, int64 offset, net::IOBuffer* buf,
- int buf_len, const net::CompletionCallback& callback);
- void GetAvailableRange(EntryImpl* entry, int64 offset, int len, int64* start,
+ void ReadSparseData(EntryImpl* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback);
+ void WriteSparseData(EntryImpl* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback);
+ void GetAvailableRange(EntryImpl* entry,
+ int64_t offset,
+ int len,
+ int64_t* start,
const net::CompletionCallback& callback);
void CancelSparseIO(EntryImpl* entry);
void ReadyForSparseIO(EntryImpl* entry,
diff --git a/net/disk_cache/blockfile/in_flight_io.h b/net/disk_cache/blockfile/in_flight_io.h
index 288a7c5..2834b94 100644
--- a/net/disk_cache/blockfile/in_flight_io.h
+++ b/net/disk_cache/blockfile/in_flight_io.h
@@ -7,6 +7,7 @@
#include <set>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
diff --git a/net/disk_cache/blockfile/index_table_v3.h b/net/disk_cache/blockfile/index_table_v3.h
index 3a9a3e2e..78122c8 100644
--- a/net/disk_cache/blockfile/index_table_v3.h
+++ b/net/disk_cache/blockfile/index_table_v3.h
@@ -18,6 +18,7 @@
// re-initialized with the new structures. Note that the IndexTable instance is
// still functional while the backend performs file IO.
+#include <stddef.h>
#include <stdint.h>
#include <vector>
diff --git a/net/disk_cache/blockfile/index_table_v3_unittest.cc b/net/disk_cache/blockfile/index_table_v3_unittest.cc
index 237b983c..e84b743d 100644
--- a/net/disk_cache/blockfile/index_table_v3_unittest.cc
+++ b/net/disk_cache/blockfile/index_table_v3_unittest.cc
@@ -4,8 +4,8 @@
#include <stdint.h>
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "net/disk_cache/blockfile/addr.h"
#include "net/disk_cache/blockfile/disk_format_v3.h"
#include "net/disk_cache/blockfile/index_table_v3.h"
@@ -61,7 +61,7 @@
base::Time start_time() const { return start_time_; }
private:
- scoped_ptr<uint64[]> main_bitmap_;
+ scoped_ptr<uint64_t[]> main_bitmap_;
scoped_ptr<disk_cache::IndexBucket[]> main_table_;
scoped_ptr<disk_cache::IndexBucket[]> extra_table_;
base::Time start_time_;
@@ -82,7 +82,7 @@
// depend on that.
num_bitmap_bytes_ = (num_entries + num_entries / 2) / 8;
size_t required_size = sizeof(disk_cache::IndexHeaderV3) + num_bitmap_bytes_;
- main_bitmap_.reset(new uint64[required_size / sizeof(uint64)]);
+ main_bitmap_.reset(new uint64_t[required_size / sizeof(uint64_t)]);
memset(main_bitmap_.get(), 0, required_size);
disk_cache::IndexHeaderV3* header =
@@ -113,7 +113,8 @@
memcpy(result->backup_header.get(), result->index_bitmap,
sizeof(result->index_bitmap->header));
- result->backup_bitmap.reset(new uint32[num_bitmap_bytes_ / sizeof(uint32)]);
+ result->backup_bitmap.reset(
+ new uint32_t[num_bitmap_bytes_ / sizeof(uint32_t)]);
memcpy(result->backup_bitmap.get(), result->index_bitmap->bitmap,
num_bitmap_bytes_);
}
@@ -148,7 +149,7 @@
} // namespace
TEST(DiskCacheIndexTable, EntryCell) {
- uint32 hash = 0x55aa6699;
+ uint32_t hash = 0x55aa6699;
disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, 0x4531);
bool small_table = true;
int cell_num = 88;
@@ -277,7 +278,7 @@
disk_cache::CellList entries;
for (int i = 0; i < 250; i++) {
SCOPED_TRACE(i);
- uint32 hash = i * i * 1111 + i * 11;
+ uint32_t hash = i * i * 1111 + i * 11;
disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, i * 13 + 1);
EntryCell entry = index.CreateEntryCell(hash, addr);
EXPECT_TRUE(entry.IsValid());
@@ -289,7 +290,7 @@
// Read them back.
for (size_t i = 0; i < entries.size(); i++) {
SCOPED_TRACE(i);
- uint32 hash = entries[i].hash;
+ uint32_t hash = entries[i].hash;
disk_cache::Addr addr = entries[i].address;
disk_cache::EntrySet found_entries = index.LookupEntries(hash);
@@ -311,7 +312,7 @@
// See what we have now.
for (size_t i = 0; i < entries.size(); i++) {
SCOPED_TRACE(i);
- uint32 hash = entries[i].hash;
+ uint32_t hash = entries[i].hash;
disk_cache::Addr addr = entries[i].address;
disk_cache::EntrySet found_entries = index.LookupEntries(hash);
@@ -336,7 +337,7 @@
index.Init(&init_data);
disk_cache::CellList entries;
- uint32 hash = 0x55aa55bb;
+ uint32_t hash = 0x55aa55bb;
for (int i = 0; i < 6; i++) {
SCOPED_TRACE(i);
disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, i * 13 + 1);
@@ -476,7 +477,7 @@
disk_cache::CellList entries;
for (int i = 0; i < 44; i++) {
SCOPED_TRACE(i);
- uint32 hash = i; // The entries will be ordered on the table.
+ uint32_t hash = i; // The entries will be ordered on the table.
disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, i * 13 + 1);
if (i < 10 || i == 40)
addr = disk_cache::Addr(disk_cache::BLOCK_EVICTED, 1, 6, i * 13 + 1);
@@ -594,7 +595,7 @@
// Write some entries.
for (int i = 0; i < 250; i++, entry_id++) {
SCOPED_TRACE(entry_id);
- uint32 hash = entry_id * i * 321 + entry_id * 13;
+ uint32_t hash = entry_id * i * 321 + entry_id * 13;
disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, entry_id * 17 + 1);
EntryCell entry = index.CreateEntryCell(hash, addr);
EXPECT_TRUE(entry.IsValid());
@@ -628,7 +629,7 @@
// Write some entries.
for (int i = 0; i < 8; i++) {
SCOPED_TRACE(i);
- uint32 hash = i * 256;
+ uint32_t hash = i * 256;
disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, i * 7 + 1);
EntryCell entry = index.CreateEntryCell(hash, addr);
EXPECT_TRUE(entry.IsValid());
@@ -648,7 +649,7 @@
// Write more entries, starting with the upper half of the table.
for (int i = 9; i < 11; i++) {
SCOPED_TRACE(i);
- uint32 hash = i * 256;
+ uint32_t hash = i * 256;
disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, i * 7 + 1);
EntryCell entry = index.CreateEntryCell(hash, addr);
EXPECT_TRUE(entry.IsValid());
@@ -679,7 +680,7 @@
// Write some entries.
for (int i = 0; i < 512; i++) {
SCOPED_TRACE(i);
- uint32 hash = 0;
+ uint32_t hash = 0;
disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, i + 1);
EntryCell entry = index.CreateEntryCell(hash, addr);
EXPECT_TRUE(entry.IsValid());
@@ -697,7 +698,7 @@
IndexTable index(&backend);
index.Init(&init_data);
- uint32 hash = 0;
+ uint32_t hash = 0;
disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, 6);
EntryCell entry = index.CreateEntryCell(hash, addr);
EXPECT_TRUE(entry.IsValid());
diff --git a/net/disk_cache/blockfile/mapped_file.h b/net/disk_cache/blockfile/mapped_file.h
index 7634cb70..7ae0941 100644
--- a/net/disk_cache/blockfile/mapped_file.h
+++ b/net/disk_cache/blockfile/mapped_file.h
@@ -7,6 +7,9 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_MAPPED_FILE_H_
#define NET_DISK_CACHE_BLOCKFILE_MAPPED_FILE_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/disk_cache/blockfile/file.h"
#include "net/disk_cache/blockfile/file_block.h"
diff --git a/net/disk_cache/blockfile/mapped_file_unittest.cc b/net/disk_cache/blockfile/mapped_file_unittest.cc
index 9b31d6d5..bd8e913b 100644
--- a/net/disk_cache/blockfile/mapped_file_unittest.cc
+++ b/net/disk_cache/blockfile/mapped_file_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/strings/string_util.h"
#include "net/disk_cache/blockfile/file_block.h"
diff --git a/net/disk_cache/blockfile/rankings.cc b/net/disk_cache/blockfile/rankings.cc
index 0f06141..387950f 100644
--- a/net/disk_cache/blockfile/rankings.cc
+++ b/net/disk_cache/blockfile/rankings.cc
@@ -8,6 +8,7 @@
#include <limits>
+#include "base/macros.h"
#include "net/disk_cache/blockfile/backend_impl.h"
#include "net/disk_cache/blockfile/disk_format.h"
#include "net/disk_cache/blockfile/entry_impl.h"
diff --git a/net/disk_cache/blockfile/rankings.h b/net/disk_cache/blockfile/rankings.h
index b523932..637f6a5 100644
--- a/net/disk_cache/blockfile/rankings.h
+++ b/net/disk_cache/blockfile/rankings.h
@@ -9,6 +9,7 @@
#include <list>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/disk_cache/blockfile/addr.h"
#include "net/disk_cache/blockfile/mapped_file.h"
diff --git a/net/disk_cache/blockfile/sparse_control.cc b/net/disk_cache/blockfile/sparse_control.cc
index 08d79a8..1de0d60 100644
--- a/net/disk_cache/blockfile/sparse_control.cc
+++ b/net/disk_cache/blockfile/sparse_control.cc
@@ -10,6 +10,7 @@
#include "base/format_macros.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -46,8 +47,9 @@
// If the entry is called entry_name, child entries will be named something
// like Range_entry_name:XXX:YYY where XXX is the entry signature and YYY is the
// number of the particular child.
-std::string GenerateChildName(const std::string& base_name, int64 signature,
- int64 child_id) {
+std::string GenerateChildName(const std::string& base_name,
+ int64_t signature,
+ int64_t child_id) {
return base::StringPrintf("Range_%s:%" PRIx64 ":%" PRIx64, base_name.c_str(),
signature, child_id);
}
@@ -76,7 +78,7 @@
base::WeakPtr<disk_cache::BackendImpl> backend_;
std::string name_;
disk_cache::Bitmap children_map_;
- int64 signature_;
+ int64_t signature_;
scoped_ptr<char[]> buffer_;
DISALLOW_COPY_AND_ASSIGN(ChildrenDeleter);
};
@@ -245,8 +247,11 @@
return (entry_->GetDataSize(kSparseIndex) != 0);
}
-int SparseControl::StartIO(SparseOperation op, int64 offset, net::IOBuffer* buf,
- int buf_len, const CompletionCallback& callback) {
+int SparseControl::StartIO(SparseOperation op,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) {
DCHECK(init_);
// We don't support simultaneous IO for sparse data.
if (operation_ != kNoOperation)
@@ -256,7 +261,7 @@
return net::ERR_INVALID_ARGUMENT;
// We only support up to 64 GB.
- if (static_cast<uint64>(offset) + static_cast<unsigned int>(buf_len) >=
+ if (static_cast<uint64_t>(offset) + static_cast<unsigned int>(buf_len) >=
UINT64_C(0x1000000000)) {
return net::ERR_CACHE_OPERATION_NOT_SUPPORTED;
}
@@ -297,7 +302,7 @@
return net::ERR_IO_PENDING;
}
-int SparseControl::GetAvailableRange(int64 offset, int len, int64* start) {
+int SparseControl::GetAvailableRange(int64_t offset, int len, int64_t* start) {
DCHECK(init_);
// We don't support simultaneous IO for sparse data.
if (operation_ != kNoOperation)
@@ -441,7 +446,7 @@
// Grow the bitmap to the current size and copy the bits.
children_map_.Resize(map_len * 8, false);
- children_map_.SetMap(reinterpret_cast<uint32*>(buf->data()), map_len);
+ children_map_.SetMap(reinterpret_cast<uint32_t*>(buf->data()), map_len);
return net::OK;
}
diff --git a/net/disk_cache/blockfile/sparse_control.h b/net/disk_cache/blockfile/sparse_control.h
index d3450a3e..3edab38 100644
--- a/net/disk_cache/blockfile/sparse_control.h
+++ b/net/disk_cache/blockfile/sparse_control.h
@@ -5,11 +5,13 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_SPARSE_CONTROL_H_
#define NET_DISK_CACHE_BLOCKFILE_SPARSE_CONTROL_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/completion_callback.h"
#include "net/disk_cache/blockfile/bitmap.h"
#include "net/disk_cache/blockfile/disk_format.h"
@@ -59,11 +61,14 @@
// to use for asynchronous operations. See the description of the Read /
// WriteSparseData for details about the arguments. The return value is the
// number of bytes read or written, or a net error code.
- int StartIO(SparseOperation op, int64 offset, net::IOBuffer* buf,
- int buf_len, const CompletionCallback& callback);
+ int StartIO(SparseOperation op,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback);
// Implements Entry::GetAvailableRange().
- int GetAvailableRange(int64 offset, int len, int64* start);
+ int GetAvailableRange(int64_t offset, int len, int64_t* start);
// Cancels the current sparse operation (if any).
void CancelIO();
@@ -162,7 +167,7 @@
CompletionCallback user_callback_;
std::vector<CompletionCallback> abort_callbacks_;
- int64 offset_; // Current sparse offset.
+ int64_t offset_; // Current sparse offset.
scoped_refptr<net::DrainableIOBuffer> user_buf_;
int buf_len_; // Bytes to read or write.
int child_offset_; // Offset to use for the current child.
diff --git a/net/disk_cache/blockfile/sparse_control_v3.cc b/net/disk_cache/blockfile/sparse_control_v3.cc
index bee23dcc..82a322122 100644
--- a/net/disk_cache/blockfile/sparse_control_v3.cc
+++ b/net/disk_cache/blockfile/sparse_control_v3.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -42,8 +43,9 @@
// If the entry is called entry_name, child entries will be named something
// like Range_entry_name:XXX:YYY where XXX is the entry signature and YYY is the
// number of the particular child.
-std::string GenerateChildName(const std::string& base_name, int64 signature,
- int64 child_id) {
+std::string GenerateChildName(const std::string& base_name,
+ int64_t signature,
+ int64_t child_id) {
return base::StringPrintf("Range_%s:%" PRIx64 ":%" PRIx64, base_name.c_str(),
signature, child_id);
}
@@ -72,7 +74,7 @@
base::WeakPtr<disk_cache::BackendImpl> backend_;
std::string name_;
disk_cache::Bitmap children_map_;
- int64 signature_;
+ int64_t signature_;
scoped_ptr<char[]> buffer_;
DISALLOW_COPY_AND_ASSIGN(ChildrenDeleter);
};
@@ -222,8 +224,11 @@
return (entry_->GetDataSize(kSparseIndex) != 0);
}
-int SparseControl::StartIO(SparseOperation op, int64 offset, net::IOBuffer* buf,
- int buf_len, const CompletionCallback& callback) {
+int SparseControl::StartIO(SparseOperation op,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) {
DCHECK(init_);
// We don't support simultaneous IO for sparse data.
if (operation_ != kNoOperation)
@@ -272,7 +277,7 @@
return net::ERR_IO_PENDING;
}
-int SparseControl::GetAvailableRange(int64 offset, int len, int64* start) {
+int SparseControl::GetAvailableRange(int64_t offset, int len, int64_t* start) {
DCHECK(init_);
// We don't support simultaneous IO for sparse data.
if (operation_ != kNoOperation)
@@ -439,7 +444,7 @@
// Grow the bitmap to the current size and copy the bits.
children_map_.Resize(map_len * 8, false);
- children_map_.SetMap(reinterpret_cast<uint32*>(buf->data()), map_len);
+ children_map_.SetMap(reinterpret_cast<uint32_t*>(buf->data()), map_len);
return net::OK;
}
diff --git a/net/disk_cache/blockfile/sparse_control_v3.h b/net/disk_cache/blockfile/sparse_control_v3.h
index 495ae191..a6c7d19c1 100644
--- a/net/disk_cache/blockfile/sparse_control_v3.h
+++ b/net/disk_cache/blockfile/sparse_control_v3.h
@@ -5,11 +5,13 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_SPARSE_CONTROL_V3_H_
#define NET_DISK_CACHE_BLOCKFILE_SPARSE_CONTROL_V3_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/completion_callback.h"
#include "net/disk_cache/blockfile/bitmap.h"
#include "net/disk_cache/disk_format.h"
@@ -54,11 +56,14 @@
// to use for asynchronous operations. See the description of the Read /
// WriteSparseData for details about the arguments. The return value is the
// number of bytes read or written, or a net error code.
- int StartIO(SparseOperation op, int64 offset, net::IOBuffer* buf,
- int buf_len, const CompletionCallback& callback);
+ int StartIO(SparseOperation op,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback);
// Implements Entry::GetAvailableRange().
- int GetAvailableRange(int64 offset, int len, int64* start);
+ int GetAvailableRange(int64_t offset, int len, int64_t* start);
// Cancels the current sparse operation (if any).
void CancelIO();
@@ -160,7 +165,7 @@
CompletionCallback user_callback_;
std::vector<CompletionCallback> abort_callbacks_;
- int64 offset_; // Current sparse offset.
+ int64_t offset_; // Current sparse offset.
scoped_refptr<net::DrainableIOBuffer> user_buf_;
int buf_len_; // Bytes to read or write.
int child_offset_; // Offset to use for the current child.
diff --git a/net/disk_cache/blockfile/stats.cc b/net/disk_cache/blockfile/stats.cc
index bb319f5..a371d28 100644
--- a/net/disk_cache/blockfile/stats.cc
+++ b/net/disk_cache/blockfile/stats.cc
@@ -16,18 +16,18 @@
namespace {
-const int32 kDiskSignature = 0xF01427E0;
+const int32_t kDiskSignature = 0xF01427E0;
struct OnDiskStats {
- int32 signature;
+ int32_t signature;
int size;
int data_sizes[disk_cache::Stats::kDataSizesLength];
- int64 counters[disk_cache::Stats::MAX_COUNTER];
+ int64_t counters[disk_cache::Stats::MAX_COUNTER];
};
static_assert(sizeof(OnDiskStats) < 512, "needs more than 2 blocks");
// Returns the "floor" (as opposed to "ceiling") of log base 2 of number.
-int LogBase2(int32 number) {
+int LogBase2(int32_t number) {
unsigned int value = static_cast<unsigned int>(number);
const unsigned int mask[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
const unsigned int s[] = {1, 2, 4, 8, 16};
@@ -169,7 +169,7 @@
return 256 * 2;
}
-void Stats::ModifyStorageStats(int32 old_size, int32 new_size) {
+void Stats::ModifyStorageStats(int32_t old_size, int32_t new_size) {
// We keep a counter of the data block size on an array where each entry is
// the adjusted log base 2 of the size. The first entry counts blocks of 256
// bytes, the second blocks up to 512 bytes, etc. With 20 entries, the last
@@ -189,12 +189,12 @@
counters_[an_event]++;
}
-void Stats::SetCounter(Counters counter, int64 value) {
+void Stats::SetCounter(Counters counter, int64_t value) {
DCHECK(counter >= MIN_COUNTER && counter < MAX_COUNTER);
counters_[counter] = value;
}
-int64 Stats::GetCounter(Counters counter) const {
+int64_t Stats::GetCounter(Counters counter) const {
DCHECK(counter >= MIN_COUNTER && counter < MAX_COUNTER);
return counters_[counter];
}
@@ -295,7 +295,7 @@
// 25 [16M, 32M)
// 26 [32M, 64M)
// 27 [64M, ...)
-int Stats::GetStatsBucket(int32 size) {
+int Stats::GetStatsBucket(int32_t size) {
if (size < 1024)
return 0;
@@ -318,7 +318,7 @@
}
int Stats::GetRatio(Counters hit, Counters miss) const {
- int64 ratio = GetCounter(hit) * 100;
+ int64_t ratio = GetCounter(hit) * 100;
if (!ratio)
return 0;
diff --git a/net/disk_cache/blockfile/stats.h b/net/disk_cache/blockfile/stats.h
index 32dcc2f..34b54c6e 100644
--- a/net/disk_cache/blockfile/stats.h
+++ b/net/disk_cache/blockfile/stats.h
@@ -5,9 +5,12 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_STATS_H_
#define NET_DISK_CACHE_BLOCKFILE_STATS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_split.h"
#include "net/base/net_export.h"
#include "net/disk_cache/blockfile/addr.h"
@@ -64,12 +67,12 @@
int StorageSize();
// Tracks changes to the stoage space used by an entry.
- void ModifyStorageStats(int32 old_size, int32 new_size);
+ void ModifyStorageStats(int32_t old_size, int32_t new_size);
// Tracks general events.
void OnEvent(Counters an_event);
- void SetCounter(Counters counter, int64 value);
- int64 GetCounter(Counters counter) const;
+ void SetCounter(Counters counter, int64_t value);
+ int64_t GetCounter(Counters counter) const;
void GetItems(StatsItems* items);
int GetHitRatio() const;
@@ -86,12 +89,12 @@
private:
// Supports generation of SizeStats histogram data.
int GetBucketRange(size_t i) const;
- int GetStatsBucket(int32 size);
+ int GetStatsBucket(int32_t size);
int GetRatio(Counters hit, Counters miss) const;
Addr storage_addr_;
int data_sizes_[kDataSizesLength];
- int64 counters_[MAX_COUNTER];
+ int64_t counters_[MAX_COUNTER];
DISALLOW_COPY_AND_ASSIGN(Stats);
};
diff --git a/net/disk_cache/blockfile/storage_block-inl.h b/net/disk_cache/blockfile/storage_block-inl.h
index f919c12..3d880bb9 100644
--- a/net/disk_cache/blockfile/storage_block-inl.h
+++ b/net/disk_cache/blockfile/storage_block-inl.h
@@ -7,6 +7,9 @@
#include "net/disk_cache/blockfile/storage_block.h"
+#include <stddef.h>
+#include <stdint.h>
+
#include "base/hash.h"
#include "base/logging.h"
#include "net/disk_cache/blockfile/trace.h"
@@ -103,7 +106,7 @@
}
template<typename T> bool StorageBlock<T>::VerifyHash() const {
- uint32 hash = CalculateHash();
+ uint32_t hash = CalculateHash();
return (!data_->self_hash || data_->self_hash == hash);
}
@@ -196,7 +199,8 @@
}
}
-template<typename T> uint32 StorageBlock<T>::CalculateHash() const {
+template <typename T>
+uint32_t StorageBlock<T>::CalculateHash() const {
return base::Hash(reinterpret_cast<char*>(data_), offsetof(T, self_hash));
}
diff --git a/net/disk_cache/blockfile/storage_block.h b/net/disk_cache/blockfile/storage_block.h
index 6db4a31..62e5349 100644
--- a/net/disk_cache/blockfile/storage_block.h
+++ b/net/disk_cache/blockfile/storage_block.h
@@ -7,6 +7,10 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_STORAGE_BLOCK_H_
#define NET_DISK_CACHE_BLOCKFILE_STORAGE_BLOCK_H_
+#include <stddef.h>
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/disk_cache/blockfile/addr.h"
#include "net/disk_cache/blockfile/mapped_file.h"
@@ -80,7 +84,7 @@
private:
void AllocateData();
void DeleteData();
- uint32 CalculateHash() const;
+ uint32_t CalculateHash() const;
T* data_;
MappedFile* file_;
diff --git a/net/disk_cache/blockfile/trace.h b/net/disk_cache/blockfile/trace.h
index 6805e6c6..1c30dac 100644
--- a/net/disk_cache/blockfile/trace.h
+++ b/net/disk_cache/blockfile/trace.h
@@ -9,7 +9,7 @@
#ifndef NET_DISK_CACHE_BLOCKFILE_TRACE_H_
#define NET_DISK_CACHE_BLOCKFILE_TRACE_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
diff --git a/net/disk_cache/cache_creator.cc b/net/disk_cache/cache_creator.cc
index 25bde28..243acc4 100644
--- a/net/disk_cache/cache_creator.cc
+++ b/net/disk_cache/cache_creator.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/metrics/field_trial.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/stringprintf.h"
@@ -26,7 +27,7 @@
int max_bytes,
net::CacheType type,
net::BackendType backend_type,
- uint32 flags,
+ uint32_t flags,
const scoped_refptr<base::SingleThreadTaskRunner>& thread,
net::NetLog* net_log,
scoped_ptr<disk_cache::Backend>* backend,
@@ -48,7 +49,7 @@
int max_bytes_;
net::CacheType type_;
net::BackendType backend_type_;
- uint32 flags_;
+ uint32_t flags_;
scoped_refptr<base::SingleThreadTaskRunner> thread_;
scoped_ptr<disk_cache::Backend>* backend_;
net::CompletionCallback callback_;
@@ -64,7 +65,7 @@
int max_bytes,
net::CacheType type,
net::BackendType backend_type,
- uint32 flags,
+ uint32_t flags,
const scoped_refptr<base::SingleThreadTaskRunner>& thread,
net::NetLog* net_log,
scoped_ptr<disk_cache::Backend>* backend,
@@ -79,8 +80,7 @@
thread_(thread),
backend_(backend),
callback_(callback),
- net_log_(net_log) {
-}
+ net_log_(net_log) {}
CacheCreator::~CacheCreator() {
}
diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h
index 3f7f003..5f99c32 100644
--- a/net/disk_cache/disk_cache.h
+++ b/net/disk_cache/disk_cache.h
@@ -8,10 +8,11 @@
#ifndef NET_DISK_CACHE_DISK_CACHE_H_
#define NET_DISK_CACHE_DISK_CACHE_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_split.h"
@@ -98,7 +99,7 @@
virtual net::CacheType GetCacheType() const = 0;
// Returns the number of entries in the cache.
- virtual int32 GetEntryCount() const = 0;
+ virtual int32_t GetEntryCount() const = 0;
// Opens an existing entry. Upon success, |entry| holds a pointer to an Entry
// object representing the specified disk cache entry. When the entry pointer
@@ -187,7 +188,7 @@
virtual base::Time GetLastModified() const = 0;
// Returns the size of the cache data with the given index.
- virtual int32 GetDataSize(int index) const = 0;
+ virtual int32_t GetDataSize(int index) const = 0;
// Copies cached data into the given buffer of length |buf_len|. Returns the
// number of bytes read or a network error code. If this function returns
@@ -260,7 +261,9 @@
// Behaves like ReadData() except that this method is used to access sparse
// entries.
- virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len,
+ virtual int ReadSparseData(int64_t offset,
+ IOBuffer* buf,
+ int buf_len,
const CompletionCallback& callback) = 0;
// Behaves like WriteData() except that this method is used to access sparse
@@ -269,7 +272,9 @@
// start again, or to reduce the total size of the stream data (which implies
// that the content has changed), the whole entry should be doomed and
// re-created.
- virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len,
+ virtual int WriteSparseData(int64_t offset,
+ IOBuffer* buf,
+ int buf_len,
const CompletionCallback& callback) = 0;
// Returns information about the currently stored portion of a sparse entry.
@@ -281,7 +286,9 @@
// net error code whenever the request cannot be completed successfully. If
// this method returns ERR_IO_PENDING, the |callback| will be invoked when the
// operation completes, and |start| must remain valid until that point.
- virtual int GetAvailableRange(int64 offset, int len, int64* start,
+ virtual int GetAvailableRange(int64_t offset,
+ int len,
+ int64_t* start,
const CompletionCallback& callback) = 0;
// Returns true if this entry could be a sparse entry or false otherwise. This
diff --git a/net/disk_cache/disk_cache_test_base.cc b/net/disk_cache/disk_cache_test_base.cc
index 345793ba..86abe1d 100644
--- a/net/disk_cache/disk_cache_test_base.cc
+++ b/net/disk_cache/disk_cache_test_base.cc
@@ -214,7 +214,8 @@
}
int DiskCacheTestWithCache::ReadSparseData(disk_cache::Entry* entry,
- int64 offset, net::IOBuffer* buf,
+ int64_t offset,
+ net::IOBuffer* buf,
int len) {
net::TestCompletionCallback cb;
int rv = entry->ReadSparseData(offset, buf, len, cb.callback());
@@ -222,8 +223,9 @@
}
int DiskCacheTestWithCache::WriteSparseData(disk_cache::Entry* entry,
- int64 offset,
- net::IOBuffer* buf, int len) {
+ int64_t offset,
+ net::IOBuffer* buf,
+ int len) {
net::TestCompletionCallback cb;
int rv = entry->WriteSparseData(offset, buf, len, cb.callback());
return cb.GetResult(rv);
@@ -299,7 +301,8 @@
CreateBackend(disk_cache::kNoRandom, &cache_thread_);
}
-void DiskCacheTestWithCache::CreateBackend(uint32 flags, base::Thread* thread) {
+void DiskCacheTestWithCache::CreateBackend(uint32_t flags,
+ base::Thread* thread) {
scoped_refptr<base::SingleThreadTaskRunner> runner;
if (use_current_thread_)
runner = base::ThreadTaskRunnerHandle::Get();
diff --git a/net/disk_cache/disk_cache_test_base.h b/net/disk_cache/disk_cache_test_base.h
index c6911a7..713bba0e 100644
--- a/net/disk_cache/disk_cache_test_base.h
+++ b/net/disk_cache/disk_cache_test_base.h
@@ -5,9 +5,11 @@
#ifndef NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_
#define NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread.h"
#include "net/base/cache_type.h"
@@ -72,7 +74,7 @@
DiskCacheTestWithCache();
~DiskCacheTestWithCache() override;
- void CreateBackend(uint32 flags, base::Thread* thread);
+ void CreateBackend(uint32_t flags, base::Thread* thread);
void InitCache();
void SimulateCrash();
@@ -86,9 +88,7 @@
simple_cache_mode_ = true;
}
- void SetMask(uint32 mask) {
- mask_ = mask;
- }
+ void SetMask(uint32_t mask) { mask_ = mask; }
void SetMaxSize(int size);
@@ -137,10 +137,14 @@
net::IOBuffer* buf, int len);
int WriteData(disk_cache::Entry* entry, int index, int offset,
net::IOBuffer* buf, int len, bool truncate);
- int ReadSparseData(disk_cache::Entry* entry, int64 offset, net::IOBuffer* buf,
+ int ReadSparseData(disk_cache::Entry* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
int len);
- int WriteSparseData(disk_cache::Entry* entry, int64 offset,
- net::IOBuffer* buf, int len);
+ int WriteSparseData(disk_cache::Entry* entry,
+ int64_t offset,
+ net::IOBuffer* buf,
+ int len);
// Asks the cache to trim an entry. If |empty| is true, the whole cache is
// deleted.
@@ -164,7 +168,7 @@
disk_cache::SimpleBackendImpl* simple_cache_impl_;
disk_cache::MemBackendImpl* mem_cache_;
- uint32 mask_;
+ uint32_t mask_;
int size_;
net::CacheType type_;
bool memory_only_;
diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc
index 1ef57a5..0a2a27e 100644
--- a/net/disk_cache/disk_cache_test_util.cc
+++ b/net/disk_cache/disk_cache_test_util.cc
@@ -58,8 +58,9 @@
return true;
}
-bool CheckCacheIntegrity(const base::FilePath& path, bool new_eviction,
- uint32 mask) {
+bool CheckCacheIntegrity(const base::FilePath& path,
+ bool new_eviction,
+ uint32_t mask) {
scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl(
path, mask, base::ThreadTaskRunnerHandle::Get(), NULL));
if (!cache.get())
diff --git a/net/disk_cache/disk_cache_test_util.h b/net/disk_cache/disk_cache_test_util.h
index 7191874..1dc348b 100644
--- a/net/disk_cache/disk_cache_test_util.h
+++ b/net/disk_cache/disk_cache_test_util.h
@@ -5,9 +5,13 @@
#ifndef NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
#define NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
@@ -25,8 +29,9 @@
std::string GenerateKey(bool same_length);
// Returns true if the cache is not corrupt.
-bool CheckCacheIntegrity(const base::FilePath& path, bool new_eviction,
- uint32 mask);
+bool CheckCacheIntegrity(const base::FilePath& path,
+ bool new_eviction,
+ uint32_t mask);
// -----------------------------------------------------------------------
diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc
index e0605c5..7806da8 100644
--- a/net/disk_cache/entry_unittest.cc
+++ b/net/disk_cache/entry_unittest.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
+#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/threading/platform_thread.h"
@@ -1638,8 +1638,11 @@
}
// Writes |buf_1| to offset and reads it back as |buf_2|.
-void VerifySparseIO(disk_cache::Entry* entry, int64 offset,
- net::IOBuffer* buf_1, int size, net::IOBuffer* buf_2) {
+void VerifySparseIO(disk_cache::Entry* entry,
+ int64_t offset,
+ net::IOBuffer* buf_1,
+ int size,
+ net::IOBuffer* buf_2) {
net::TestCompletionCallback cb;
memset(buf_2->data(), 0, size);
@@ -1657,7 +1660,9 @@
// Reads |size| bytes from |entry| at |offset| and verifies that they are the
// same as the content of the provided |buffer|.
-void VerifyContentSparseIO(disk_cache::Entry* entry, int64 offset, char* buffer,
+void VerifyContentSparseIO(disk_cache::Entry* entry,
+ int64_t offset,
+ char* buffer,
int size) {
net::TestCompletionCallback cb;
@@ -1754,7 +1759,7 @@
EXPECT_EQ(kSize, WriteSparseData(entry, 0x20F4400, buf.get(), kSize));
// We stop at the first empty block.
- int64 start;
+ int64_t start;
net::TestCompletionCallback cb;
int rv = entry->GetAvailableRange(
0x20F0000, kSize * 2, &start, cb.callback());
@@ -1833,7 +1838,7 @@
int offset = 1024 - 500;
int rv = 0;
net::TestCompletionCallback cb;
- int64 start;
+ int64_t start;
for (int i = 0; i < 5; i++) {
// Check result of last GetAvailableRange.
EXPECT_EQ(0, rv);
@@ -1887,8 +1892,8 @@
// Any starting offset is fine as long as it is 1024-bytes aligned.
int rv = 0;
net::TestCompletionCallback cb;
- int64 start;
- int64 offset = 1024 * 11;
+ int64_t start;
+ int64_t offset = 1024 * 11;
for (; offset < 20000; offset += kSize) {
rv = entry->WriteSparseData(offset, buf_1.get(), kSize, cb.callback());
EXPECT_EQ(kSize, cb.GetResult(rv));
@@ -2025,7 +2030,7 @@
entry->WriteSparseData(
50000, buf.get(), 8192, net::CompletionCallback()));
- int64 start;
+ int64_t start;
net::TestCompletionCallback cb;
// Test that we stop at a discontinuous child at the second block.
int rv = entry->GetAvailableRange(0, 10000, &start, cb.callback());
@@ -2117,7 +2122,7 @@
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kSize));
CacheTestFillBuffer(buf->data(), kSize, false);
- int64 offset = 1024;
+ int64_t offset = 1024;
// Write to a bunch of ranges.
for (int i = 0; i < 12; i++) {
EXPECT_EQ(kSize, WriteSparseData(entry1, offset, buf.get(), kSize));
@@ -2205,7 +2210,7 @@
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kSize));
CacheTestFillBuffer(buf->data(), kSize, false);
- int64 offset = 1024;
+ int64_t offset = 1024;
// Write to a bunch of ranges.
for (int i = 0; i < 12; i++) {
EXPECT_EQ(kSize,
@@ -2263,7 +2268,7 @@
EXPECT_EQ(0, ReadSparseData(entry, 99, buf2.get(), kSize));
int rv;
- int64 start;
+ int64_t start;
net::TestCompletionCallback cb;
if (memory_only_ || simple_cache_mode_) {
rv = entry->GetAvailableRange(0, 600, &start, cb.callback());
@@ -2395,7 +2400,7 @@
1024 * 1024 - 4096, buf.get(), kSize, cb1.callback());
EXPECT_EQ(net::ERR_IO_PENDING, rv);
- int64 offset = 0;
+ int64_t offset = 0;
rv = entry->GetAvailableRange(offset, kSize, &offset, cb5.callback());
rv = cb5.GetResult(rv);
if (!cb1.have_result()) {
@@ -2637,7 +2642,7 @@
if (!entry_file0.IsValid())
return false;
- int64 file_offset =
+ int64_t file_offset =
sizeof(disk_cache::SimpleFileHeader) + key.size() + kDataSize - 2;
EXPECT_EQ(1, entry_file0.Write(file_offset, "X", 1));
*data_size = kDataSize;
@@ -2690,7 +2695,7 @@
entry->Doom(); // Should not crash.
}
-bool TruncatePath(const base::FilePath& file_path, int64 length) {
+bool TruncatePath(const base::FilePath& file_path, int64_t length) {
base::File file(file_path, base::File::FLAG_WRITE | base::File::FLAG_OPEN);
if (!file.IsValid())
return false;
@@ -2721,7 +2726,7 @@
int kTruncationBytes = -static_cast<int>(sizeof(disk_cache::SimpleFileEOF));
const base::FilePath entry_path = cache_path_.AppendASCII(
disk_cache::simple_util::GetFilenameFromKeyAndFileIndex(key, 0));
- const int64 invalid_size =
+ const int64_t invalid_size =
disk_cache::simple_util::GetFileSizeFromKeyAndDataSize(key,
kTruncationBytes);
EXPECT_TRUE(TruncatePath(entry_path, invalid_size));
diff --git a/net/disk_cache/memory/mem_backend_impl.cc b/net/disk_cache/memory/mem_backend_impl.cc
index 9948660..d7a7a16 100644
--- a/net/disk_cache/memory/mem_backend_impl.cc
+++ b/net/disk_cache/memory/mem_backend_impl.cc
@@ -57,7 +57,7 @@
if (max_size_)
return true;
- int64 total_memory = base::SysInfo::AmountOfPhysicalMemory();
+ int64_t total_memory = base::SysInfo::AmountOfPhysicalMemory();
if (total_memory <= 0) {
max_size_ = kDefaultInMemoryCacheSize;
@@ -70,7 +70,7 @@
if (total_memory > kDefaultInMemoryCacheSize * 5)
max_size_ = kDefaultInMemoryCacheSize * 5;
else
- max_size_ = static_cast<int32>(total_memory);
+ max_size_ = static_cast<int32_t>(total_memory);
return true;
}
@@ -107,7 +107,7 @@
rankings_.UpdateRank(node);
}
-void MemBackendImpl::ModifyStorageSize(int32 old_size, int32 new_size) {
+void MemBackendImpl::ModifyStorageSize(int32_t old_size, int32_t new_size) {
if (old_size >= new_size)
SubstractStorageSize(old_size - new_size);
else
@@ -130,8 +130,8 @@
return net::MEMORY_CACHE;
}
-int32 MemBackendImpl::GetEntryCount() const {
- return static_cast<int32>(entries_.size());
+int32_t MemBackendImpl::GetEntryCount() const {
+ return static_cast<int32_t>(entries_.size());
}
int MemBackendImpl::OpenEntry(const std::string& key, Entry** entry,
@@ -335,7 +335,7 @@
return;
}
-void MemBackendImpl::AddStorageSize(int32 bytes) {
+void MemBackendImpl::AddStorageSize(int32_t bytes) {
current_size_ += bytes;
DCHECK_GE(current_size_, 0);
@@ -343,7 +343,7 @@
TrimCache(false);
}
-void MemBackendImpl::SubstractStorageSize(int32 bytes) {
+void MemBackendImpl::SubstractStorageSize(int32_t bytes) {
current_size_ -= bytes;
DCHECK_GE(current_size_, 0);
}
diff --git a/net/disk_cache/memory/mem_backend_impl.h b/net/disk_cache/memory/mem_backend_impl.h
index d3bb005..e2a9f1a 100644
--- a/net/disk_cache/memory/mem_backend_impl.h
+++ b/net/disk_cache/memory/mem_backend_impl.h
@@ -7,8 +7,11 @@
#ifndef NET_DISK_CACHE_MEMORY_MEM_BACKEND_IMPL_H_
#define NET_DISK_CACHE_MEMORY_MEM_BACKEND_IMPL_H_
+#include <stdint.h>
+
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_split.h"
#include "net/disk_cache/disk_cache.h"
@@ -49,7 +52,7 @@
void UpdateRank(MemEntryImpl* node);
// A user data block is being created, extended or truncated.
- void ModifyStorageSize(int32 old_size, int32 new_size);
+ void ModifyStorageSize(int32_t old_size, int32_t new_size);
// Returns the maximum size for a file to reside on the cache.
int MaxFileSize() const;
@@ -65,7 +68,7 @@
// Backend interface.
net::CacheType GetCacheType() const override;
- int32 GetEntryCount() const override;
+ int32_t GetEntryCount() const override;
int OpenEntry(const std::string& key,
Entry** entry,
const CompletionCallback& callback) override;
@@ -106,13 +109,13 @@
void TrimCache(bool empty);
// Handles the used storage count.
- void AddStorageSize(int32 bytes);
- void SubstractStorageSize(int32 bytes);
+ void AddStorageSize(int32_t bytes);
+ void SubstractStorageSize(int32_t bytes);
EntryMap entries_;
MemRankings rankings_; // Rankings to be able to trim the cache.
- int32 max_size_; // Maximum data size for this instance.
- int32 current_size_;
+ int32_t max_size_; // Maximum data size for this instance.
+ int32_t current_size_;
net::NetLog* net_log_;
diff --git a/net/disk_cache/memory/mem_entry_impl.cc b/net/disk_cache/memory/mem_entry_impl.cc
index daa39801..55cdd14 100644
--- a/net/disk_cache/memory/mem_entry_impl.cc
+++ b/net/disk_cache/memory/mem_entry_impl.cc
@@ -26,12 +26,12 @@
const int kMaxSparseEntrySize = 1 << kMaxSparseEntryBits;
// Convert global offset to child index.
-inline int ToChildIndex(int64 offset) {
+inline int ToChildIndex(int64_t offset) {
return static_cast<int>(offset >> kMaxSparseEntryBits);
}
// Convert global offset to offset in child entry.
-inline int ToChildOffset(int64 offset) {
+inline int ToChildOffset(int64_t offset) {
return static_cast<int>(offset & (kMaxSparseEntrySize - 1));
}
@@ -88,7 +88,7 @@
CreateNetLogEntryCreationCallback(this, true));
Open();
- backend_->ModifyStorageSize(0, static_cast<int32>(key.size()));
+ backend_->ModifyStorageSize(0, static_cast<int32_t>(key.size()));
return true;
}
@@ -177,7 +177,7 @@
return last_modified_;
}
-int32 MemEntryImpl::GetDataSize(int index) const {
+int32_t MemEntryImpl::GetDataSize(int index) const {
if (index < 0 || index >= NUM_STREAMS)
return 0;
return data_size_[index];
@@ -219,7 +219,9 @@
return result;
}
-int MemEntryImpl::ReadSparseData(int64 offset, IOBuffer* buf, int buf_len,
+int MemEntryImpl::ReadSparseData(int64_t offset,
+ IOBuffer* buf,
+ int buf_len,
const CompletionCallback& callback) {
if (net_log_.IsCapturing()) {
net_log_.BeginEvent(
@@ -232,7 +234,9 @@
return result;
}
-int MemEntryImpl::WriteSparseData(int64 offset, IOBuffer* buf, int buf_len,
+int MemEntryImpl::WriteSparseData(int64_t offset,
+ IOBuffer* buf,
+ int buf_len,
const CompletionCallback& callback) {
if (net_log_.IsCapturing()) {
net_log_.BeginEvent(
@@ -245,7 +249,9 @@
return result;
}
-int MemEntryImpl::GetAvailableRange(int64 offset, int len, int64* start,
+int MemEntryImpl::GetAvailableRange(int64_t offset,
+ int len,
+ int64_t* start,
const CompletionCallback& callback) {
if (net_log_.IsCapturing()) {
net_log_.BeginEvent(
@@ -275,7 +281,7 @@
MemEntryImpl::~MemEntryImpl() {
for (int i = 0; i < NUM_STREAMS; i++)
backend_->ModifyStorageSize(data_size_[i], 0);
- backend_->ModifyStorageSize(static_cast<int32>(key_.size()), 0);
+ backend_->ModifyStorageSize(static_cast<int32_t>(key_.size()), 0);
net_log_.EndEvent(net::NetLog::TYPE_DISK_CACHE_MEM_ENTRY_IMPL);
}
@@ -344,7 +350,8 @@
return buf_len;
}
-int MemEntryImpl::InternalReadSparseData(int64 offset, IOBuffer* buf,
+int MemEntryImpl::InternalReadSparseData(int64_t offset,
+ IOBuffer* buf,
int buf_len) {
DCHECK(type() == kParentEntry);
@@ -401,7 +408,8 @@
return io_buf->BytesConsumed();
}
-int MemEntryImpl::InternalWriteSparseData(int64 offset, IOBuffer* buf,
+int MemEntryImpl::InternalWriteSparseData(int64_t offset,
+ IOBuffer* buf,
int buf_len) {
DCHECK(type() == kParentEntry);
@@ -467,7 +475,7 @@
return io_buf->BytesConsumed();
}
-int MemEntryImpl::GetAvailableRange(int64 offset, int len, int64* start) {
+int MemEntryImpl::GetAvailableRange(int64_t offset, int len, int64_t* start) {
DCHECK(type() == kParentEntry);
DCHECK(start);
@@ -577,7 +585,7 @@
return true;
}
-MemEntryImpl* MemEntryImpl::OpenChild(int64 offset, bool create) {
+MemEntryImpl* MemEntryImpl::OpenChild(int64_t offset, bool create) {
DCHECK(type() == kParentEntry);
int index = ToChildIndex(offset);
EntryMap::iterator i = children_->find(index);
@@ -592,7 +600,7 @@
return NULL;
}
-int MemEntryImpl::FindNextChild(int64 offset, int len, MemEntryImpl** child) {
+int MemEntryImpl::FindNextChild(int64_t offset, int len, MemEntryImpl** child) {
DCHECK(child);
*child = NULL;
int scanned_len = 0;
diff --git a/net/disk_cache/memory/mem_entry_impl.h b/net/disk_cache/memory/mem_entry_impl.h
index c550b977..52a1696f 100644
--- a/net/disk_cache/memory/mem_entry_impl.h
+++ b/net/disk_cache/memory/mem_entry_impl.h
@@ -5,7 +5,10 @@
#ifndef NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_
#define NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_
+#include <stdint.h>
+
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/disk_cache/disk_cache.h"
#include "net/log/net_log.h"
@@ -91,7 +94,7 @@
std::string GetKey() const override;
base::Time GetLastUsed() const override;
base::Time GetLastModified() const override;
- int32 GetDataSize(int index) const override;
+ int32_t GetDataSize(int index) const override;
int ReadData(int index,
int offset,
IOBuffer* buf,
@@ -103,17 +106,17 @@
int buf_len,
const CompletionCallback& callback,
bool truncate) override;
- int ReadSparseData(int64 offset,
+ int ReadSparseData(int64_t offset,
IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int WriteSparseData(int64 offset,
+ int WriteSparseData(int64_t offset,
IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int GetAvailableRange(int64 offset,
+ int GetAvailableRange(int64_t offset,
int len,
- int64* start,
+ int64_t* start,
const CompletionCallback& callback) override;
bool CouldBeSparse() const override;
void CancelSparseIO() override {}
@@ -133,11 +136,11 @@
int InternalReadData(int index, int offset, IOBuffer* buf, int buf_len);
int InternalWriteData(int index, int offset, IOBuffer* buf, int buf_len,
bool truncate);
- int InternalReadSparseData(int64 offset, IOBuffer* buf, int buf_len);
- int InternalWriteSparseData(int64 offset, IOBuffer* buf, int buf_len);
+ int InternalReadSparseData(int64_t offset, IOBuffer* buf, int buf_len);
+ int InternalWriteSparseData(int64_t offset, IOBuffer* buf, int buf_len);
// Old Entry interface.
- int GetAvailableRange(int64 offset, int len, int64* start);
+ int GetAvailableRange(int64_t offset, int len, int64_t* start);
// Grows and cleans up the data buffer.
void PrepareTarget(int index, int offset, int buf_len);
@@ -158,19 +161,19 @@
// child entry or this entry itself if |offset| points to the first range.
// If such entry does not exist and |create| is true, a new child entry is
// created.
- MemEntryImpl* OpenChild(int64 offset, bool create);
+ MemEntryImpl* OpenChild(int64_t offset, bool create);
// Finds the first child located within the range [|offset|, |offset + len|).
// Returns the number of bytes ahead of |offset| to reach the first available
// bytes in the entry. The first child found is output to |child|.
- int FindNextChild(int64 offset, int len, MemEntryImpl** child);
+ int FindNextChild(int64_t offset, int len, MemEntryImpl** child);
// Removes child indexed by |child_id| from the children map.
void DetachChild(int child_id);
std::string key_;
std::vector<char> data_[NUM_STREAMS]; // User data.
- int32 data_size_[NUM_STREAMS];
+ int32_t data_size_[NUM_STREAMS];
int ref_count_;
int child_id_; // The ID of a child entry.
diff --git a/net/disk_cache/memory/mem_rankings.h b/net/disk_cache/memory/mem_rankings.h
index b75bfc1..d660cab 100644
--- a/net/disk_cache/memory/mem_rankings.h
+++ b/net/disk_cache/memory/mem_rankings.h
@@ -7,7 +7,7 @@
#ifndef NET_DISK_CACHE_MEMORY_MEM_RANKINGS_H_
#define NET_DISK_CACHE_MEMORY_MEM_RANKINGS_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
namespace disk_cache {
diff --git a/net/disk_cache/net_log_parameters.cc b/net/disk_cache/net_log_parameters.cc
index 53c873f..4f95fbb 100644
--- a/net/disk_cache/net_log_parameters.cc
+++ b/net/disk_cache/net_log_parameters.cc
@@ -52,7 +52,7 @@
}
scoped_ptr<base::Value> NetLogSparseOperationCallback(
- int64 offset,
+ int64_t offset,
int buf_len,
net::NetLogCaptureMode /* capture_mode */) {
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
@@ -74,7 +74,7 @@
}
scoped_ptr<base::Value> NetLogGetAvailableRangeResultCallback(
- int64 start,
+ int64_t start,
int result,
net::NetLogCaptureMode /* capture_mode */) {
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
@@ -113,7 +113,7 @@
}
net::NetLog::ParametersCallback CreateNetLogSparseOperationCallback(
- int64 offset,
+ int64_t offset,
int buf_len) {
return base::Bind(&NetLogSparseOperationCallback, offset, buf_len);
}
@@ -125,7 +125,7 @@
}
net::NetLog::ParametersCallback CreateNetLogGetAvailableRangeResultCallback(
- int64 start,
+ int64_t start,
int result) {
return base::Bind(&NetLogGetAvailableRangeResultCallback, start, result);
}
diff --git a/net/disk_cache/net_log_parameters.h b/net/disk_cache/net_log_parameters.h
index 082390b9..2bbed12 100644
--- a/net/disk_cache/net_log_parameters.h
+++ b/net/disk_cache/net_log_parameters.h
@@ -5,6 +5,8 @@
#ifndef NET_DISK_CACHE_NET_LOG_PARAMETERS_H_
#define NET_DISK_CACHE_NET_LOG_PARAMETERS_H_
+#include <stdint.h>
+
#include <string>
#include "net/log/net_log.h"
@@ -42,7 +44,7 @@
// Creates a NetLog callback that returns parameters for when a sparse
// operation is started.
net::NetLog::ParametersCallback CreateNetLogSparseOperationCallback(
- int64 offset,
+ int64_t offset,
int buf_len);
// Creates a NetLog callback that returns parameters for when a read or write
@@ -54,7 +56,7 @@
// Creates a NetLog callback that returns parameters for when a call to
// GetAvailableRange returns.
net::NetLog::ParametersCallback CreateNetLogGetAvailableRangeResultCallback(
- int64 start,
+ int64_t start,
int result);
} // namespace disk_cache
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc
index 09f66d31..cb907b67 100644
--- a/net/disk_cache/simple/simple_backend_impl.cc
+++ b/net/disk_cache/simple/simple_backend_impl.cc
@@ -17,6 +17,7 @@
#include "base/files/file_util.h"
#include "base/lazy_instance.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
@@ -209,7 +210,7 @@
}
static scoped_ptr<SimpleEntryImpl::ActiveEntryProxy> Create(
- int64 entry_hash,
+ int64_t entry_hash,
SimpleBackendImpl* backend) {
scoped_ptr<SimpleEntryImpl::ActiveEntryProxy>
proxy(new ActiveEntryProxy(entry_hash, backend));
@@ -217,12 +218,10 @@
}
private:
- ActiveEntryProxy(uint64 entry_hash,
- SimpleBackendImpl* backend)
- : entry_hash_(entry_hash),
- backend_(backend->AsWeakPtr()) {}
+ ActiveEntryProxy(uint64_t entry_hash, SimpleBackendImpl* backend)
+ : entry_hash_(entry_hash), backend_(backend->AsWeakPtr()) {}
- uint64 entry_hash_;
+ uint64_t entry_hash_;
base::WeakPtr<SimpleBackendImpl> backend_;
};
@@ -282,15 +281,15 @@
return static_cast<int>(index_->max_size() / kMaxFileRatio);
}
-void SimpleBackendImpl::OnDoomStart(uint64 entry_hash) {
+void SimpleBackendImpl::OnDoomStart(uint64_t entry_hash) {
DCHECK_EQ(0u, entries_pending_doom_.count(entry_hash));
entries_pending_doom_.insert(
std::make_pair(entry_hash, std::vector<Closure>()));
}
-void SimpleBackendImpl::OnDoomComplete(uint64 entry_hash) {
+void SimpleBackendImpl::OnDoomComplete(uint64_t entry_hash) {
DCHECK_EQ(1u, entries_pending_doom_.count(entry_hash));
- base::hash_map<uint64, std::vector<Closure> >::iterator it =
+ base::hash_map<uint64_t, std::vector<Closure>>::iterator it =
entries_pending_doom_.find(entry_hash);
std::vector<Closure> to_run_closures;
to_run_closures.swap(it->second);
@@ -300,13 +299,13 @@
std::mem_fun_ref(&Closure::Run));
}
-void SimpleBackendImpl::DoomEntries(std::vector<uint64>* entry_hashes,
+void SimpleBackendImpl::DoomEntries(std::vector<uint64_t>* entry_hashes,
const net::CompletionCallback& callback) {
- scoped_ptr<std::vector<uint64> >
- mass_doom_entry_hashes(new std::vector<uint64>());
+ scoped_ptr<std::vector<uint64_t>> mass_doom_entry_hashes(
+ new std::vector<uint64_t>());
mass_doom_entry_hashes->swap(*entry_hashes);
- std::vector<uint64> to_doom_individually_hashes;
+ std::vector<uint64_t> to_doom_individually_hashes;
// For each of the entry hashes, there are two cases:
// 1. The entry is either open or pending doom, and so it should be doomed
@@ -314,7 +313,7 @@
// 2. The entry is not in use at all, so we can call
// SimpleSynchronousEntry::DoomEntrySet and delete the files en masse.
for (int i = mass_doom_entry_hashes->size() - 1; i >= 0; --i) {
- const uint64 entry_hash = (*mass_doom_entry_hashes)[i];
+ const uint64_t entry_hash = (*mass_doom_entry_hashes)[i];
DCHECK(active_entries_.count(entry_hash) == 0 ||
entries_pending_doom_.count(entry_hash) == 0);
if (!active_entries_.count(entry_hash) &&
@@ -331,16 +330,18 @@
net::CompletionCallback barrier_callback =
MakeBarrierCompletionCallback(to_doom_individually_hashes.size() + 1,
callback);
- for (std::vector<uint64>::const_iterator
+ for (std::vector<uint64_t>::const_iterator
it = to_doom_individually_hashes.begin(),
- end = to_doom_individually_hashes.end(); it != end; ++it) {
+ end = to_doom_individually_hashes.end();
+ it != end; ++it) {
const int doom_result = DoomEntryFromHash(*it, barrier_callback);
DCHECK_EQ(net::ERR_IO_PENDING, doom_result);
index_->Remove(*it);
}
- for (std::vector<uint64>::const_iterator it = mass_doom_entry_hashes->begin(),
- end = mass_doom_entry_hashes->end();
+ for (std::vector<uint64_t>::const_iterator
+ it = mass_doom_entry_hashes->begin(),
+ end = mass_doom_entry_hashes->end();
it != end; ++it) {
index_->Remove(*it);
OnDoomStart(*it);
@@ -348,7 +349,7 @@
// Taking this pointer here avoids undefined behaviour from calling
// base::Passed before mass_doom_entry_hashes.get().
- std::vector<uint64>* mass_doom_entry_hashes_ptr =
+ std::vector<uint64_t>* mass_doom_entry_hashes_ptr =
mass_doom_entry_hashes.get();
PostTaskAndReplyWithResult(worker_pool_.get(),
FROM_HERE,
@@ -365,7 +366,7 @@
return net::DISK_CACHE;
}
-int32 SimpleBackendImpl::GetEntryCount() const {
+int32_t SimpleBackendImpl::GetEntryCount() const {
// TODO(pasko): Use directory file count when index is not ready.
return index_->GetEntryCount();
}
@@ -373,11 +374,11 @@
int SimpleBackendImpl::OpenEntry(const std::string& key,
Entry** entry,
const CompletionCallback& callback) {
- const uint64 entry_hash = simple_util::GetEntryHashKey(key);
+ const uint64_t entry_hash = simple_util::GetEntryHashKey(key);
// TODO(gavinp): Factor out this (not quite completely) repetitive code
// block from OpenEntry/CreateEntry/DoomEntry.
- base::hash_map<uint64, std::vector<Closure> >::iterator it =
+ base::hash_map<uint64_t, std::vector<Closure>>::iterator it =
entries_pending_doom_.find(entry_hash);
if (it != entries_pending_doom_.end()) {
Callback<int(const net::CompletionCallback&)> operation =
@@ -403,9 +404,9 @@
Entry** entry,
const CompletionCallback& callback) {
DCHECK_LT(0u, key.size());
- const uint64 entry_hash = simple_util::GetEntryHashKey(key);
+ const uint64_t entry_hash = simple_util::GetEntryHashKey(key);
- base::hash_map<uint64, std::vector<Closure> >::iterator it =
+ base::hash_map<uint64_t, std::vector<Closure>>::iterator it =
entries_pending_doom_.find(entry_hash);
if (it != entries_pending_doom_.end()) {
Callback<int(const net::CompletionCallback&)> operation =
@@ -422,9 +423,9 @@
int SimpleBackendImpl::DoomEntry(const std::string& key,
const net::CompletionCallback& callback) {
- const uint64 entry_hash = simple_util::GetEntryHashKey(key);
+ const uint64_t entry_hash = simple_util::GetEntryHashKey(key);
- base::hash_map<uint64, std::vector<Closure> >::iterator it =
+ base::hash_map<uint64_t, std::vector<Closure>>::iterator it =
entries_pending_doom_.find(entry_hash);
if (it != entries_pending_doom_.end()) {
Callback<int(const net::CompletionCallback&)> operation =
@@ -494,7 +495,7 @@
hashes_to_enumerate_ = backend_->index()->GetAllHashes().Pass();
while (!hashes_to_enumerate_->empty()) {
- uint64 entry_hash = hashes_to_enumerate_->back();
+ uint64_t entry_hash = hashes_to_enumerate_->back();
hashes_to_enumerate_->pop_back();
if (backend_->index()->Has(entry_hash)) {
*next_entry = NULL;
@@ -529,7 +530,7 @@
private:
base::WeakPtr<SimpleBackendImpl> backend_;
- scoped_ptr<std::vector<uint64> > hashes_to_enumerate_;
+ scoped_ptr<std::vector<uint64_t>> hashes_to_enumerate_;
base::WeakPtrFactory<SimpleIterator> weak_factory_;
};
@@ -565,7 +566,7 @@
callback.Run(result);
return;
}
- scoped_ptr<std::vector<uint64>> removed_key_hashes(
+ scoped_ptr<std::vector<uint64_t>> removed_key_hashes(
index_->GetEntriesBetween(initial_time, end_time).release());
DoomEntries(removed_key_hashes.get(), callback);
}
@@ -580,7 +581,7 @@
SimpleBackendImpl::DiskStatResult SimpleBackendImpl::InitCacheStructureOnDisk(
const base::FilePath& path,
- uint64 suggested_max_size) {
+ uint64_t suggested_max_size) {
DiskStatResult result;
result.max_size = suggested_max_size;
result.net_error = net::OK;
@@ -593,7 +594,7 @@
disk_cache::simple_util::GetMTime(path, &result.cache_dir_mtime);
DCHECK(mtime_result);
if (!result.max_size) {
- int64 available = base::SysInfo::AmountOfFreeDiskSpace(path);
+ int64_t available = base::SysInfo::AmountOfFreeDiskSpace(path);
result.max_size = disk_cache::PreferredCacheSize(available);
}
DCHECK(result.max_size);
@@ -602,7 +603,7 @@
}
scoped_refptr<SimpleEntryImpl> SimpleBackendImpl::CreateOrFindActiveEntry(
- const uint64 entry_hash,
+ const uint64_t entry_hash,
const std::string& key) {
DCHECK_EQ(entry_hash, simple_util::GetEntryHashKey(key));
std::pair<EntryMap::iterator, bool> insert_result =
@@ -627,10 +628,10 @@
return make_scoped_refptr(it->second);
}
-int SimpleBackendImpl::OpenEntryFromHash(uint64 entry_hash,
+int SimpleBackendImpl::OpenEntryFromHash(uint64_t entry_hash,
Entry** entry,
const CompletionCallback& callback) {
- base::hash_map<uint64, std::vector<Closure> >::iterator it =
+ base::hash_map<uint64_t, std::vector<Closure>>::iterator it =
entries_pending_doom_.find(entry_hash);
if (it != entries_pending_doom_.end()) {
Callback<int(const net::CompletionCallback&)> operation =
@@ -654,12 +655,12 @@
return simple_entry->OpenEntry(entry, backend_callback);
}
-int SimpleBackendImpl::DoomEntryFromHash(uint64 entry_hash,
+int SimpleBackendImpl::DoomEntryFromHash(uint64_t entry_hash,
const CompletionCallback& callback) {
Entry** entry = new Entry*();
scoped_ptr<Entry*> scoped_entry(entry);
- base::hash_map<uint64, std::vector<Closure> >::iterator pending_it =
+ base::hash_map<uint64_t, std::vector<Closure>>::iterator pending_it =
entries_pending_doom_.find(entry_hash);
if (pending_it != entries_pending_doom_.end()) {
Callback<int(const net::CompletionCallback&)> operation =
@@ -676,14 +677,14 @@
// There's no pending dooms, nor any open entry. We can make a trivial
// call to DoomEntries() to delete this entry.
- std::vector<uint64> entry_hash_vector;
+ std::vector<uint64_t> entry_hash_vector;
entry_hash_vector.push_back(entry_hash);
DoomEntries(&entry_hash_vector, callback);
return net::ERR_IO_PENDING;
}
void SimpleBackendImpl::OnEntryOpenedFromHash(
- uint64 hash,
+ uint64_t hash,
Entry** entry,
const scoped_refptr<SimpleEntryImpl>& simple_entry,
const CompletionCallback& callback,
@@ -736,10 +737,10 @@
}
void SimpleBackendImpl::DoomEntriesComplete(
- scoped_ptr<std::vector<uint64> > entry_hashes,
+ scoped_ptr<std::vector<uint64_t>> entry_hashes,
const net::CompletionCallback& callback,
int result) {
- for (const uint64& entry_hash : *entry_hashes)
+ for (const uint64_t& entry_hash : *entry_hashes)
OnDoomComplete(entry_hash);
callback.Run(result);
}
diff --git a/net/disk_cache/simple/simple_backend_impl.h b/net/disk_cache/simple/simple_backend_impl.h
index c8cac2112..6db40163 100644
--- a/net/disk_cache/simple/simple_backend_impl.h
+++ b/net/disk_cache/simple/simple_backend_impl.h
@@ -5,6 +5,8 @@
#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_
+#include <stdint.h>
+
#include <string>
#include <utility>
#include <vector>
@@ -77,20 +79,20 @@
// The entry for |entry_hash| is being doomed; the backend will not attempt
// run new operations for this |entry_hash| until the Doom is completed.
- void OnDoomStart(uint64 entry_hash);
+ void OnDoomStart(uint64_t entry_hash);
// The entry for |entry_hash| has been successfully doomed, we can now allow
// operations on this entry, and we can run any operations enqueued while the
// doom completed.
- void OnDoomComplete(uint64 entry_hash);
+ void OnDoomComplete(uint64_t entry_hash);
// SimpleIndexDelegate:
- void DoomEntries(std::vector<uint64>* entry_hashes,
+ void DoomEntries(std::vector<uint64_t>* entry_hashes,
const CompletionCallback& callback) override;
// Backend:
net::CacheType GetCacheType() const override;
- int32 GetEntryCount() const override;
+ int32_t GetEntryCount() const override;
int OpenEntry(const std::string& key,
Entry** entry,
const CompletionCallback& callback) override;
@@ -114,9 +116,9 @@
class SimpleIterator;
friend class SimpleIterator;
- typedef base::hash_map<uint64, SimpleEntryImpl*> EntryMap;
+ typedef base::hash_map<uint64_t, SimpleEntryImpl*> EntryMap;
- typedef base::Callback<void(base::Time mtime, uint64 max_size, int result)>
+ typedef base::Callback<void(base::Time mtime, uint64_t max_size, int result)>
InitializeIndexCallback;
class ActiveEntryProxy;
@@ -125,7 +127,7 @@
// Return value of InitCacheStructureOnDisk().
struct DiskStatResult {
base::Time cache_dir_mtime;
- uint64 max_size;
+ uint64_t max_size;
bool detected_magic_number_mismatch;
int net_error;
};
@@ -147,32 +149,33 @@
// Try to create the directory if it doesn't exist. This must run on the IO
// thread.
static DiskStatResult InitCacheStructureOnDisk(const base::FilePath& path,
- uint64 suggested_max_size);
+ uint64_t suggested_max_size);
// Searches |active_entries_| for the entry corresponding to |key|. If found,
// returns the found entry. Otherwise, creates a new entry and returns that.
scoped_refptr<SimpleEntryImpl> CreateOrFindActiveEntry(
- uint64 entry_hash,
+ uint64_t entry_hash,
const std::string& key);
// Given a hash, will try to open the corresponding Entry. If we have an Entry
// corresponding to |hash| in the map of active entries, opens it. Otherwise,
// a new empty Entry will be created, opened and filled with information from
// the disk.
- int OpenEntryFromHash(uint64 entry_hash,
+ int OpenEntryFromHash(uint64_t entry_hash,
Entry** entry,
const CompletionCallback& callback);
// Doom the entry corresponding to |entry_hash|, if it's active or currently
// pending doom. This function does not block if there is an active entry,
// which is very important to prevent races in DoomEntries() above.
- int DoomEntryFromHash(uint64 entry_hash, const CompletionCallback & callback);
+ int DoomEntryFromHash(uint64_t entry_hash,
+ const CompletionCallback& callback);
// Called when we tried to open an entry with hash alone. When a blank entry
// has been created and filled in with information from the disk - based on a
// hash alone - this checks that a duplicate active entry was not created
// using a key in the meantime.
- void OnEntryOpenedFromHash(uint64 hash,
+ void OnEntryOpenedFromHash(uint64_t hash,
Entry** entry,
const scoped_refptr<SimpleEntryImpl>& simple_entry,
const CompletionCallback& callback,
@@ -188,7 +191,7 @@
// A callback thunk used by DoomEntries to clear the |entries_pending_doom_|
// after a mass doom.
- void DoomEntriesComplete(scoped_ptr<std::vector<uint64> > entry_hashes,
+ void DoomEntriesComplete(scoped_ptr<std::vector<uint64_t>> entry_hashes,
const CompletionCallback& callback,
int result);
@@ -207,7 +210,7 @@
// these entries cannot have Doom/Create/Open operations run until the doom
// is complete. The base::Closure map target is used to store deferred
// operations to be run at the completion of the Doom.
- base::hash_map<uint64, std::vector<base::Closure> > entries_pending_doom_;
+ base::hash_map<uint64_t, std::vector<base::Closure>> entries_pending_doom_;
net::NetLog* const net_log_;
};
diff --git a/net/disk_cache/simple/simple_backend_version.h b/net/disk_cache/simple/simple_backend_version.h
index fe350a2..d6ddf9b 100644
--- a/net/disk_cache/simple/simple_backend_version.h
+++ b/net/disk_cache/simple/simple_backend_version.h
@@ -5,6 +5,8 @@
#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_VERSION_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_VERSION_H_
+#include <stdint.h>
+
namespace disk_cache {
// Short rules helping to think about data upgrades within Simple Cache:
@@ -16,11 +18,11 @@
// |kSimpleVersion - 1| then the whole cache directory will be cleared.
// * Dropping cache data on disk or some of its parts can be a valid way to
// Upgrade.
-const uint32 kSimpleVersion = 6;
+const uint32_t kSimpleVersion = 6;
// The version of the entry file(s) as written to disk. Must be updated iff the
// entry format changes with the overall backend version update.
-const uint32 kSimpleEntryVersionOnDisk = 5;
+const uint32_t kSimpleEntryVersionOnDisk = 5;
} // namespace disk_cache
diff --git a/net/disk_cache/simple/simple_entry_format.h b/net/disk_cache/simple/simple_entry_format.h
index 767efb2e..aec7162 100644
--- a/net/disk_cache/simple/simple_entry_format.h
+++ b/net/disk_cache/simple/simple_entry_format.h
@@ -7,7 +7,6 @@
#include <stdint.h>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
namespace base {
@@ -16,9 +15,9 @@
namespace disk_cache {
-const uint64 kSimpleInitialMagicNumber = UINT64_C(0xfcfb6d1ba7725c30);
-const uint64 kSimpleFinalMagicNumber = UINT64_C(0xf4fa6f45970d41d8);
-const uint64 kSimpleSparseRangeMagicNumber = UINT64_C(0xeb97bf016553676b);
+const uint64_t kSimpleInitialMagicNumber = UINT64_C(0xfcfb6d1ba7725c30);
+const uint64_t kSimpleFinalMagicNumber = UINT64_C(0xf4fa6f45970d41d8);
+const uint64_t kSimpleSparseRangeMagicNumber = UINT64_C(0xeb97bf016553676b);
// A file containing stream 0 and stream 1 in the Simple cache consists of:
// - a SimpleFileHeader.
@@ -39,10 +38,10 @@
struct NET_EXPORT_PRIVATE SimpleFileHeader {
SimpleFileHeader();
- uint64 initial_magic_number;
- uint32 version;
- uint32 key_length;
- uint32 key_hash;
+ uint64_t initial_magic_number;
+ uint32_t version;
+ uint32_t key_length;
+ uint32_t key_hash;
};
struct NET_EXPORT_PRIVATE SimpleFileEOF {
@@ -52,20 +51,20 @@
SimpleFileEOF();
- uint64 final_magic_number;
- uint32 flags;
- uint32 data_crc32;
+ uint64_t final_magic_number;
+ uint32_t flags;
+ uint32_t data_crc32;
// |stream_size| is only used in the EOF record for stream 0.
- uint32 stream_size;
+ uint32_t stream_size;
};
struct SimpleFileSparseRangeHeader {
SimpleFileSparseRangeHeader();
- uint64 sparse_range_magic_number;
- int64 offset;
- int64 length;
- uint32 data_crc32;
+ uint64_t sparse_range_magic_number;
+ int64_t offset;
+ int64_t length;
+ uint32_t data_crc32;
};
} // namespace disk_cache
diff --git a/net/disk_cache/simple/simple_entry_format_history.h b/net/disk_cache/simple/simple_entry_format_history.h
index 89d378b6..3bcb8b4 100644
--- a/net/disk_cache/simple/simple_entry_format_history.h
+++ b/net/disk_cache/simple/simple_entry_format_history.h
@@ -7,15 +7,14 @@
#include <stdint.h>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
namespace disk_cache {
namespace simplecache_v5 {
-const uint64 kSimpleInitialMagicNumber = UINT64_C(0xfcfb6d1ba7725c30);
-const uint64 kSimpleFinalMagicNumber = UINT64_C(0xf4fa6f45970d41d8);
+const uint64_t kSimpleInitialMagicNumber = UINT64_C(0xfcfb6d1ba7725c30);
+const uint64_t kSimpleFinalMagicNumber = UINT64_C(0xf4fa6f45970d41d8);
// A file containing stream 0 and stream 1 in the Simple cache consists of:
// - a SimpleFileHeader.
@@ -36,10 +35,10 @@
struct NET_EXPORT_PRIVATE SimpleFileHeader {
SimpleFileHeader();
- uint64 initial_magic_number;
- uint32 version;
- uint32 key_length;
- uint32 key_hash;
+ uint64_t initial_magic_number;
+ uint32_t version;
+ uint32_t key_length;
+ uint32_t key_hash;
};
struct NET_EXPORT_PRIVATE SimpleFileEOF {
@@ -49,11 +48,11 @@
SimpleFileEOF();
- uint64 final_magic_number;
- uint32 flags;
- uint32 data_crc32;
+ uint64_t final_magic_number;
+ uint32_t flags;
+ uint32_t data_crc32;
// |stream_size| is only used in the EOF record for stream 0.
- uint32 stream_size;
+ uint32_t stream_size;
};
} // namespace simplecache_v5
diff --git a/net/disk_cache/simple/simple_entry_operation.cc b/net/disk_cache/simple/simple_entry_operation.cc
index 7dfe0d2..c17762c 100644
--- a/net/disk_cache/simple/simple_entry_operation.cc
+++ b/net/disk_cache/simple/simple_entry_operation.cc
@@ -168,7 +168,7 @@
// static
SimpleEntryOperation SimpleEntryOperation::ReadSparseOperation(
SimpleEntryImpl* entry,
- int64 sparse_offset,
+ int64_t sparse_offset,
int length,
net::IOBuffer* buf,
const CompletionCallback& callback) {
@@ -191,7 +191,7 @@
// static
SimpleEntryOperation SimpleEntryOperation::WriteSparseOperation(
SimpleEntryImpl* entry,
- int64 sparse_offset,
+ int64_t sparse_offset,
int length,
net::IOBuffer* buf,
const CompletionCallback& callback) {
@@ -214,9 +214,9 @@
// static
SimpleEntryOperation SimpleEntryOperation::GetAvailableRangeOperation(
SimpleEntryImpl* entry,
- int64 sparse_offset,
+ int64_t sparse_offset,
int length,
- int64* out_start,
+ int64_t* out_start,
const CompletionCallback& callback) {
return SimpleEntryOperation(entry,
NULL,
@@ -241,9 +241,9 @@
net::IOBuffer* const buf = NULL;
Entry** const out_entry = NULL;
const int offset = 0;
- const int64 sparse_offset = 0;
+ const int64_t sparse_offset = 0;
const int length = 0;
- int64* const out_start = NULL;
+ int64_t* const out_start = NULL;
const bool have_index = false;
const int index = 0;
const bool truncate = false;
@@ -287,8 +287,8 @@
// and offsets to see whether they overlap.
if (IsSparseType(type_)) {
- int64 end = sparse_offset_ + length_;
- int64 other_op_end = other_op.sparse_offset() + other_op.length();
+ int64_t end = sparse_offset_ + length_;
+ int64_t other_op_end = other_op.sparse_offset() + other_op.length();
return sparse_offset_ < other_op_end && other_op.sparse_offset() < end;
}
@@ -312,9 +312,9 @@
const CompletionCallback& callback,
Entry** out_entry,
int offset,
- int64 sparse_offset,
+ int64_t sparse_offset,
int length,
- int64* out_start,
+ int64_t* out_start,
EntryOperationType type,
bool have_index,
int index,
@@ -334,7 +334,6 @@
index_(index),
truncate_(truncate),
optimistic_(optimistic),
- alone_in_queue_(alone_in_queue) {
-}
+ alone_in_queue_(alone_in_queue) {}
} // namespace disk_cache
diff --git a/net/disk_cache/simple/simple_entry_operation.h b/net/disk_cache/simple/simple_entry_operation.h
index b2f5502a..a9b3a0fb 100644
--- a/net/disk_cache/simple/simple_entry_operation.h
+++ b/net/disk_cache/simple/simple_entry_operation.h
@@ -5,6 +5,8 @@
#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_OPERATION_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_OPERATION_H_
+#include <stdint.h>
+
#include "base/memory/ref_counted.h"
#include "net/base/completion_callback.h"
#include "net/log/net_log.h"
@@ -68,21 +70,21 @@
const CompletionCallback& callback);
static SimpleEntryOperation ReadSparseOperation(
SimpleEntryImpl* entry,
- int64 sparse_offset,
+ int64_t sparse_offset,
int length,
net::IOBuffer* buf,
const CompletionCallback& callback);
static SimpleEntryOperation WriteSparseOperation(
SimpleEntryImpl* entry,
- int64 sparse_offset,
+ int64_t sparse_offset,
int length,
net::IOBuffer* buf,
const CompletionCallback& callback);
static SimpleEntryOperation GetAvailableRangeOperation(
SimpleEntryImpl* entry,
- int64 sparse_offset,
+ int64_t sparse_offset,
int length,
- int64* out_start,
+ int64_t* out_start,
const CompletionCallback& callback);
static SimpleEntryOperation DoomOperation(
SimpleEntryImpl* entry,
@@ -101,9 +103,9 @@
bool have_index() const { return have_index_; }
int index() const { return index_; }
int offset() const { return offset_; }
- int64 sparse_offset() const { return sparse_offset_; }
+ int64_t sparse_offset() const { return sparse_offset_; }
int length() const { return length_; }
- int64* out_start() { return out_start_; }
+ int64_t* out_start() { return out_start_; }
net::IOBuffer* buf() { return buf_.get(); }
bool truncate() const { return truncate_; }
bool optimistic() const { return optimistic_; }
@@ -115,9 +117,9 @@
const CompletionCallback& callback,
Entry** out_entry,
int offset,
- int64 sparse_offset,
+ int64_t sparse_offset,
int length,
- int64* out_start,
+ int64_t* out_start,
EntryOperationType type,
bool have_index,
int index,
@@ -135,11 +137,11 @@
// Used in write and read operations.
const int offset_;
- const int64 sparse_offset_;
+ const int64_t sparse_offset_;
const int length_;
// Used in get available range operations.
- int64* const out_start_;
+ int64_t* const out_start_;
const EntryOperationType type_;
// Used in open and create operations.
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc
index 555780119d..0051cd0 100644
--- a/net/disk_cache/simple/simple_index.cc
+++ b/net/disk_cache/simple/simple_index.cc
@@ -45,9 +45,9 @@
// Divides the cache space into this amount of parts to evict when only one part
// is left.
-const uint32 kEvictionMarginDivisor = 20;
+const uint32_t kEvictionMarginDivisor = 20;
-const uint32 kBytesInKb = 1024;
+const uint32_t kBytesInKb = 1024;
// Utility class used for timestamp comparisons in entry metadata while sorting.
class CompareHashesForTimestamp {
@@ -56,7 +56,8 @@
public:
explicit CompareHashesForTimestamp(const EntrySet& set);
- bool operator()(uint64 hash1, uint64 hash2);
+ bool operator()(uint64_t hash1, uint64_t hash2);
+
private:
const EntrySet& entry_set_;
};
@@ -65,7 +66,7 @@
: entry_set_(set) {
}
-bool CompareHashesForTimestamp::operator()(uint64 hash1, uint64 hash2) {
+bool CompareHashesForTimestamp::operator()(uint64_t hash1, uint64_t hash2) {
EntrySet::const_iterator it1 = entry_set_.find(hash1);
DCHECK(it1 != entry_set_.end());
EntrySet::const_iterator it2 = entry_set_.find(hash2);
@@ -82,9 +83,9 @@
entry_size_(0) {
}
-EntryMetadata::EntryMetadata(base::Time last_used_time, uint64 entry_size)
+EntryMetadata::EntryMetadata(base::Time last_used_time, uint64_t entry_size)
: last_used_time_seconds_since_epoch_(0),
- entry_size_(base::checked_cast<int32>(entry_size)) {
+ entry_size_(base::checked_cast<int32_t>(entry_size)) {
SetLastUsedTime(last_used_time);
}
@@ -104,37 +105,38 @@
return;
}
- last_used_time_seconds_since_epoch_ = base::checked_cast<uint32>(
+ last_used_time_seconds_since_epoch_ = base::checked_cast<uint32_t>(
(last_used_time - base::Time::UnixEpoch()).InSeconds());
// Avoid accidental nullity.
if (last_used_time_seconds_since_epoch_ == 0)
last_used_time_seconds_since_epoch_ = 1;
}
-uint64 EntryMetadata::GetEntrySize() const {
+uint64_t EntryMetadata::GetEntrySize() const {
return entry_size_;
}
-void EntryMetadata::SetEntrySize(uint64 entry_size) {
- entry_size_ = base::checked_cast<int32>(entry_size);
+void EntryMetadata::SetEntrySize(uint64_t entry_size) {
+ entry_size_ = base::checked_cast<int32_t>(entry_size);
}
void EntryMetadata::Serialize(base::Pickle* pickle) const {
DCHECK(pickle);
- int64 internal_last_used_time = GetLastUsedTime().ToInternalValue();
+ int64_t internal_last_used_time = GetLastUsedTime().ToInternalValue();
pickle->WriteInt64(internal_last_used_time);
pickle->WriteUInt64(entry_size_);
}
bool EntryMetadata::Deserialize(base::PickleIterator* it) {
DCHECK(it);
- int64 tmp_last_used_time;
- uint64 tmp_entry_size;
+ int64_t tmp_last_used_time;
+ uint64_t tmp_entry_size;
if (!it->ReadInt64(&tmp_last_used_time) || !it->ReadUInt64(&tmp_entry_size) ||
- tmp_entry_size > static_cast<uint64>(std::numeric_limits<int32>::max()))
+ tmp_entry_size >
+ static_cast<uint64_t>(std::numeric_limits<int32_t>::max()))
return false;
SetLastUsedTime(base::Time::FromInternalValue(tmp_last_used_time));
- entry_size_ = static_cast<int32>(tmp_entry_size);
+ entry_size_ = static_cast<int32_t>(tmp_entry_size);
return true;
}
@@ -188,7 +190,7 @@
index_file_->LoadIndexEntries(cache_mtime, reply, load_result);
}
-void SimpleIndex::SetMaxSize(uint64 max_bytes) {
+void SimpleIndex::SetMaxSize(uint64_t max_bytes) {
// Zero size means use the default.
if (max_bytes) {
max_size_ = max_bytes;
@@ -234,17 +236,17 @@
return GetEntriesBetween(base::Time(), base::Time());
}
-int32 SimpleIndex::GetEntryCount() const {
+int32_t SimpleIndex::GetEntryCount() const {
// TODO(pasko): return a meaningful initial estimate before initialized.
return entries_set_.size();
}
-uint64 SimpleIndex::GetCacheSize() const {
+uint64_t SimpleIndex::GetCacheSize() const {
DCHECK(initialized_);
return cache_size_;
}
-void SimpleIndex::Insert(uint64 entry_hash) {
+void SimpleIndex::Insert(uint64_t entry_hash) {
DCHECK(io_thread_checker_.CalledOnValidThread());
// Upon insert we don't know yet the size of the entry.
// It will be updated later when the SimpleEntryImpl finishes opening or
@@ -256,7 +258,7 @@
PostponeWritingToDisk();
}
-void SimpleIndex::Remove(uint64 entry_hash) {
+void SimpleIndex::Remove(uint64_t entry_hash) {
DCHECK(io_thread_checker_.CalledOnValidThread());
EntrySet::iterator it = entries_set_.find(entry_hash);
if (it != entries_set_.end()) {
@@ -269,13 +271,13 @@
PostponeWritingToDisk();
}
-bool SimpleIndex::Has(uint64 hash) const {
+bool SimpleIndex::Has(uint64_t hash) const {
DCHECK(io_thread_checker_.CalledOnValidThread());
// If not initialized, always return true, forcing it to go to the disk.
return !initialized_ || entries_set_.count(hash) > 0;
}
-bool SimpleIndex::UseIfExists(uint64 entry_hash) {
+bool SimpleIndex::UseIfExists(uint64_t entry_hash) {
DCHECK(io_thread_checker_.CalledOnValidThread());
// Always update the last used time, even if it is during initialization.
// It will be merged later.
@@ -301,7 +303,7 @@
SIMPLE_CACHE_UMA(
MEMORY_KB, "Eviction.MaxCacheSizeOnStart2", cache_type_,
static_cast<base::HistogramBase::Sample>(max_size_ / kBytesInKb));
- std::vector<uint64> entry_hashes;
+ std::vector<uint64_t> entry_hashes;
entry_hashes.reserve(entries_set_.size());
for (EntrySet::const_iterator it = entries_set_.begin(),
end = entries_set_.end(); it != end; ++it) {
@@ -311,8 +313,8 @@
CompareHashesForTimestamp(entries_set_));
// Remove as many entries from the index to get below |low_watermark_|.
- std::vector<uint64>::iterator it = entry_hashes.begin();
- uint64 evicted_so_far_size = 0;
+ std::vector<uint64_t>::iterator it = entry_hashes.begin();
+ uint64_t evicted_so_far_size = 0;
while (evicted_so_far_size < cache_size_ - low_watermark_) {
DCHECK(it != entry_hashes.end());
EntrySet::iterator found_meta = entries_set_.find(*it);
@@ -337,7 +339,7 @@
AsWeakPtr()));
}
-bool SimpleIndex::UpdateEntrySize(uint64 entry_hash, int64 entry_size) {
+bool SimpleIndex::UpdateEntrySize(uint64_t entry_hash, int64_t entry_size) {
DCHECK(io_thread_checker_.CalledOnValidThread());
EntrySet::iterator it = entries_set_.find(entry_hash);
if (it == entries_set_.end())
@@ -365,7 +367,7 @@
// static
void SimpleIndex::InsertInEntrySet(
- uint64 entry_hash,
+ uint64_t entry_hash,
const disk_cache::EntryMetadata& entry_metadata,
EntrySet* entry_set) {
DCHECK(entry_set);
@@ -383,7 +385,7 @@
}
void SimpleIndex::UpdateEntryIteratorSize(EntrySet::iterator* it,
- int64 entry_size) {
+ int64_t entry_size) {
// Update the total cache size with the new entry size.
DCHECK(io_thread_checker_.CalledOnValidThread());
DCHECK_GE(cache_size_, (*it)->second.GetEntrySize());
@@ -399,7 +401,7 @@
EntrySet* index_file_entries = &load_result->entries;
- for (base::hash_set<uint64>::const_iterator it = removed_entries_.begin();
+ for (base::hash_set<uint64_t>::const_iterator it = removed_entries_.begin();
it != removed_entries_.end(); ++it) {
index_file_entries->erase(*it);
}
@@ -407,7 +409,7 @@
for (EntrySet::const_iterator it = entries_set_.begin();
it != entries_set_.end(); ++it) {
- const uint64 entry_hash = it->first;
+ const uint64_t entry_hash = it->first;
std::pair<EntrySet::iterator, bool> insert_result =
index_file_entries->insert(EntrySet::value_type(entry_hash,
EntryMetadata()));
@@ -415,7 +417,7 @@
possibly_inserted_entry->second = it->second;
}
- uint64 merged_cache_size = 0;
+ uint64_t merged_cache_size = 0;
for (EntrySet::iterator it = index_file_entries->begin();
it != index_file_entries->end(); ++it) {
merged_cache_size += it->second.GetEntrySize();
diff --git a/net/disk_cache/simple/simple_index.h b/net/disk_cache/simple/simple_index.h
index 5a8046d..0946e5b 100644
--- a/net/disk_cache/simple/simple_index.h
+++ b/net/disk_cache/simple/simple_index.h
@@ -5,10 +5,11 @@
#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
+#include <stdint.h>
+
#include <list>
#include <vector>
-#include "base/basictypes.h"
#include "base/callback.h"
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
@@ -42,13 +43,13 @@
class NET_EXPORT_PRIVATE EntryMetadata {
public:
EntryMetadata();
- EntryMetadata(base::Time last_used_time, uint64 entry_size);
+ EntryMetadata(base::Time last_used_time, uint64_t entry_size);
base::Time GetLastUsedTime() const;
void SetLastUsedTime(const base::Time& last_used_time);
- uint64 GetEntrySize() const;
- void SetEntrySize(uint64 entry_size);
+ uint64_t GetEntrySize() const;
+ void SetEntrySize(uint64_t entry_size);
// Serialize the data into the provided pickle.
void Serialize(base::Pickle* pickle) const;
@@ -68,8 +69,8 @@
// size of each entry matters. Even when the values used to set these members
// are originally calculated as >32-bit types, the actual necessary size for
// each shouldn't exceed 32 bits, so we use 32-bit types here.
- uint32 last_used_time_seconds_since_epoch_;
- int32 entry_size_; // Storage size in bytes.
+ uint32_t last_used_time_seconds_since_epoch_;
+ int32_t entry_size_; // Storage size in bytes.
};
static_assert(sizeof(EntryMetadata) == 8, "incorrect metadata size");
@@ -77,7 +78,7 @@
class NET_EXPORT_PRIVATE SimpleIndex
: public base::SupportsWeakPtr<SimpleIndex> {
public:
- typedef std::vector<uint64> HashList;
+ typedef std::vector<uint64_t> HashList;
SimpleIndex(const scoped_refptr<base::SingleThreadTaskRunner>& io_thread,
SimpleIndexDelegate* delegate,
@@ -88,29 +89,29 @@
void Initialize(base::Time cache_mtime);
- void SetMaxSize(uint64 max_bytes);
- uint64 max_size() const { return max_size_; }
+ void SetMaxSize(uint64_t max_bytes);
+ uint64_t max_size() const { return max_size_; }
- void Insert(uint64 entry_hash);
- void Remove(uint64 entry_hash);
+ void Insert(uint64_t entry_hash);
+ void Remove(uint64_t entry_hash);
// Check whether the index has the entry given the hash of its key.
- bool Has(uint64 entry_hash) const;
+ bool Has(uint64_t entry_hash) const;
// Update the last used time of the entry with the given key and return true
// iff the entry exist in the index.
- bool UseIfExists(uint64 entry_hash);
+ bool UseIfExists(uint64_t entry_hash);
void WriteToDisk();
// Update the size (in bytes) of an entry, in the metadata stored in the
// index. This should be the total disk-file size including all streams of the
// entry.
- bool UpdateEntrySize(uint64 entry_hash, int64 entry_size);
+ bool UpdateEntrySize(uint64_t entry_hash, int64_t entry_size);
- typedef base::hash_map<uint64, EntryMetadata> EntrySet;
+ typedef base::hash_map<uint64_t, EntryMetadata> EntrySet;
- static void InsertInEntrySet(uint64 entry_hash,
+ static void InsertInEntrySet(uint64_t entry_hash,
const EntryMetadata& entry_metadata,
EntrySet* entry_set);
@@ -128,11 +129,11 @@
scoped_ptr<HashList> GetAllHashes();
// Returns number of indexed entries.
- int32 GetEntryCount() const;
+ int32_t GetEntryCount() const;
// Returns the size of the entire cache in bytes. Can only be called after the
// index has been initialized.
- uint64 GetCacheSize() const;
+ uint64_t GetCacheSize() const;
// Returns whether the index has been initialized yet.
bool initialized() const { return initialized_; }
@@ -149,7 +150,7 @@
void PostponeWritingToDisk();
- void UpdateEntryIteratorSize(EntrySet::iterator* it, int64 entry_size);
+ void UpdateEntryIteratorSize(EntrySet::iterator* it, int64_t entry_size);
// Must run on IO Thread.
void MergeInitializingSet(scoped_ptr<SimpleIndexLoadResult> load_result);
@@ -166,16 +167,16 @@
EntrySet entries_set_;
const net::CacheType cache_type_;
- uint64 cache_size_; // Total cache storage size in bytes.
- uint64 max_size_;
- uint64 high_watermark_;
- uint64 low_watermark_;
+ uint64_t cache_size_; // Total cache storage size in bytes.
+ uint64_t max_size_;
+ uint64_t high_watermark_;
+ uint64_t low_watermark_;
bool eviction_in_progress_;
base::TimeTicks eviction_start_time_;
// This stores all the entry_hash of entries that are removed during
// initialization.
- base::hash_set<uint64> removed_entries_;
+ base::hash_set<uint64_t> removed_entries_;
bool initialized_;
scoped_ptr<SimpleIndexFile> index_file_;
diff --git a/net/disk_cache/simple/simple_index_delegate.h b/net/disk_cache/simple/simple_index_delegate.h
index e942484..c21e5c5 100644
--- a/net/disk_cache/simple/simple_index_delegate.h
+++ b/net/disk_cache/simple/simple_index_delegate.h
@@ -5,6 +5,8 @@
#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_DELEGATE_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_DELEGATE_H_
+#include <stdint.h>
+
#include <vector>
#include "net/base/completion_callback.h"
@@ -19,7 +21,7 @@
// Dooms all entries in |entries|, calling |callback| with the result
// asynchronously. |entries| is mutated in an undefined way by this call,
// for efficiency.
- virtual void DoomEntries(std::vector<uint64>* entry_hashes,
+ virtual void DoomEntries(std::vector<uint64_t>* entry_hashes,
const net::CompletionCallback& callback) = 0;
};
diff --git a/net/disk_cache/simple/simple_index_file.cc b/net/disk_cache/simple/simple_index_file.cc
index 3828649..f392883 100644
--- a/net/disk_cache/simple/simple_index_file.cc
+++ b/net/disk_cache/simple/simple_index_file.cc
@@ -32,9 +32,9 @@
const int kEntryFilesHashLength = 16;
const int kEntryFilesSuffixLength = 2;
-const uint64 kMaxEntiresInIndex = 100000000;
+const uint64_t kMaxEntiresInIndex = 100000000;
-uint32 CalculatePickleCRC(const base::Pickle& pickle) {
+uint32_t CalculatePickleCRC(const base::Pickle& pickle) {
return crc32(crc32(0, Z_NULL, 0),
reinterpret_cast<const Bytef*>(pickle.payload()),
pickle.payload_size());
@@ -98,7 +98,7 @@
return;
const base::StringPiece hash_string(
file_name.begin(), file_name.begin() + kEntryFilesHashLength);
- uint64 hash_key = 0;
+ uint64_t hash_key = 0;
if (!simple_util::GetEntryHashKeyFromHexString(hash_string, &hash_key)) {
LOG(WARNING) << "Invalid entry hash key filename while restoring index from"
<< " disk: " << file_name;
@@ -119,7 +119,7 @@
if (last_used_time.is_null())
last_used_time = file_info.last_modified;
- int64 file_size = file_info.size;
+ int64_t file_size = file_info.size;
SimpleIndex::EntrySet::iterator it = entries->find(hash_key);
if (it == entries->end()) {
SimpleIndex::InsertInEntrySet(
@@ -160,8 +160,8 @@
number_of_entries_(0),
cache_size_(0) {}
-SimpleIndexFile::IndexMetadata::IndexMetadata(
- uint64 number_of_entries, uint64 cache_size)
+SimpleIndexFile::IndexMetadata::IndexMetadata(uint64_t number_of_entries,
+ uint64_t cache_size)
: magic_number_(kSimpleIndexMagicNumber),
version_(kSimpleVersion),
number_of_entries_(number_of_entries),
@@ -277,7 +277,7 @@
}
void SimpleIndexFile::WriteToDisk(const SimpleIndex::EntrySet& entry_set,
- uint64 cache_size,
+ uint64_t cache_size,
const base::TimeTicks& start,
bool app_on_background,
const base::Closure& callback) {
@@ -403,8 +403,8 @@
base::PickleIterator pickle_it(pickle);
SimpleIndexFile::PickleHeader* header_p =
pickle.headerT<SimpleIndexFile::PickleHeader>();
- const uint32 crc_read = header_p->crc;
- const uint32 crc_calculated = CalculatePickleCRC(pickle);
+ const uint32_t crc_read = header_p->crc;
+ const uint32_t crc_calculated = CalculatePickleCRC(pickle);
if (crc_read != crc_calculated) {
LOG(WARNING) << "Invalid CRC in Simple Index file.";
@@ -427,7 +427,7 @@
entries->resize(index_metadata.GetNumberOfEntries() + kExtraSizeForMerge);
#endif
while (entries->size() < index_metadata.GetNumberOfEntries()) {
- uint64 hash_key;
+ uint64_t hash_key;
EntryMetadata entry_metadata;
if (!pickle_it.ReadUInt64(&hash_key) ||
!entry_metadata.Deserialize(&pickle_it)) {
@@ -438,7 +438,7 @@
SimpleIndex::InsertInEntrySet(hash_key, entry_metadata, entries);
}
- int64 cache_last_modified;
+ int64_t cache_last_modified;
if (!pickle_it.ReadInt64(&cache_last_modified)) {
entries->clear();
return;
diff --git a/net/disk_cache/simple/simple_index_file.h b/net/disk_cache/simple/simple_index_file.h
index b0ca1f5..eb133011 100644
--- a/net/disk_cache/simple/simple_index_file.h
+++ b/net/disk_cache/simple/simple_index_file.h
@@ -6,14 +6,15 @@
#define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_
#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/pickle.h"
#include "net/base/cache_type.h"
@@ -27,7 +28,7 @@
namespace disk_cache {
-const uint64 kSimpleIndexMagicNumber = UINT64_C(0x656e74657220796f);
+const uint64_t kSimpleIndexMagicNumber = UINT64_C(0x656e74657220796f);
struct NET_EXPORT_PRIVATE SimpleIndexLoadResult {
SimpleIndexLoadResult();
@@ -55,23 +56,23 @@
class NET_EXPORT_PRIVATE IndexMetadata {
public:
IndexMetadata();
- IndexMetadata(uint64 number_of_entries, uint64 cache_size);
+ IndexMetadata(uint64_t number_of_entries, uint64_t cache_size);
void Serialize(base::Pickle* pickle) const;
bool Deserialize(base::PickleIterator* it);
bool CheckIndexMetadata();
- uint64 GetNumberOfEntries() { return number_of_entries_; }
+ uint64_t GetNumberOfEntries() { return number_of_entries_; }
private:
FRIEND_TEST_ALL_PREFIXES(IndexMetadataTest, Basics);
FRIEND_TEST_ALL_PREFIXES(IndexMetadataTest, Serialize);
- uint64 magic_number_;
- uint32 version_;
- uint64 number_of_entries_;
- uint64 cache_size_; // Total cache storage size in bytes.
+ uint64_t magic_number_;
+ uint32_t version_;
+ uint64_t number_of_entries_;
+ uint64_t cache_size_; // Total cache storage size in bytes.
};
SimpleIndexFile(
@@ -88,7 +89,7 @@
// Write the specified set of entries to disk.
virtual void WriteToDisk(const SimpleIndex::EntrySet& entry_set,
- uint64 cache_size,
+ uint64_t cache_size,
const base::TimeTicks& start,
bool app_on_background,
const base::Closure& callback);
@@ -169,7 +170,7 @@
const base::FilePath& index_file_path);
struct PickleHeader : public base::Pickle::Header {
- uint32 crc;
+ uint32_t crc;
};
const scoped_refptr<base::SingleThreadTaskRunner> cache_thread_;
diff --git a/net/disk_cache/simple/simple_index_file_unittest.cc b/net/disk_cache/simple/simple_index_file_unittest.cc
index a2603d8..3f1bca5 100644
--- a/net/disk_cache/simple/simple_index_file_unittest.cc
+++ b/net/disk_cache/simple/simple_index_file_unittest.cc
@@ -108,14 +108,14 @@
TEST_F(SimpleIndexFileTest, Serialize) {
SimpleIndex::EntrySet entries;
- static const uint64 kHashes[] = { 11, 22, 33 };
+ static const uint64_t kHashes[] = {11, 22, 33};
static const size_t kNumHashes = arraysize(kHashes);
EntryMetadata metadata_entries[kNumHashes];
- SimpleIndexFile::IndexMetadata index_metadata(static_cast<uint64>(kNumHashes),
- 456);
+ SimpleIndexFile::IndexMetadata index_metadata(
+ static_cast<uint64_t>(kNumHashes), 456);
for (size_t i = 0; i < kNumHashes; ++i) {
- uint64 hash = kHashes[i];
+ uint64_t hash = kHashes[i];
metadata_entries[i] = EntryMetadata(Time(), hash);
SimpleIndex::InsertInEntrySet(hash, metadata_entries[i], &entries);
}
@@ -181,16 +181,16 @@
ASSERT_TRUE(cache_dir.CreateUniqueTempDir());
SimpleIndex::EntrySet entries;
- static const uint64 kHashes[] = { 11, 22, 33 };
+ static const uint64_t kHashes[] = {11, 22, 33};
static const size_t kNumHashes = arraysize(kHashes);
EntryMetadata metadata_entries[kNumHashes];
for (size_t i = 0; i < kNumHashes; ++i) {
- uint64 hash = kHashes[i];
+ uint64_t hash = kHashes[i];
metadata_entries[i] = EntryMetadata(Time(), hash);
SimpleIndex::InsertInEntrySet(hash, metadata_entries[i], &entries);
}
- const uint64 kCacheSize = 456U;
+ const uint64_t kCacheSize = 456U;
net::TestClosure closure;
{
WrappedSimpleIndexFile simple_index_file(cache_dir.path());
diff --git a/net/disk_cache/simple/simple_index_unittest.cc b/net/disk_cache/simple/simple_index_unittest.cc
index 281d402..ee0ddbe 100644
--- a/net/disk_cache/simple/simple_index_unittest.cc
+++ b/net/disk_cache/simple/simple_index_unittest.cc
@@ -28,7 +28,7 @@
const base::Time kTestLastUsedTime =
base::Time::UnixEpoch() + base::TimeDelta::FromDays(20);
-const uint64 kTestEntrySize = 789;
+const uint64_t kTestEntrySize = 789;
} // namespace
@@ -66,7 +66,7 @@
}
void WriteToDisk(const SimpleIndex::EntrySet& entry_set,
- uint64 cache_size,
+ uint64_t cache_size,
const base::TimeTicks& start,
bool app_on_background,
const base::Closure& callback) override {
@@ -97,7 +97,7 @@
: hashes_(base::Bind(&HashesInitializer)),
doom_entries_calls_(0) {}
- static uint64 HashesInitializer(size_t hash_index) {
+ static uint64_t HashesInitializer(size_t hash_index) {
return disk_cache::simple_util::GetEntryHashKey(
base::StringPrintf("key%d", static_cast<int>(hash_index)));
}
@@ -120,16 +120,16 @@
}
// From SimpleIndexDelegate:
- void DoomEntries(std::vector<uint64>* entry_hashes,
+ void DoomEntries(std::vector<uint64_t>* entry_hashes,
const net::CompletionCallback& callback) override {
- for (const uint64& entry_hash : *entry_hashes)
+ for (const uint64_t& entry_hash : *entry_hashes)
index_->Remove(entry_hash);
last_doom_entry_hashes_ = *entry_hashes;
++doom_entries_calls_;
}
// Redirect to allow single "friend" declaration in base class.
- bool GetEntryForTesting(uint64 key, EntryMetadata* metadata) {
+ bool GetEntryForTesting(uint64_t key, EntryMetadata* metadata) {
SimpleIndex::EntrySet::iterator it = index_->entries_set_.find(key);
if (index_->entries_set_.end() == it)
return false;
@@ -137,7 +137,7 @@
return true;
}
- void InsertIntoIndexFileReturn(uint64 hash_key,
+ void InsertIntoIndexFileReturn(uint64_t hash_key,
base::Time last_used_time,
int entry_size) {
index_file_->load_result()->entries.insert(std::make_pair(
@@ -153,17 +153,16 @@
SimpleIndex* index() { return index_.get(); }
const MockSimpleIndexFile* index_file() const { return index_file_.get(); }
- const std::vector<uint64>& last_doom_entry_hashes() const {
+ const std::vector<uint64_t>& last_doom_entry_hashes() const {
return last_doom_entry_hashes_;
}
int doom_entries_calls() const { return doom_entries_calls_; }
-
- const simple_util::ImmutableArray<uint64, 16> hashes_;
+ const simple_util::ImmutableArray<uint64_t, 16> hashes_;
scoped_ptr<SimpleIndex> index_;
base::WeakPtr<MockSimpleIndexFile> index_file_;
- std::vector<uint64> last_doom_entry_hashes_;
+ std::vector<uint64_t> last_doom_entry_hashes_;
int doom_entries_calls_;
};
@@ -214,10 +213,10 @@
{
scoped_ptr<SimpleIndexLoadResult> result(new SimpleIndexLoadResult());
result->did_load = true;
- const uint64 new_hash_key = hashes_.at<11>();
+ const uint64_t new_hash_key = hashes_.at<11>();
result->entries.insert(
std::make_pair(new_hash_key, EntryMetadata(base::Time::Now(), 11)));
- const uint64 redundant_hash_key = hashes_.at<4>();
+ const uint64_t redundant_hash_key = hashes_.at<4>();
result->entries.insert(std::make_pair(redundant_hash_key,
EntryMetadata(base::Time::Now(), 4)));
index()->MergeInitializingSet(result.Pass());
@@ -254,7 +253,7 @@
EXPECT_EQ(1, index_file_->load_index_entries_calls());
// Confirm "Has()" always returns true before the callback is called.
- const uint64 kHash1 = hashes_.at<1>();
+ const uint64_t kHash1 = hashes_.at<1>();
EXPECT_TRUE(index()->Has(kHash1));
index()->Insert(kHash1);
EXPECT_TRUE(index()->Has(kHash1));
@@ -278,7 +277,7 @@
// Confirm "UseIfExists()" always returns true before the callback is called
// and updates mod time if the entry was really there.
- const uint64 kHash1 = hashes_.at<1>();
+ const uint64_t kHash1 = hashes_.at<1>();
EntryMetadata metadata1, metadata2;
EXPECT_TRUE(index()->UseIfExists(kHash1));
EXPECT_FALSE(GetEntryForTesting(kHash1, &metadata1));
@@ -317,7 +316,7 @@
index()->SetMaxSize(1000);
- const uint64 kHash1 = hashes_.at<1>();
+ const uint64_t kHash1 = hashes_.at<1>();
InsertIntoIndexFileReturn(kHash1, now - base::TimeDelta::FromDays(2), 475);
ReturnIndexFile();
@@ -395,7 +394,7 @@
// Remove something that's going to come in from the loaded index.
TEST_F(SimpleIndexTest, RemoveBeforeInit) {
- const uint64 kHash1 = hashes_.at<1>();
+ const uint64_t kHash1 = hashes_.at<1>();
index()->Remove(kHash1);
InsertIntoIndexFileReturn(kHash1,
@@ -409,7 +408,7 @@
// Insert something that's going to come in from the loaded index; correct
// result?
TEST_F(SimpleIndexTest, InsertBeforeInit) {
- const uint64 kHash1 = hashes_.at<1>();
+ const uint64_t kHash1 = hashes_.at<1>();
index()->Insert(kHash1);
InsertIntoIndexFileReturn(kHash1,
@@ -427,7 +426,7 @@
// Insert and Remove something that's going to come in from the loaded index.
TEST_F(SimpleIndexTest, InsertRemoveBeforeInit) {
- const uint64 kHash1 = hashes_.at<1>();
+ const uint64_t kHash1 = hashes_.at<1>();
index()->Insert(kHash1);
index()->Remove(kHash1);
@@ -441,7 +440,7 @@
// Insert and Remove something that's going to come in from the loaded index.
TEST_F(SimpleIndexTest, RemoveInsertBeforeInit) {
- const uint64 kHash1 = hashes_.at<1>();
+ const uint64_t kHash1 = hashes_.at<1>();
index()->Remove(kHash1);
index()->Insert(kHash1);
@@ -555,7 +554,7 @@
EXPECT_FALSE(index()->write_to_disk_timer_.IsRunning());
- const uint64 kHash1 = hashes_.at<1>();
+ const uint64_t kHash1 = hashes_.at<1>();
index()->Insert(kHash1);
EXPECT_TRUE(index()->write_to_disk_timer_.IsRunning());
index()->write_to_disk_timer_.Stop();
@@ -580,7 +579,7 @@
EXPECT_FALSE(index()->write_to_disk_timer_.IsRunning());
- const uint64 kHash1 = hashes_.at<1>();
+ const uint64_t kHash1 = hashes_.at<1>();
index()->Insert(kHash1);
index()->UpdateEntrySize(kHash1, 20);
EXPECT_TRUE(index()->write_to_disk_timer_.IsRunning());
@@ -593,7 +592,7 @@
SimpleIndex::EntrySet entry_set;
index_file_->GetAndResetDiskWriteEntrySet(&entry_set);
- uint64 hash_key = kHash1;
+ uint64_t hash_key = kHash1;
base::Time now(base::Time::Now());
ASSERT_EQ(1u, entry_set.size());
EXPECT_EQ(hash_key, entry_set.begin()->first);
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
index bf3a3abd..3fdb3cc 100644
--- a/net/disk_cache/simple/simple_synchronous_entry.cc
+++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -9,7 +9,6 @@
#include <functional>
#include <limits>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
#include "base/hash.h"
diff --git a/net/disk_cache/simple/simple_test_util.h b/net/disk_cache/simple/simple_test_util.h
index ec9b644..95ab055 100644
--- a/net/disk_cache/simple/simple_test_util.h
+++ b/net/disk_cache/simple/simple_test_util.h
@@ -5,9 +5,10 @@
#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_TEST_UTIL_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_TEST_UTIL_H_
+#include <stddef.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/callback.h"
namespace base {
diff --git a/net/disk_cache/simple/simple_util.cc b/net/disk_cache/simple/simple_util.cc
index d0e1ce5f..a81c28f 100644
--- a/net/disk_cache/simple/simple_util.cc
+++ b/net/disk_cache/simple/simple_util.cc
@@ -19,8 +19,8 @@
namespace {
-// Size of the uint64 hash_key number in Hex format in a string.
-const size_t kEntryHashKeyAsHexStringSize = 2 * sizeof(uint64);
+// Size of the uint64_t hash_key number in Hex format in a string.
+const size_t kEntryHashKeyAsHexStringSize = 2 * sizeof(uint64_t);
#if defined(OS_POSIX)
// TODO(clamy, gavinp): this should go in base
@@ -51,7 +51,7 @@
namespace simple_util {
-std::string ConvertEntryHashKeyToHexString(uint64 hash_key) {
+std::string ConvertEntryHashKeyToHexString(uint64_t hash_key) {
const std::string hash_key_str = base::StringPrintf("%016" PRIx64, hash_key);
DCHECK_EQ(kEntryHashKeyAsHexStringSize, hash_key_str.size());
return hash_key_str;
@@ -65,29 +65,29 @@
}
bool GetEntryHashKeyFromHexString(const base::StringPiece& hash_key,
- uint64* hash_key_out) {
+ uint64_t* hash_key_out) {
if (hash_key.size() != kEntryHashKeyAsHexStringSize) {
return false;
}
return base::HexStringToUInt64(hash_key, hash_key_out);
}
-uint64 GetEntryHashKey(const std::string& key) {
+uint64_t GetEntryHashKey(const std::string& key) {
union {
unsigned char sha_hash[base::kSHA1Length];
- uint64 key_hash;
+ uint64_t key_hash;
} u;
base::SHA1HashBytes(reinterpret_cast<const unsigned char*>(key.data()),
key.size(), u.sha_hash);
return u.key_hash;
}
-std::string GetFilenameFromEntryHashAndFileIndex(uint64 entry_hash,
+std::string GetFilenameFromEntryHashAndFileIndex(uint64_t entry_hash,
int file_index) {
return base::StringPrintf("%016" PRIx64 "_%1d", entry_hash, file_index);
}
-std::string GetSparseFilenameFromEntryHash(uint64 entry_hash) {
+std::string GetSparseFilenameFromEntryHash(uint64_t entry_hash) {
return base::StringPrintf("%016" PRIx64 "_s", entry_hash);
}
@@ -97,13 +97,15 @@
base::StringPrintf("_%1d", file_index);
}
-int32 GetDataSizeFromKeyAndFileSize(const std::string& key, int64 file_size) {
- int64 data_size = file_size - key.size() - sizeof(SimpleFileHeader) -
- sizeof(SimpleFileEOF);
- return base::checked_cast<int32>(data_size);
+int32_t GetDataSizeFromKeyAndFileSize(const std::string& key,
+ int64_t file_size) {
+ int64_t data_size =
+ file_size - key.size() - sizeof(SimpleFileHeader) - sizeof(SimpleFileEOF);
+ return base::checked_cast<int32_t>(data_size);
}
-int64 GetFileSizeFromKeyAndDataSize(const std::string& key, int32 data_size) {
+int64_t GetFileSizeFromKeyAndDataSize(const std::string& key,
+ int32_t data_size) {
return data_size + key.size() + sizeof(SimpleFileHeader) +
sizeof(SimpleFileEOF);
}
@@ -123,7 +125,7 @@
time_t sec;
long nsec;
if (GetNanoSecsFromStat(file_stat, &sec, &nsec)) {
- int64 usec = (nsec / base::Time::kNanosecondsPerMicrosecond);
+ int64_t usec = (nsec / base::Time::kNanosecondsPerMicrosecond);
*out_mtime = base::Time::FromTimeT(sec)
+ base::TimeDelta::FromMicroseconds(usec);
return true;
diff --git a/net/disk_cache/simple/simple_util.h b/net/disk_cache/simple/simple_util.h
index 24bfa0b..faf36b6 100644
--- a/net/disk_cache/simple/simple_util.h
+++ b/net/disk_cache/simple/simple_util.h
@@ -5,9 +5,10 @@
#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_UTIL_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_UTIL_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -20,22 +21,23 @@
namespace simple_util {
-NET_EXPORT_PRIVATE std::string ConvertEntryHashKeyToHexString(uint64 hash_key);
+NET_EXPORT_PRIVATE std::string ConvertEntryHashKeyToHexString(
+ uint64_t hash_key);
// |key| is the regular cache key, such as an URL.
-// Returns the Hex ascii representation of the uint64 hash_key.
+// Returns the Hex ascii representation of the uint64_t hash_key.
NET_EXPORT_PRIVATE std::string GetEntryHashKeyAsHexString(
const std::string& key);
// |key| is the regular HTTP Cache key, which is a URL.
-// Returns the hash of the key as uint64.
-NET_EXPORT_PRIVATE uint64 GetEntryHashKey(const std::string& key);
+// Returns the hash of the key as uint64_t.
+NET_EXPORT_PRIVATE uint64_t GetEntryHashKey(const std::string& key);
-// Parses the |hash_key| string into a uint64 buffer.
+// Parses the |hash_key| string into a uint64_t buffer.
// |hash_key| string must be of the form: FFFFFFFFFFFFFFFF .
NET_EXPORT_PRIVATE bool GetEntryHashKeyFromHexString(
const base::StringPiece& hash_key,
- uint64* hash_key_out);
+ uint64_t* hash_key_out);
// Given a |key| for a (potential) entry in the simple backend and the |index|
// of a stream on that entry, returns the filename in which that stream would be
@@ -45,21 +47,21 @@
int file_index);
// Same as |GetFilenameFromKeyAndIndex| above, but using a hex string.
-std::string GetFilenameFromEntryHashAndFileIndex(uint64 entry_hash,
+std::string GetFilenameFromEntryHashAndFileIndex(uint64_t entry_hash,
int file_index);
// Given a |key| for an entry, returns the name of the sparse data file.
-std::string GetSparseFilenameFromEntryHash(uint64 entry_hash);
+std::string GetSparseFilenameFromEntryHash(uint64_t entry_hash);
// Given the size of a file holding a stream in the simple backend and the key
// to an entry, returns the number of bytes in the stream.
-NET_EXPORT_PRIVATE int32 GetDataSizeFromKeyAndFileSize(const std::string& key,
- int64 file_size);
+NET_EXPORT_PRIVATE int32_t GetDataSizeFromKeyAndFileSize(const std::string& key,
+ int64_t file_size);
// Given the size of a stream in the simple backend and the key to an entry,
// returns the number of bytes in the file.
-NET_EXPORT_PRIVATE int64 GetFileSizeFromKeyAndDataSize(const std::string& key,
- int32 data_size);
+NET_EXPORT_PRIVATE int64_t GetFileSizeFromKeyAndDataSize(const std::string& key,
+ int32_t data_size);
// Given the stream index, returns the number of the file the stream is stored
// in.
diff --git a/net/disk_cache/simple/simple_util_unittest.cc b/net/disk_cache/simple/simple_util_unittest.cc
index fbda55c..2956f27f 100644
--- a/net/disk_cache/simple/simple_util_unittest.cc
+++ b/net/disk_cache/simple/simple_util_unittest.cc
@@ -47,7 +47,7 @@
}
TEST_F(SimpleUtilTest, GetEntryHashKeyFromHexString) {
- uint64 hash_key = 0;
+ uint64_t hash_key = 0;
EXPECT_TRUE(GetEntryHashKeyFromHexString("0000000005f5e0ff", &hash_key));
EXPECT_EQ(UINT64_C(99999999), hash_key);
diff --git a/net/disk_cache/simple/simple_version_upgrade.cc b/net/disk_cache/simple/simple_version_upgrade.cc
index c20a1ba..91d1b9c 100644
--- a/net/disk_cache/simple/simple_version_upgrade.cc
+++ b/net/disk_cache/simple/simple_version_upgrade.cc
@@ -20,7 +20,7 @@
// It is not possible to upgrade cache structures on disk that are of version
// below this, the entire cache should be dropped for them.
-const uint32 kMinVersionAbleToUpgrade = 5;
+const uint32_t kMinVersionAbleToUpgrade = 5;
const char kFakeIndexFileName[] = "index";
const char kIndexFileName[] = "the-real-index";
@@ -155,7 +155,7 @@
}
fake_index_file.Close();
- uint32 version_from = file_header.version;
+ uint32_t version_from = file_header.version;
if (version_from < kMinVersionAbleToUpgrade ||
version_from > kSimpleVersion) {
LOG(ERROR) << "Inconsistent cache version.";
diff --git a/net/disk_cache/simple/simple_version_upgrade.h b/net/disk_cache/simple/simple_version_upgrade.h
index 352379b9..f8fa119 100644
--- a/net/disk_cache/simple/simple_version_upgrade.h
+++ b/net/disk_cache/simple/simple_version_upgrade.h
@@ -9,7 +9,8 @@
// Backend on disk. Assumes no backend operations are running simultaneously.
// Hence must be run at cache initialization step.
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "net/base/net_export.h"
namespace base {
@@ -33,13 +34,13 @@
FakeIndexData();
// Must be equal to simplecache_v4::kSimpleInitialMagicNumber.
- uint64 initial_magic_number;
+ uint64_t initial_magic_number;
// Must be equal kSimpleVersion when the cache backend is instantiated.
- uint32 version;
+ uint32_t version;
- uint32 unused_must_be_zero1;
- uint32 unused_must_be_zero2;
+ uint32_t unused_must_be_zero1;
+ uint32_t unused_must_be_zero2;
};
// Exposed for testing.
diff --git a/net/disk_cache/simple/simple_version_upgrade_unittest.cc b/net/disk_cache/simple/simple_version_upgrade_unittest.cc
index 0a8d8c9a7..4aef6f1b 100644
--- a/net/disk_cache/simple/simple_version_upgrade_unittest.cc
+++ b/net/disk_cache/simple/simple_version_upgrade_unittest.cc
@@ -6,7 +6,6 @@
#include <stdint.h>
-#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
@@ -24,7 +23,7 @@
namespace {
// Same as |disk_cache::kSimpleInitialMagicNumber|.
-const uint64 kSimpleInitialMagicNumber = UINT64_C(0xfcfb6d1ba7725c30);
+const uint64_t kSimpleInitialMagicNumber = UINT64_C(0xfcfb6d1ba7725c30);
// The "fake index" file that cache backends use to distinguish whether the
// cache belongs to one backend or another.
@@ -102,14 +101,14 @@
base::WriteFile(index_file, file_contents.data(), file_contents.size()));
// Create a few entry-like files.
- const uint64 kEntries = 5;
- for (uint64 entry_hash = 0; entry_hash < kEntries; ++entry_hash) {
+ const uint64_t kEntries = 5;
+ for (uint64_t entry_hash = 0; entry_hash < kEntries; ++entry_hash) {
for (int index = 0; index < 3; ++index) {
std::string file_name =
base::StringPrintf("%016" PRIx64 "_%1d", entry_hash, index);
std::string entry_contents =
file_contents +
- base::StringPrintf(" %" PRIx64, static_cast<uint64>(entry_hash));
+ base::StringPrintf(" %" PRIx64, static_cast<uint64_t>(entry_hash));
ASSERT_EQ(static_cast<int>(entry_contents.size()),
base::WriteFile(cache_path.AppendASCII(file_name),
entry_contents.data(), entry_contents.size()));
@@ -121,13 +120,13 @@
// Check that the old index disappeared but the files remain unchanged.
EXPECT_FALSE(base::PathExists(index_file));
- for (uint64 entry_hash = 0; entry_hash < kEntries; ++entry_hash) {
+ for (uint64_t entry_hash = 0; entry_hash < kEntries; ++entry_hash) {
for (int index = 0; index < 3; ++index) {
std::string file_name =
base::StringPrintf("%016" PRIx64 "_%1d", entry_hash, index);
std::string expected_contents =
file_contents +
- base::StringPrintf(" %" PRIx64, static_cast<uint64>(entry_hash));
+ base::StringPrintf(" %" PRIx64, static_cast<uint64_t>(entry_hash));
std::string real_contents;
EXPECT_TRUE(base::ReadFileToString(cache_path.AppendASCII(file_name),
&real_contents));
diff --git a/net/dns/address_sorter.h b/net/dns/address_sorter.h
index 6ac9430..31115a6 100644
--- a/net/dns/address_sorter.h
+++ b/net/dns/address_sorter.h
@@ -5,8 +5,8 @@
#ifndef NET_DNS_ADDRESS_SORTER_H_
#define NET_DNS_ADDRESS_SORTER_H_
-#include "base/basictypes.h"
#include "base/callback.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/dns/address_sorter_posix.h b/net/dns/address_sorter_posix.h
index d23f0497..06d2dd8 100644
--- a/net/dns/address_sorter_posix.h
+++ b/net/dns/address_sorter_posix.h
@@ -8,6 +8,7 @@
#include <map>
#include <vector>
+#include "base/macros.h"
#include "base/threading/non_thread_safe.h"
#include "net/base/address_list.h"
#include "net/base/ip_address_number.h"
diff --git a/net/dns/address_sorter_posix_unittest.cc b/net/dns/address_sorter_posix_unittest.cc
index 9d7916d..e71bb21 100644
--- a/net/dns/address_sorter_posix_unittest.cc
+++ b/net/dns/address_sorter_posix_unittest.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "net/base/test_completion_callback.h"
@@ -43,8 +44,8 @@
NOTIMPLEMENTED();
return OK;
}
- int SetReceiveBufferSize(int32) override { return OK; }
- int SetSendBufferSize(int32) override { return OK; }
+ int SetReceiveBufferSize(int32_t) override { return OK; }
+ int SetSendBufferSize(int32_t) override { return OK; }
void Close() override {}
int GetPeerAddress(IPEndPoint* address) const override {
diff --git a/net/dns/address_sorter_win.cc b/net/dns/address_sorter_win.cc
index f469dae..816b42d 100644
--- a/net/dns/address_sorter_win.cc
+++ b/net/dns/address_sorter_win.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/threading/worker_pool.h"
#include "base/win/windows_version.h"
#include "net/base/address_list.h"
diff --git a/net/dns/dns_config_service.h b/net/dns/dns_config_service.h
index 10d93ac1..d552da41 100644
--- a/net/dns/dns_config_service.h
+++ b/net/dns/dns_config_service.h
@@ -9,6 +9,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/threading/non_thread_safe.h"
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
index c189951..31a4061 100644
--- a/net/dns/dns_config_service_posix.cc
+++ b/net/dns/dns_config_service_posix.cc
@@ -6,13 +6,13 @@
#include <string>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_path_watcher.h"
#include "base/lazy_instance.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
diff --git a/net/dns/dns_config_service_posix.h b/net/dns/dns_config_service_posix.h
index b9f5fb75..18cb5a0 100644
--- a/net/dns/dns_config_service_posix.h
+++ b/net/dns/dns_config_service_posix.h
@@ -13,6 +13,7 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/base/network_change_notifier.h"
#include "net/dns/dns_config_service.h"
diff --git a/net/dns/dns_config_service_unittest.cc b/net/dns/dns_config_service_unittest.cc
index 028024d..40796ad 100644
--- a/net/dns/dns_config_service_unittest.cc
+++ b/net/dns/dns_config_service_unittest.cc
@@ -4,7 +4,6 @@
#include "net/dns/dns_config_service.h"
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/cancelable_callback.h"
#include "base/location.h"
diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc
index 443ee27..8c3192d 100644
--- a/net/dns/dns_config_service_win.cc
+++ b/net/dns/dns_config_service_win.cc
@@ -13,6 +13,7 @@
#include "base/files/file_path.h"
#include "base/files/file_path_watcher.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_split.h"
@@ -333,7 +334,7 @@
bool IsStatelessDiscoveryAddress(const IPAddressNumber& address) {
if (address.size() != kIPv6AddressSize)
return false;
- const uint8 kPrefix[] = {
+ const uint8_t kPrefix[] = {
0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
diff --git a/net/dns/dns_config_service_win.h b/net/dns/dns_config_service_win.h
index 5b6f22b..96d4713 100644
--- a/net/dns/dns_config_service_win.h
+++ b/net/dns/dns_config_service_win.h
@@ -13,6 +13,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
diff --git a/net/dns/dns_config_service_win_unittest.cc b/net/dns/dns_config_service_win_unittest.cc
index dc521ece..3a452bc 100644
--- a/net/dns/dns_config_service_win_unittest.cc
+++ b/net/dns/dns_config_service_win_unittest.cc
@@ -4,7 +4,6 @@
#include "net/dns/dns_config_service_win.h"
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/win/windows_version.h"
#include "net/dns/dns_protocol.h"
@@ -52,7 +51,7 @@
IF_OPER_STATUS oper_status;
const WCHAR* dns_suffix;
std::string dns_server_addresses[4]; // Empty string indicates end.
- uint16 ports[4];
+ uint16_t ports[4];
};
scoped_ptr<IP_ADAPTER_ADDRESSES, base::FreeDeleter> CreateAdapterAddresses(
@@ -117,7 +116,7 @@
AdapterInfo input_adapters[4]; // |if_type| == 0 indicates end.
std::string expected_nameservers[4]; // Empty string indicates end.
std::string expected_suffix;
- uint16 expected_ports[4];
+ uint16_t expected_ports[4];
} cases[] = {
{ // Ignore loopback and inactive adapters.
{
@@ -176,7 +175,7 @@
for (size_t j = 0; !t.expected_nameservers[j].empty(); ++j) {
IPAddressNumber ip;
ASSERT_TRUE(ParseIPLiteralToNumber(t.expected_nameservers[j], &ip));
- uint16 port = t.expected_ports[j];
+ uint16_t port = t.expected_ports[j];
if (!port)
port = dns_protocol::kDefaultPort;
expected_nameservers.push_back(IPEndPoint(ip, port));
diff --git a/net/dns/dns_hosts.cc b/net/dns/dns_hosts.cc
index 9e641b6..a4f293f6 100644
--- a/net/dns/dns_hosts.cc
+++ b/net/dns/dns_hosts.cc
@@ -6,6 +6,7 @@
#include "base/files/file_util.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
@@ -190,7 +191,7 @@
if (!base::PathExists(path))
return true;
- int64 size;
+ int64_t size;
if (!base::GetFileSize(path, &size))
return false;
@@ -198,7 +199,7 @@
static_cast<base::HistogramBase::Sample>(size));
// Reject HOSTS files larger than |kMaxHostsSize| bytes.
- const int64 kMaxHostsSize = 1 << 25; // 32MB
+ const int64_t kMaxHostsSize = 1 << 25; // 32MB
if (size > kMaxHostsSize)
return false;
diff --git a/net/dns/dns_hosts.h b/net/dns/dns_hosts.h
index c35857e1..d8ece2c 100644
--- a/net/dns/dns_hosts.h
+++ b/net/dns/dns_hosts.h
@@ -5,12 +5,13 @@
#ifndef NET_DNS_DNS_HOSTS_H_
#define NET_DNS_DNS_HOSTS_H_
+#include <stddef.h>
+
#include <map>
#include <string>
#include <utility>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
#include "net/base/address_family.h"
diff --git a/net/dns/dns_protocol.h b/net/dns/dns_protocol.h
index f3f9292..3b421ae 100644
--- a/net/dns/dns_protocol.h
+++ b/net/dns/dns_protocol.h
@@ -5,15 +5,16 @@
#ifndef NET_DNS_DNS_PROTOCOL_H_
#define NET_DNS_DNS_PROTOCOL_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "net/base/net_export.h"
namespace net {
namespace dns_protocol {
-static const uint16 kDefaultPort = 53;
-static const uint16 kDefaultPortMulticast = 5353;
+static const uint16_t kDefaultPort = 53;
+static const uint16_t kDefaultPortMulticast = 5353;
// DNS packet consists of a header followed by questions and/or answers.
// For the meaning of specific fields, please see RFC 1035 and 2535
@@ -73,28 +74,28 @@
#pragma pack(push)
#pragma pack(1)
-// On-the-wire header. All uint16 are in network order.
+// On-the-wire header. All uint16_t are in network order.
// Used internally in DnsQuery and DnsResponse.
struct NET_EXPORT_PRIVATE Header {
- uint16 id;
- uint16 flags;
- uint16 qdcount;
- uint16 ancount;
- uint16 nscount;
- uint16 arcount;
+ uint16_t id;
+ uint16_t flags;
+ uint16_t qdcount;
+ uint16_t ancount;
+ uint16_t nscount;
+ uint16_t arcount;
};
#pragma pack(pop)
-static const uint8 kLabelMask = 0xc0;
-static const uint8 kLabelPointer = 0xc0;
-static const uint8 kLabelDirect = 0x0;
-static const uint16 kOffsetMask = 0x3fff;
+static const uint8_t kLabelMask = 0xc0;
+static const uint8_t kLabelPointer = 0xc0;
+static const uint8_t kLabelDirect = 0x0;
+static const uint16_t kOffsetMask = 0x3fff;
// In MDns the most significant bit of the rrclass is designated as the
// "cache-flush bit", as described in http://www.rfc-editor.org/rfc/rfc6762.txt
// section 10.2.
-static const uint16 kMDnsClassMask = 0x7FFF;
+static const uint16_t kMDnsClassMask = 0x7FFF;
static const int kMaxNameLength = 255;
@@ -107,34 +108,33 @@
static const int kMaxMulticastSize = 9000;
// DNS class types.
-static const uint16 kClassIN = 1;
+static const uint16_t kClassIN = 1;
// DNS resource record types. See
// http://www.iana.org/assignments/dns-parameters
-static const uint16 kTypeA = 1;
-static const uint16 kTypeCNAME = 5;
-static const uint16 kTypePTR = 12;
-static const uint16 kTypeTXT = 16;
-static const uint16 kTypeAAAA = 28;
-static const uint16 kTypeSRV = 33;
-static const uint16 kTypeNSEC = 47;
-
+static const uint16_t kTypeA = 1;
+static const uint16_t kTypeCNAME = 5;
+static const uint16_t kTypePTR = 12;
+static const uint16_t kTypeTXT = 16;
+static const uint16_t kTypeAAAA = 28;
+static const uint16_t kTypeSRV = 33;
+static const uint16_t kTypeNSEC = 47;
// DNS rcode values.
-static const uint8 kRcodeMask = 0xf;
-static const uint8 kRcodeNOERROR = 0;
-static const uint8 kRcodeFORMERR = 1;
-static const uint8 kRcodeSERVFAIL = 2;
-static const uint8 kRcodeNXDOMAIN = 3;
-static const uint8 kRcodeNOTIMP = 4;
-static const uint8 kRcodeREFUSED = 5;
+static const uint8_t kRcodeMask = 0xf;
+static const uint8_t kRcodeNOERROR = 0;
+static const uint8_t kRcodeFORMERR = 1;
+static const uint8_t kRcodeSERVFAIL = 2;
+static const uint8_t kRcodeNXDOMAIN = 3;
+static const uint8_t kRcodeNOTIMP = 4;
+static const uint8_t kRcodeREFUSED = 5;
// DNS flags.
-static const uint16 kFlagResponse = 0x8000;
-static const uint16 kFlagRA = 0x80;
-static const uint16 kFlagRD = 0x100;
-static const uint16 kFlagTC = 0x200;
-static const uint16 kFlagAA = 0x400;
+static const uint16_t kFlagResponse = 0x8000;
+static const uint16_t kFlagRA = 0x80;
+static const uint16_t kFlagRD = 0x100;
+static const uint16_t kFlagTC = 0x200;
+static const uint16_t kFlagAA = 0x400;
} // namespace dns_protocol
diff --git a/net/dns/dns_query.cc b/net/dns/dns_query.cc
index 5154b54..0966def 100644
--- a/net/dns/dns_query.cc
+++ b/net/dns/dns_query.cc
@@ -18,11 +18,11 @@
// For details, see RFC 1035 section 4.1.1. This header template sets RD
// bit, which directs the name server to pursue query recursively, and sets
// the QDCOUNT to 1, meaning the question section has a single entry.
-DnsQuery::DnsQuery(uint16 id, const base::StringPiece& qname, uint16 qtype)
+DnsQuery::DnsQuery(uint16_t id, const base::StringPiece& qname, uint16_t qtype)
: qname_size_(qname.size()) {
DCHECK(!DNSDomainToString(qname).empty());
// QNAME + QTYPE + QCLASS
- size_t question_size = qname_size_ + sizeof(uint16) + sizeof(uint16);
+ size_t question_size = qname_size_ + sizeof(uint16_t) + sizeof(uint16_t);
io_buffer_ = new IOBufferWithSize(sizeof(dns_protocol::Header) +
question_size);
dns_protocol::Header* header =
@@ -43,11 +43,11 @@
DnsQuery::~DnsQuery() {
}
-scoped_ptr<DnsQuery> DnsQuery::CloneWithNewId(uint16 id) const {
+scoped_ptr<DnsQuery> DnsQuery::CloneWithNewId(uint16_t id) const {
return make_scoped_ptr(new DnsQuery(*this, id));
}
-uint16 DnsQuery::id() const {
+uint16_t DnsQuery::id() const {
const dns_protocol::Header* header =
reinterpret_cast<const dns_protocol::Header*>(io_buffer_->data());
return base::NetToHost16(header->id);
@@ -58,19 +58,19 @@
qname_size_);
}
-uint16 DnsQuery::qtype() const {
- uint16 type;
- base::ReadBigEndian<uint16>(
+uint16_t DnsQuery::qtype() const {
+ uint16_t type;
+ base::ReadBigEndian<uint16_t>(
io_buffer_->data() + sizeof(dns_protocol::Header) + qname_size_, &type);
return type;
}
base::StringPiece DnsQuery::question() const {
return base::StringPiece(io_buffer_->data() + sizeof(dns_protocol::Header),
- qname_size_ + sizeof(uint16) + sizeof(uint16));
+ qname_size_ + sizeof(uint16_t) + sizeof(uint16_t));
}
-DnsQuery::DnsQuery(const DnsQuery& orig, uint16 id) {
+DnsQuery::DnsQuery(const DnsQuery& orig, uint16_t id) {
qname_size_ = orig.qname_size_;
io_buffer_ = new IOBufferWithSize(orig.io_buffer()->size());
memcpy(io_buffer_.get()->data(), orig.io_buffer()->data(),
@@ -80,7 +80,7 @@
header->id = base::HostToNet16(id);
}
-void DnsQuery::set_flags(uint16 flags) {
+void DnsQuery::set_flags(uint16_t flags) {
dns_protocol::Header* header =
reinterpret_cast<dns_protocol::Header*>(io_buffer_->data());
header->flags = flags;
diff --git a/net/dns/dns_query.h b/net/dns/dns_query.h
index c3104c3..14c5b5b 100644
--- a/net/dns/dns_query.h
+++ b/net/dns/dns_query.h
@@ -5,7 +5,10 @@
#ifndef NET_DNS_DNS_QUERY_H_
#define NET_DNS_DNS_QUERY_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+#include <stdint.h>
+
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
@@ -21,16 +24,16 @@
public:
// Constructs a query message from |qname| which *MUST* be in a valid
// DNS name format, and |qtype|. The qclass is set to IN.
- DnsQuery(uint16 id, const base::StringPiece& qname, uint16 qtype);
+ DnsQuery(uint16_t id, const base::StringPiece& qname, uint16_t qtype);
~DnsQuery();
// Clones |this| verbatim, with ID field of the header set to |id|.
- scoped_ptr<DnsQuery> CloneWithNewId(uint16 id) const;
+ scoped_ptr<DnsQuery> CloneWithNewId(uint16_t id) const;
// DnsQuery field accessors.
- uint16 id() const;
+ uint16_t id() const;
base::StringPiece qname() const;
- uint16 qtype() const;
+ uint16_t qtype() const;
// Returns the Question section of the query. Used when matching the
// response.
@@ -39,10 +42,10 @@
// IOBuffer accessor to be used for writing out the query.
IOBufferWithSize* io_buffer() const { return io_buffer_.get(); }
- void set_flags(uint16 flags);
+ void set_flags(uint16_t flags);
private:
- DnsQuery(const DnsQuery& orig, uint16 id);
+ DnsQuery(const DnsQuery& orig, uint16_t id);
// Size of the DNS name (*NOT* hostname) we are trying to resolve; used
// to calculate offsets.
diff --git a/net/dns/dns_query_unittest.cc b/net/dns/dns_query_unittest.cc
index bd8bf3ab..2a4648e2 100644
--- a/net/dns/dns_query_unittest.cc
+++ b/net/dns/dns_query_unittest.cc
@@ -15,24 +15,19 @@
TEST(DnsQueryTest, Constructor) {
// This includes \0 at the end.
const char qname_data[] = "\x03""www""\x07""example""\x03""com";
- const uint8 query_data[] = {
- // Header
- 0xbe, 0xef,
- 0x01, 0x00, // Flags -- set RD (recursion desired) bit.
- 0x00, 0x01, // Set QDCOUNT (question count) to 1, all the
- // rest are 0 for a query.
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00,
+ const uint8_t query_data[] = {
+ // Header
+ 0xbe, 0xef, 0x01, 0x00, // Flags -- set RD (recursion desired) bit.
+ 0x00, 0x01, // Set QDCOUNT (question count) to 1, all the
+ // rest are 0 for a query.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Question
- 0x03, 'w', 'w', 'w', // QNAME: www.example.com in DNS format.
- 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e',
- 0x03, 'c', 'o', 'm',
- 0x00,
+ // Question
+ 0x03, 'w', 'w', 'w', // QNAME: www.example.com in DNS format.
+ 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00,
- 0x00, 0x01, // QTYPE: A query.
- 0x00, 0x01, // QCLASS: IN class.
+ 0x00, 0x01, // QTYPE: A query.
+ 0x00, 0x01, // QCLASS: IN class.
};
base::StringPiece qname(qname_data, sizeof(qname_data));
diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
index 8298c78..74534e6b 100644
--- a/net/dns/dns_reloader.cc
+++ b/net/dns/dns_reloader.cc
@@ -9,9 +9,9 @@
#include <resolv.h>
-#include "base/basictypes.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_local_storage.h"
diff --git a/net/dns/dns_response.h b/net/dns/dns_response.h
index 24071ca..4d5e6b7 100644
--- a/net/dns/dns_response.h
+++ b/net/dns/dns_response.h
@@ -5,6 +5,7 @@
#ifndef NET_DNS_DNS_RESPONSE_H_
#define NET_DNS_DNS_RESPONSE_H_
+#include <stddef.h>
#include <stdint.h>
#include <string>
diff --git a/net/dns/dns_response_unittest.cc b/net/dns/dns_response_unittest.cc
index 9cb98cea..e701c9a 100644
--- a/net/dns/dns_response_unittest.cc
+++ b/net/dns/dns_response_unittest.cc
@@ -29,17 +29,15 @@
}
TEST(DnsRecordParserTest, ReadName) {
- const uint8 data[] = {
+ const uint8_t data[] = {
// all labels "foo.example.com"
- 0x03, 'f', 'o', 'o',
- 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e',
- 0x03, 'c', 'o', 'm',
+ 0x03, 'f', 'o', 'o', 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c',
+ 'o', 'm',
// byte 0x10
0x00,
// byte 0x11
// part label, part pointer, "bar.example.com"
- 0x03, 'b', 'a', 'r',
- 0xc0, 0x04,
+ 0x03, 'b', 'a', 'r', 0xc0, 0x04,
// byte 0x17
// all pointer to "bar.example.com", 2 jumps
0xc0, 0x11,
@@ -75,15 +73,13 @@
}
TEST(DnsRecordParserTest, ReadNameFail) {
- const uint8 data[] = {
+ const uint8_t data[] = {
// label length beyond packet
- 0x30, 'x', 'x',
- 0x00,
+ 0x30, 'x', 'x', 0x00,
// pointer offset beyond packet
0xc0, 0x20,
// pointer loop
- 0xc0, 0x08,
- 0xc0, 0x06,
+ 0xc0, 0x08, 0xc0, 0x06,
// incorrect label type (currently supports only direct and pointer)
0x80, 0x00,
// truncated name (missing root label)
@@ -103,12 +99,10 @@
}
TEST(DnsRecordParserTest, ReadRecord) {
- const uint8 data[] = {
+ const uint8_t data[] = {
// Type CNAME record.
- 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e',
- 0x03, 'c', 'o', 'm',
- 0x00,
- 0x00, 0x05, // TYPE is CNAME.
+ 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00,
+ 0x05, // TYPE is CNAME.
0x00, 0x01, // CLASS is IN.
0x00, 0x01, 0x24, 0x74, // TTL is 0x00012474.
0x00, 0x06, // RDLENGTH is 6 bytes.
@@ -116,8 +110,7 @@
0xc0, 0x00,
// Type A record.
0x03, 'b', 'a', 'r', // compressed owner name
- 0xc0, 0x00,
- 0x00, 0x01, // TYPE is A.
+ 0xc0, 0x00, 0x00, 0x01, // TYPE is A.
0x00, 0x01, // CLASS is IN.
0x00, 0x20, 0x13, 0x55, // TTL is 0x00201355.
0x00, 0x04, // RDLENGTH is 4 bytes.
@@ -161,47 +154,40 @@
// Compilers want to copy when binding temporary to const &, so must use heap.
scoped_ptr<DnsQuery> query(new DnsQuery(0xcafe, qname, dns_protocol::kTypeA));
- const uint8 response_data[] = {
- // Header
- 0xca, 0xfe, // ID
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x01, // 1 question
- 0x00, 0x02, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
+ const uint8_t response_data[] = {
+ // Header
+ 0xca, 0xfe, // ID
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x01, // 1 question
+ 0x00, 0x02, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
- // Question
- // This part is echoed back from the respective query.
- 0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w',
- 0x08, 'c', 'h', 'r', 'o', 'm', 'i', 'u', 'm',
- 0x03, 'o', 'r', 'g',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
+ // Question
+ // This part is echoed back from the respective query.
+ 0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w', 0x08, 'c', 'h',
+ 'r', 'o', 'm', 'i', 'u', 'm', 0x03, 'o', 'r', 'g', 0x00, 0x00,
+ 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
- // Answer 1
- 0xc0, 0x0c, // NAME is a pointer to name in Question section.
- 0x00, 0x05, // TYPE is CNAME.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x12, // RDLENGTH is 18 bytes.
- // ghs.l.google.com in DNS format.
- 0x03, 'g', 'h', 's',
- 0x01, 'l',
- 0x06, 'g', 'o', 'o', 'g', 'l', 'e',
- 0x03, 'c', 'o', 'm',
- 0x00,
+ // Answer 1
+ 0xc0, 0x0c, // NAME is a pointer to name in Question section.
+ 0x00, 0x05, // TYPE is CNAME.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x12, // RDLENGTH is 18 bytes.
+ // ghs.l.google.com in DNS format.
+ 0x03, 'g', 'h', 's', 0x01, 'l', 0x06, 'g', 'o', 'o', 'g', 'l', 'e', 0x03,
+ 'c', 'o', 'm', 0x00,
- // Answer 2
- 0xc0, 0x35, // NAME is a pointer to name in Answer 1.
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x00, // TTL (4 bytes) is 53 seconds.
- 0x00, 0x35,
- 0x00, 0x04, // RDLENGTH is 4 bytes.
- 0x4a, 0x7d, // RDATA is the IP: 74.125.95.121
- 0x5f, 0x79,
+ // Answer 2
+ 0xc0, 0x35, // NAME is a pointer to name in Answer 1.
+ 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x00, // TTL (4 bytes) is 53 seconds.
+ 0x00, 0x35, 0x00, 0x04, // RDLENGTH is 4 bytes.
+ 0x4a, 0x7d, // RDATA is the IP: 74.125.95.121
+ 0x5f, 0x79,
};
DnsResponse resp;
@@ -274,27 +260,24 @@
}
TEST(DnsResponseTest, InitParseWithoutQueryNoQuestions) {
- const uint8 response_data[] = {
- // Header
- 0xca, 0xfe, // ID
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No question
- 0x00, 0x01, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
+ const uint8_t response_data[] = {
+ // Header
+ 0xca, 0xfe, // ID
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No question
+ 0x00, 0x01, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
- // Answer 1
- 0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w',
- 0x08, 'c', 'h', 'r', 'o', 'm', 'i', 'u', 'm',
- 0x03, 'o', 'r', 'g',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x00, // TTL (4 bytes) is 53 seconds.
- 0x00, 0x35,
- 0x00, 0x04, // RDLENGTH is 4 bytes.
- 0x4a, 0x7d, // RDATA is the IP: 74.125.95.121
- 0x5f, 0x79,
+ // Answer 1
+ 0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w', 0x08, 'c', 'h',
+ 'r', 'o', 'm', 'i', 'u', 'm', 0x03, 'o', 'r', 'g', 0x00, 0x00,
+ 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x00, // TTL (4 bytes) is 53 seconds.
+ 0x00, 0x35, 0x00, 0x04, // RDLENGTH is 4 bytes.
+ 0x4a, 0x7d, // RDATA is the IP: 74.125.95.121
+ 0x5f, 0x79,
};
DnsResponse resp;
@@ -321,38 +304,35 @@
}
TEST(DnsResponseTest, InitParseWithoutQueryTwoQuestions) {
- const uint8 response_data[] = {
- // Header
- 0xca, 0xfe, // ID
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x02, // 2 questions
- 0x00, 0x01, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
+ const uint8_t response_data[] = {
+ // Header
+ 0xca, 0xfe, // ID
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x02, // 2 questions
+ 0x00, 0x01, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
- // Question 1
- 0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w',
- 0x08, 'c', 'h', 'r', 'o', 'm', 'i', 'u', 'm',
- 0x03, 'o', 'r', 'g',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
+ // Question 1
+ 0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w', 0x08, 'c', 'h',
+ 'r', 'o', 'm', 'i', 'u', 'm', 0x03, 'o', 'r', 'g', 0x00, 0x00,
+ 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
- // Question 2
- 0x0b, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w', '2',
- 0xc0, 0x18, // pointer to "chromium.org"
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
+ // Question 2
+ 0x0b, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w', '2', 0xc0,
+ 0x18, // pointer to "chromium.org"
+ 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
- // Answer 1
- 0xc0, 0x0c, // NAME is a pointer to name in Question section.
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x00, // TTL (4 bytes) is 53 seconds.
- 0x00, 0x35,
- 0x00, 0x04, // RDLENGTH is 4 bytes.
- 0x4a, 0x7d, // RDATA is the IP: 74.125.95.121
- 0x5f, 0x79,
+ // Answer 1
+ 0xc0, 0x0c, // NAME is a pointer to name in Question section.
+ 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x00, // TTL (4 bytes) is 53 seconds.
+ 0x00, 0x35, 0x00, 0x04, // RDLENGTH is 4 bytes.
+ 0x4a, 0x7d, // RDATA is the IP: 74.125.95.121
+ 0x5f, 0x79,
};
DnsResponse resp;
@@ -379,11 +359,11 @@
}
TEST(DnsResponseTest, InitParseWithoutQueryPacketTooShort) {
- const uint8 response_data[] = {
- // Header
- 0xca, 0xfe, // ID
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No question
+ const uint8_t response_data[] = {
+ // Header
+ 0xca, 0xfe, // ID
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No question
};
DnsResponse resp;
@@ -404,7 +384,7 @@
TEST(DnsResponseTest, ParseToAddressList) {
const struct TestCase {
size_t query_size;
- const uint8* response_data;
+ const uint8_t* response_data;
size_t response_size;
const char* const* expected_addresses;
size_t num_expected_addresses;
@@ -457,92 +437,92 @@
}
}
-const uint8 kResponseTruncatedRecord[] = {
- // Header: 1 question, 1 answer RR
- 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- // Question: name = 'a', type = A (0x1)
- 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
- // Answer: name = 'a', type = A, TTL = 0xFF, RDATA = 10.10.10.10
- 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x04, 0x0A, 0x0A, 0x0A, // Truncated RDATA.
+const uint8_t kResponseTruncatedRecord[] = {
+ // Header: 1 question, 1 answer RR
+ 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ // Question: name = 'a', type = A (0x1)
+ 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
+ // Answer: name = 'a', type = A, TTL = 0xFF, RDATA = 10.10.10.10
+ 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x04,
+ 0x0A, 0x0A, 0x0A, // Truncated RDATA.
};
-const uint8 kResponseTruncatedCNAME[] = {
- // Header: 1 question, 1 answer RR
- 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- // Question: name = 'a', type = A (0x1)
- 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
- // Answer: name = 'a', type = CNAME, TTL = 0xFF, RDATA = 'foo' (truncated)
- 0x01, 'a', 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x03, 0x03, 'f', 'o', // Truncated name.
+const uint8_t kResponseTruncatedCNAME[] = {
+ // Header: 1 question, 1 answer RR
+ 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ // Question: name = 'a', type = A (0x1)
+ 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
+ // Answer: name = 'a', type = CNAME, TTL = 0xFF, RDATA = 'foo' (truncated)
+ 0x01, 'a', 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x03,
+ 0x03, 'f', 'o', // Truncated name.
};
-const uint8 kResponseNameMismatch[] = {
- // Header: 1 question, 1 answer RR
- 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- // Question: name = 'a', type = A (0x1)
- 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
- // Answer: name = 'b', type = A, TTL = 0xFF, RDATA = 10.10.10.10
- 0x01, 'b', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x04, 0x0A, 0x0A, 0x0A, 0x0A,
+const uint8_t kResponseNameMismatch[] = {
+ // Header: 1 question, 1 answer RR
+ 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ // Question: name = 'a', type = A (0x1)
+ 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
+ // Answer: name = 'b', type = A, TTL = 0xFF, RDATA = 10.10.10.10
+ 0x01, 'b', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x04,
+ 0x0A, 0x0A, 0x0A, 0x0A,
};
-const uint8 kResponseNameMismatchInChain[] = {
- // Header: 1 question, 3 answer RR
- 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
- // Question: name = 'a', type = A (0x1)
- 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
- // Answer: name = 'a', type = CNAME, TTL = 0xFF, RDATA = 'b'
- 0x01, 'a', 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x03, 0x01, 'b', 0x00,
- // Answer: name = 'b', type = A, TTL = 0xFF, RDATA = 10.10.10.10
- 0x01, 'b', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x04, 0x0A, 0x0A, 0x0A, 0x0A,
- // Answer: name = 'c', type = A, TTL = 0xFF, RDATA = 10.10.10.11
- 0x01, 'c', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x04, 0x0A, 0x0A, 0x0A, 0x0B,
+const uint8_t kResponseNameMismatchInChain[] = {
+ // Header: 1 question, 3 answer RR
+ 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+ // Question: name = 'a', type = A (0x1)
+ 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
+ // Answer: name = 'a', type = CNAME, TTL = 0xFF, RDATA = 'b'
+ 0x01, 'a', 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x03,
+ 0x01, 'b', 0x00,
+ // Answer: name = 'b', type = A, TTL = 0xFF, RDATA = 10.10.10.10
+ 0x01, 'b', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x04,
+ 0x0A, 0x0A, 0x0A, 0x0A,
+ // Answer: name = 'c', type = A, TTL = 0xFF, RDATA = 10.10.10.11
+ 0x01, 'c', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x04,
+ 0x0A, 0x0A, 0x0A, 0x0B,
};
-const uint8 kResponseSizeMismatch[] = {
- // Header: 1 answer RR
- 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- // Question: name = 'a', type = AAAA (0x1c)
- 0x01, 'a', 0x00, 0x00, 0x1c, 0x00, 0x01,
- // Answer: name = 'a', type = AAAA, TTL = 0xFF, RDATA = 10.10.10.10
- 0x01, 'a', 0x00, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x04, 0x0A, 0x0A, 0x0A, 0x0A,
+const uint8_t kResponseSizeMismatch[] = {
+ // Header: 1 answer RR
+ 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ // Question: name = 'a', type = AAAA (0x1c)
+ 0x01, 'a', 0x00, 0x00, 0x1c, 0x00, 0x01,
+ // Answer: name = 'a', type = AAAA, TTL = 0xFF, RDATA = 10.10.10.10
+ 0x01, 'a', 0x00, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x04,
+ 0x0A, 0x0A, 0x0A, 0x0A,
};
-const uint8 kResponseCNAMEAfterAddress[] = {
- // Header: 2 answer RR
- 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
- // Question: name = 'a', type = A (0x1)
- 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
- // Answer: name = 'a', type = A, TTL = 0xFF, RDATA = 10.10.10.10.
- 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x04, 0x0A, 0x0A, 0x0A, 0x0A,
- // Answer: name = 'a', type = CNAME, TTL = 0xFF, RDATA = 'b'
- 0x01, 'a', 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x03, 0x01, 'b', 0x00,
+const uint8_t kResponseCNAMEAfterAddress[] = {
+ // Header: 2 answer RR
+ 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+ // Question: name = 'a', type = A (0x1)
+ 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
+ // Answer: name = 'a', type = A, TTL = 0xFF, RDATA = 10.10.10.10.
+ 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x04,
+ 0x0A, 0x0A, 0x0A, 0x0A,
+ // Answer: name = 'a', type = CNAME, TTL = 0xFF, RDATA = 'b'
+ 0x01, 'a', 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x03,
+ 0x01, 'b', 0x00,
};
-const uint8 kResponseNoAddresses[] = {
- // Header: 1 question, 1 answer RR, 1 authority RR
- 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
- // Question: name = 'a', type = A (0x1)
- 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
- // Answer: name = 'a', type = CNAME, TTL = 0xFF, RDATA = 'b'
- 0x01, 'a', 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x03, 0x01, 'b', 0x00,
- // Authority section
- // Answer: name = 'b', type = A, TTL = 0xFF, RDATA = 10.10.10.10
- 0x01, 'b', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x04, 0x0A, 0x0A, 0x0A, 0x0A,
+const uint8_t kResponseNoAddresses[] = {
+ // Header: 1 question, 1 answer RR, 1 authority RR
+ 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ // Question: name = 'a', type = A (0x1)
+ 0x01, 'a', 0x00, 0x00, 0x01, 0x00, 0x01,
+ // Answer: name = 'a', type = CNAME, TTL = 0xFF, RDATA = 'b'
+ 0x01, 'a', 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x03,
+ 0x01, 'b', 0x00,
+ // Authority section
+ // Answer: name = 'b', type = A, TTL = 0xFF, RDATA = 10.10.10.10
+ 0x01, 'b', 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x04,
+ 0x0A, 0x0A, 0x0A, 0x0A,
};
TEST(DnsResponseTest, ParseToAddressListFail) {
const struct TestCase {
- const uint8* data;
+ const uint8_t* data;
size_t size;
DnsResponse::Result expected_result;
} cases[] = {
diff --git a/net/dns/dns_session.cc b/net/dns/dns_session.cc
index 3a6c4d4..b200ea3 100644
--- a/net/dns/dns_session.cc
+++ b/net/dns/dns_session.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/lazy_instance.h"
+#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sample_vector.h"
#include "base/rand_util.h"
diff --git a/net/dns/dns_session.h b/net/dns/dns_session.h
index ce1a917..106493e 100644
--- a/net/dns/dns_session.h
+++ b/net/dns/dns_session.h
@@ -5,9 +5,12 @@
#ifndef NET_DNS_DNS_SESSION_H_
#define NET_DNS_DNS_SESSION_H_
+#include <stdint.h>
+
#include <vector>
#include "base/lazy_instance.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/bucket_ranges.h"
diff --git a/net/dns/dns_socket_pool.cc b/net/dns/dns_socket_pool.cc
index 2c3c8c2..e937f9c 100644
--- a/net/dns/dns_socket_pool.cc
+++ b/net/dns/dns_socket_pool.cc
@@ -5,6 +5,7 @@
#include "net/dns/dns_socket_pool.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/rand_util.h"
#include "base/stl_util.h"
#include "net/base/address_list.h"
diff --git a/net/dns/dns_socket_pool.h b/net/dns/dns_socket_pool.h
index 68d9a9c..19539386 100644
--- a/net/dns/dns_socket_pool.h
+++ b/net/dns/dns_socket_pool.h
@@ -7,6 +7,7 @@
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/log/net_log.h"
diff --git a/net/dns/dns_test_util.cc b/net/dns/dns_test_util.cc
index 6b2bdfb..de91048 100644
--- a/net/dns/dns_test_util.cc
+++ b/net/dns/dns_test_util.cc
@@ -41,7 +41,7 @@
public:
MockTransaction(const MockDnsClientRuleList& rules,
const std::string& hostname,
- uint16 qtype,
+ uint16_t qtype,
const DnsTransactionFactory::CallbackType& callback)
: result_(MockDnsClientRule::FAIL),
hostname_(hostname),
@@ -64,7 +64,7 @@
const std::string& GetHostname() const override { return hostname_; }
- uint16 GetType() const override { return qtype_; }
+ uint16_t GetType() const override { return qtype_; }
void Start() override {
EXPECT_FALSE(started_);
@@ -102,10 +102,10 @@
header->flags |= dns_protocol::kFlagResponse;
if (MockDnsClientRule::OK == result_) {
- const uint16 kPointerToQueryName =
- static_cast<uint16>(0xc000 | sizeof(*header));
+ const uint16_t kPointerToQueryName =
+ static_cast<uint16_t>(0xc000 | sizeof(*header));
- const uint32 kTTL = 86400; // One day.
+ const uint32_t kTTL = 86400; // One day.
// Size of RDATA which is a IPv4 or IPv6 address.
size_t rdata_size = qtype_ == dns_protocol::kTypeA ? kIPv4AddressSize
@@ -122,7 +122,7 @@
writer.WriteU16(qtype_);
writer.WriteU16(dns_protocol::kClassIN);
writer.WriteU32(kTTL);
- writer.WriteU16(static_cast<uint16>(rdata_size));
+ writer.WriteU16(static_cast<uint16_t>(rdata_size));
if (qtype_ == dns_protocol::kTypeA) {
char kIPv4Loopback[] = { 0x7f, 0, 0, 1 };
writer.WriteBytes(kIPv4Loopback, sizeof(kIPv4Loopback));
@@ -150,7 +150,7 @@
MockDnsClientRule::Result result_;
const std::string hostname_;
- const uint16 qtype_;
+ const uint16_t qtype_;
DnsTransactionFactory::CallbackType callback_;
bool started_;
bool delayed_;
@@ -168,7 +168,7 @@
scoped_ptr<DnsTransaction> CreateTransaction(
const std::string& hostname,
- uint16 qtype,
+ uint16_t qtype,
const DnsTransactionFactory::CallbackType& callback,
const BoundNetLog&) override {
MockTransaction* transaction =
diff --git a/net/dns/dns_test_util.h b/net/dns/dns_test_util.h
index e168afc..fc32500 100644
--- a/net/dns/dns_test_util.h
+++ b/net/dns/dns_test_util.h
@@ -5,10 +5,12 @@
#ifndef NET_DNS_DNS_TEST_UTIL_H_
#define NET_DNS_DNS_TEST_UTIL_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/dns/dns_client.h"
#include "net/dns/dns_config_service.h"
@@ -19,7 +21,7 @@
//-----------------------------------------------------------------------------
// Query/response set for www.google.com, ID is fixed to 0.
static const char kT0HostName[] = "www.google.com";
-static const uint16 kT0Qtype = dns_protocol::kTypeA;
+static const uint16_t kT0Qtype = dns_protocol::kTypeA;
static const char kT0DnsName[] = {
0x03, 'w', 'w', 'w',
0x06, 'g', 'o', 'o', 'g', 'l', 'e',
@@ -27,27 +29,20 @@
0x00
};
static const size_t kT0QuerySize = 32;
-static const uint8 kT0ResponseDatagram[] = {
- // response contains one CNAME for www.l.google.com and the following
- // IP addresses: 74.125.226.{179,180,176,177,178}
- 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x06,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x77, 0x77,
- 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03,
- 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01,
- 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01,
- 0x4d, 0x13, 0x00, 0x08, 0x03, 0x77, 0x77, 0x77,
- 0x01, 0x6c, 0xc0, 0x10, 0xc0, 0x2c, 0x00, 0x01,
- 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x04,
- 0x4a, 0x7d, 0xe2, 0xb3, 0xc0, 0x2c, 0x00, 0x01,
- 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x04,
- 0x4a, 0x7d, 0xe2, 0xb4, 0xc0, 0x2c, 0x00, 0x01,
- 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x04,
- 0x4a, 0x7d, 0xe2, 0xb0, 0xc0, 0x2c, 0x00, 0x01,
- 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x04,
- 0x4a, 0x7d, 0xe2, 0xb1, 0xc0, 0x2c, 0x00, 0x01,
- 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x04,
- 0x4a, 0x7d, 0xe2, 0xb2
-};
+static const uint8_t kT0ResponseDatagram[] = {
+ // response contains one CNAME for www.l.google.com and the following
+ // IP addresses: 74.125.226.{179,180,176,177,178}
+ 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x77, 0x77, 0x77, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03,
+ 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x05,
+ 0x00, 0x01, 0x00, 0x01, 0x4d, 0x13, 0x00, 0x08, 0x03, 0x77, 0x77, 0x77,
+ 0x01, 0x6c, 0xc0, 0x10, 0xc0, 0x2c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
+ 0x00, 0xe4, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb3, 0xc0, 0x2c, 0x00, 0x01,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb4,
+ 0xc0, 0x2c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x04,
+ 0x4a, 0x7d, 0xe2, 0xb0, 0xc0, 0x2c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
+ 0x00, 0xe4, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb1, 0xc0, 0x2c, 0x00, 0x01,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb2};
static const char* const kT0IpAddresses[] = {
"74.125.226.179", "74.125.226.180", "74.125.226.176",
"74.125.226.177", "74.125.226.178"
@@ -60,7 +55,7 @@
//-----------------------------------------------------------------------------
// Query/response set for codereview.chromium.org, ID is fixed to 1.
static const char kT1HostName[] = "codereview.chromium.org";
-static const uint16 kT1Qtype = dns_protocol::kTypeA;
+static const uint16_t kT1Qtype = dns_protocol::kTypeA;
static const char kT1DnsName[] = {
0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w',
0x08, 'c', 'h', 'r', 'o', 'm', 'i', 'u', 'm',
@@ -68,21 +63,17 @@
0x00
};
static const size_t kT1QuerySize = 41;
-static const uint8 kT1ResponseDatagram[] = {
- // response contains one CNAME for ghs.l.google.com and the following
- // IP address: 64.233.169.121
- 0x00, 0x01, 0x81, 0x80, 0x00, 0x01, 0x00, 0x02,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x63, 0x6f, 0x64,
- 0x65, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x08,
- 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d,
- 0x03, 0x6f, 0x72, 0x67, 0x00, 0x00, 0x01, 0x00,
- 0x01, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00,
- 0x01, 0x41, 0x75, 0x00, 0x12, 0x03, 0x67, 0x68,
- 0x73, 0x01, 0x6c, 0x06, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0xc0,
- 0x35, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01,
- 0x0b, 0x00, 0x04, 0x40, 0xe9, 0xa9, 0x79
-};
+static const uint8_t kT1ResponseDatagram[] = {
+ // response contains one CNAME for ghs.l.google.com and the following
+ // IP address: 64.233.169.121
+ 0x00, 0x01, 0x81, 0x80, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x0a, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x65, 0x76, 0x69, 0x65,
+ 0x77, 0x08, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x03,
+ 0x6f, 0x72, 0x67, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, 0x0c, 0x00,
+ 0x05, 0x00, 0x01, 0x00, 0x01, 0x41, 0x75, 0x00, 0x12, 0x03, 0x67,
+ 0x68, 0x73, 0x01, 0x6c, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x03, 0x63, 0x6f, 0x6d, 0x00, 0xc0, 0x35, 0x00, 0x01, 0x00, 0x01,
+ 0x00, 0x00, 0x01, 0x0b, 0x00, 0x04, 0x40, 0xe9, 0xa9, 0x79};
static const char* const kT1IpAddresses[] = {
"64.233.169.121"
};
@@ -94,7 +85,7 @@
//-----------------------------------------------------------------------------
// Query/response set for www.ccs.neu.edu, ID is fixed to 2.
static const char kT2HostName[] = "www.ccs.neu.edu";
-static const uint16 kT2Qtype = dns_protocol::kTypeA;
+static const uint16_t kT2Qtype = dns_protocol::kTypeA;
static const char kT2DnsName[] = {
0x03, 'w', 'w', 'w',
0x03, 'c', 'c', 's',
@@ -103,19 +94,15 @@
0x00
};
static const size_t kT2QuerySize = 33;
-static const uint8 kT2ResponseDatagram[] = {
- // response contains one CNAME for vulcan.ccs.neu.edu and the following
- // IP address: 129.10.116.81
- 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, 0x00, 0x02,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x77, 0x77,
- 0x03, 0x63, 0x63, 0x73, 0x03, 0x6e, 0x65, 0x75,
- 0x03, 0x65, 0x64, 0x75, 0x00, 0x00, 0x01, 0x00,
- 0x01, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00,
- 0x00, 0x01, 0x2c, 0x00, 0x09, 0x06, 0x76, 0x75,
- 0x6c, 0x63, 0x61, 0x6e, 0xc0, 0x10, 0xc0, 0x2d,
- 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x2c,
- 0x00, 0x04, 0x81, 0x0a, 0x74, 0x51
-};
+static const uint8_t kT2ResponseDatagram[] = {
+ // response contains one CNAME for vulcan.ccs.neu.edu and the following
+ // IP address: 129.10.116.81
+ 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x77, 0x77, 0x77, 0x03, 0x63, 0x63, 0x73, 0x03, 0x6e, 0x65, 0x75,
+ 0x03, 0x65, 0x64, 0x75, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, 0x0c, 0x00,
+ 0x05, 0x00, 0x01, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x09, 0x06, 0x76, 0x75,
+ 0x6c, 0x63, 0x61, 0x6e, 0xc0, 0x10, 0xc0, 0x2d, 0x00, 0x01, 0x00, 0x01,
+ 0x00, 0x00, 0x01, 0x2c, 0x00, 0x04, 0x81, 0x0a, 0x74, 0x51};
static const char* const kT2IpAddresses[] = {
"129.10.116.81"
};
@@ -127,7 +114,7 @@
//-----------------------------------------------------------------------------
// Query/response set for www.google.az, ID is fixed to 3.
static const char kT3HostName[] = "www.google.az";
-static const uint16 kT3Qtype = dns_protocol::kTypeA;
+static const uint16_t kT3Qtype = dns_protocol::kTypeA;
static const char kT3DnsName[] = {
0x03, 'w', 'w', 'w',
0x06, 'g', 'o', 'o', 'g', 'l', 'e',
@@ -135,37 +122,28 @@
0x00
};
static const size_t kT3QuerySize = 31;
-static const uint8 kT3ResponseDatagram[] = {
- // response contains www.google.com as CNAME for www.google.az and
- // www.l.google.com as CNAME for www.google.com and the following
- // IP addresses: 74.125.226.{178,179,180,176,177}
- // The TTLs on the records are: 0x00015099, 0x00025099, 0x00000415,
- // 0x00003015, 0x00002015, 0x00000015, 0x00001015.
- // The last record is an imaginary TXT record for t.google.com.
- 0x00, 0x03, 0x81, 0x80, 0x00, 0x01, 0x00, 0x08,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x77, 0x77,
- 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x02,
- 0x61, 0x7a, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0,
- 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x50,
- 0x99, 0x00, 0x10, 0x03, 0x77, 0x77, 0x77, 0x06,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63,
- 0x6f, 0x6d, 0x00, 0xc0, 0x2b, 0x00, 0x05, 0x00,
- 0x01, 0x00, 0x02, 0x50, 0x99, 0x00, 0x08, 0x03,
- 0x77, 0x77, 0x77, 0x01, 0x6c, 0xc0, 0x2f, 0xc0,
- 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x04,
- 0x15, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb2, 0xc0,
- 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x30,
- 0x15, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb3, 0xc0,
- 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x20,
- 0x15, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb4, 0xc0,
- 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x15, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb0, 0xc0,
- 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x10,
- 0x15, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb1, 0x01,
- 0x74, 0xc0, 0x2f, 0x00, 0x10, 0x00, 0x01, 0x00,
- 0x00, 0x00, 0x01, 0x00, 0x04, 0xde, 0xad, 0xfe,
- 0xed
-};
+static const uint8_t kT3ResponseDatagram[] = {
+ // response contains www.google.com as CNAME for www.google.az and
+ // www.l.google.com as CNAME for www.google.com and the following
+ // IP addresses: 74.125.226.{178,179,180,176,177}
+ // The TTLs on the records are: 0x00015099, 0x00025099, 0x00000415,
+ // 0x00003015, 0x00002015, 0x00000015, 0x00001015.
+ // The last record is an imaginary TXT record for t.google.com.
+ 0x00, 0x03, 0x81, 0x80, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x77, 0x77, 0x77, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x02,
+ 0x61, 0x7a, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x05, 0x00,
+ 0x01, 0x00, 0x01, 0x50, 0x99, 0x00, 0x10, 0x03, 0x77, 0x77, 0x77, 0x06,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0xc0,
+ 0x2b, 0x00, 0x05, 0x00, 0x01, 0x00, 0x02, 0x50, 0x99, 0x00, 0x08, 0x03,
+ 0x77, 0x77, 0x77, 0x01, 0x6c, 0xc0, 0x2f, 0xc0, 0x47, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x00, 0x04, 0x15, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb2, 0xc0,
+ 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x30, 0x15, 0x00, 0x04, 0x4a,
+ 0x7d, 0xe2, 0xb3, 0xc0, 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x20,
+ 0x15, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb4, 0xc0, 0x47, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x4a, 0x7d, 0xe2, 0xb0, 0xc0,
+ 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x10, 0x15, 0x00, 0x04, 0x4a,
+ 0x7d, 0xe2, 0xb1, 0x01, 0x74, 0xc0, 0x2f, 0x00, 0x10, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x04, 0xde, 0xad, 0xfe, 0xed};
static const char* const kT3IpAddresses[] = {
"74.125.226.178", "74.125.226.179", "74.125.226.180",
"74.125.226.176", "74.125.226.177"
@@ -190,15 +168,17 @@
// If |delay| is true, matching transactions will be delayed until triggered
// by the consumer.
MockDnsClientRule(const std::string& prefix_arg,
- uint16 qtype_arg,
+ uint16_t qtype_arg,
Result result_arg,
bool delay)
- : result(result_arg), prefix(prefix_arg), qtype(qtype_arg),
+ : result(result_arg),
+ prefix(prefix_arg),
+ qtype(qtype_arg),
delay(delay) {}
Result result;
std::string prefix;
- uint16 qtype;
+ uint16_t qtype;
bool delay;
};
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index bc4a127..52d5470 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -11,6 +11,7 @@
#include "base/big_endian.h"
#include "base/bind.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -61,7 +62,7 @@
scoped_ptr<base::Value> NetLogStartCallback(
const std::string* hostname,
- uint16 qtype,
+ uint16_t qtype,
NetLogCaptureMode /* capture_mode */) {
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("hostname", *hostname);
@@ -304,7 +305,7 @@
next_state_(STATE_NONE),
socket_(socket.Pass()),
query_(query.Pass()),
- length_buffer_(new IOBufferWithSize(sizeof(uint16))),
+ length_buffer_(new IOBufferWithSize(sizeof(uint16_t))),
response_length_(0) {}
// DnsAttempt:
@@ -401,10 +402,10 @@
if (rv < 0)
return rv;
- uint16 query_size = static_cast<uint16>(query_->io_buffer()->size());
+ uint16_t query_size = static_cast<uint16_t>(query_->io_buffer()->size());
if (static_cast<int>(query_size) != query_->io_buffer()->size())
return ERR_FAILED;
- base::WriteBigEndian<uint16>(length_buffer_->data(), query_size);
+ base::WriteBigEndian<uint16_t>(length_buffer_->data(), query_size);
buffer_ =
new DrainableIOBuffer(length_buffer_.get(), length_buffer_->size());
next_state_ = STATE_SEND_LENGTH;
@@ -469,7 +470,7 @@
return OK;
}
- base::ReadBigEndian<uint16>(length_buffer_->data(), &response_length_);
+ base::ReadBigEndian<uint16_t>(length_buffer_->data(), &response_length_);
// Check if advertised response is too short. (Optimization only.)
if (response_length_ < query_->io_buffer()->size())
return ERR_DNS_MALFORMED_RESPONSE;
@@ -534,7 +535,7 @@
scoped_refptr<IOBufferWithSize> length_buffer_;
scoped_refptr<DrainableIOBuffer> buffer_;
- uint16 response_length_;
+ uint16_t response_length_;
scoped_ptr<DnsResponse> response_;
CompletionCallback callback_;
@@ -556,18 +557,18 @@
public:
DnsTransactionImpl(DnsSession* session,
const std::string& hostname,
- uint16 qtype,
+ uint16_t qtype,
const DnsTransactionFactory::CallbackType& callback,
const BoundNetLog& net_log)
- : session_(session),
- hostname_(hostname),
- qtype_(qtype),
- callback_(callback),
- net_log_(net_log),
- qnames_initial_size_(0),
- attempts_count_(0),
- had_tcp_attempt_(false),
- first_server_index_(0) {
+ : session_(session),
+ hostname_(hostname),
+ qtype_(qtype),
+ callback_(callback),
+ net_log_(net_log),
+ qnames_initial_size_(0),
+ attempts_count_(0),
+ had_tcp_attempt_(false),
+ first_server_index_(0) {
DCHECK(session_.get());
DCHECK(!hostname_.empty());
DCHECK(!callback_.is_null());
@@ -586,7 +587,7 @@
return hostname_;
}
- uint16 GetType() const override {
+ uint16_t GetType() const override {
DCHECK(CalledOnValidThread());
return qtype_;
}
@@ -702,7 +703,7 @@
AttemptResult MakeAttempt() {
unsigned attempt_number = attempts_.size();
- uint16 id = session_->NextQueryId();
+ uint16_t id = session_->NextQueryId();
scoped_ptr<DnsQuery> query;
if (attempts_.empty()) {
query.reset(new DnsQuery(id, qnames_.front(), qtype_));
@@ -757,7 +758,7 @@
session_->CreateTCPSocket(server_index, net_log_.source()));
// TODO(szym): Reuse the same id to help the server?
- uint16 id = session_->NextQueryId();
+ uint16_t id = session_->NextQueryId();
scoped_ptr<DnsQuery> query =
previous_attempt->GetQuery()->CloneWithNewId(id);
@@ -941,7 +942,7 @@
scoped_refptr<DnsSession> session_;
std::string hostname_;
- uint16 qtype_;
+ uint16_t qtype_;
// Cleared in DoCallback.
DnsTransactionFactory::CallbackType callback_;
@@ -977,7 +978,7 @@
scoped_ptr<DnsTransaction> CreateTransaction(
const std::string& hostname,
- uint16 qtype,
+ uint16_t qtype,
const CallbackType& callback,
const BoundNetLog& net_log) override {
return scoped_ptr<DnsTransaction>(new DnsTransactionImpl(
diff --git a/net/dns/dns_transaction.h b/net/dns/dns_transaction.h
index faf4f64..e338cb9 100644
--- a/net/dns/dns_transaction.h
+++ b/net/dns/dns_transaction.h
@@ -5,9 +5,10 @@
#ifndef NET_DNS_DNS_TRANSACTION_H_
#define NET_DNS_DNS_TRANSACTION_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/callback_forward.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
@@ -32,7 +33,7 @@
virtual const std::string& GetHostname() const = 0;
// Returns the |qtype|.
- virtual uint16 GetType() const = 0;
+ virtual uint16_t GetType() const = 0;
// Starts the transaction. Always completes asynchronously.
virtual void Start() = 0;
@@ -62,7 +63,7 @@
// The |net_log| is used as the parent log.
virtual scoped_ptr<DnsTransaction> CreateTransaction(
const std::string& hostname,
- uint16 qtype,
+ uint16_t qtype,
const CallbackType& callback,
const BoundNetLog& net_log) WARN_UNUSED_RESULT = 0;
diff --git a/net/dns/dns_transaction_unittest.cc b/net/dns/dns_transaction_unittest.cc
index 7190ed8..38c070c 100644
--- a/net/dns/dns_transaction_unittest.cc
+++ b/net/dns/dns_transaction_unittest.cc
@@ -9,6 +9,7 @@
#include <limits>
#include "base/bind.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/rand_util.h"
#include "base/sys_byteorder.h"
diff --git a/net/dns/host_cache.h b/net/dns/host_cache.h
index d9108c0..70b1893 100644
--- a/net/dns/host_cache.h
+++ b/net/dns/host_cache.h
@@ -5,11 +5,14 @@
#ifndef NET_DNS_HOST_CACHE_H_
#define NET_DNS_HOST_CACHE_H_
+#include <stddef.h>
+
#include <functional>
#include <string>
#include <tuple>
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/time.h"
diff --git a/net/dns/host_resolver.h b/net/dns/host_resolver.h
index 76ee8e2..57fc7c23 100644
--- a/net/dns/host_resolver.h
+++ b/net/dns/host_resolver.h
@@ -5,9 +5,12 @@
#ifndef NET_DNS_HOST_RESOLVER_H_
#define NET_DNS_HOST_RESOLVER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/address_family.h"
#include "net/base/completion_callback.h"
@@ -67,7 +70,7 @@
host_port_pair_ = host_port_pair;
}
- uint16 port() const { return host_port_pair_.port(); }
+ uint16_t port() const { return host_port_pair_.port(); }
const std::string& hostname() const { return host_port_pair_.host(); }
AddressFamily address_family() const { return address_family_; }
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index 2d2a06b..a4af057 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -14,13 +14,13 @@
#include <utility>
#include <vector>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/debug/debugger.h"
#include "base/debug/stack_trace.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
@@ -217,7 +217,7 @@
bool is_link_local = (address[0] == 0xFE) && ((address[1] & 0xC0) == 0x80);
if (is_link_local)
return false;
- const uint8 kTeredoPrefix[] = { 0x20, 0x01, 0, 0 };
+ const uint8_t kTeredoPrefix[] = {0x20, 0x01, 0, 0};
bool is_teredo = std::equal(kTeredoPrefix,
kTeredoPrefix + arraysize(kTeredoPrefix),
address.begin());
@@ -288,7 +288,7 @@
//-----------------------------------------------------------------------------
-AddressList EnsurePortOnAddressList(const AddressList& list, uint16 port) {
+AddressList EnsurePortOnAddressList(const AddressList& list, uint16_t port) {
if (list.empty() || list.front().port() == port)
return list;
return AddressList::CopyWithPort(list, port);
@@ -315,7 +315,7 @@
// Creates NetLog parameters when the resolve failed.
scoped_ptr<base::Value> NetLogProcTaskFailedCallback(
- uint32 attempt_number,
+ uint32_t attempt_number,
int net_error,
int os_error,
NetLogCaptureMode /* capture_mode */) {
@@ -696,7 +696,7 @@
// may no longer exist. Multiple DoLookups() could be running in parallel, so
// any state inside of |this| must not mutate .
void DoLookup(const base::TimeTicks& start_time,
- const uint32 attempt_number) {
+ const uint32_t attempt_number) {
AddressList results;
int os_error = 0;
// Running on the worker thread
@@ -742,7 +742,7 @@
// Callback for when DoLookup() completes (runs on task runner thread).
void OnLookupComplete(const AddressList& results,
const base::TimeTicks& start_time,
- const uint32 attempt_number,
+ const uint32_t attempt_number,
int error,
const int os_error) {
DCHECK(task_runner_->BelongsToCurrentThread());
@@ -875,7 +875,7 @@
}
void RecordAttemptHistograms(const base::TimeTicks& start_time,
- const uint32 attempt_number,
+ const uint32_t attempt_number,
const int error,
const int os_error) const {
DCHECK(task_runner_->BelongsToCurrentThread());
@@ -943,11 +943,11 @@
// Keeps track of the number of attempts we have made so far to resolve the
// host. Whenever we start an attempt to resolve the host, we increase this
// number.
- uint32 attempt_number_;
+ uint32_t attempt_number_;
// The index of the attempt which finished first (or 0 if the job is still in
// progress).
- uint32 completed_attempt_number_;
+ uint32_t completed_attempt_number_;
// The result (a net error code) from the first attempt to complete.
int completed_attempt_error_;
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h
index 9e1b714..9d833d6a 100644
--- a/net/dns/host_resolver_impl.h
+++ b/net/dns/host_resolver_impl.h
@@ -5,9 +5,12 @@
#ifndef NET_DNS_HOST_RESOLVER_IMPL_H_
#define NET_DNS_HOST_RESOLVER_IMPL_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
@@ -92,7 +95,7 @@
base::TimeDelta unresponsive_delay;
// Factor to grow |unresponsive_delay| when we re-re-try.
- uint32 retry_factor;
+ uint32_t retry_factor;
};
// Creates a HostResolver as specified by |options|.
diff --git a/net/dns/host_resolver_impl_unittest.cc b/net/dns/host_resolver_impl_unittest.cc
index aa379a03..569d1ab 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
@@ -186,8 +187,9 @@
DISALLOW_COPY_AND_ASSIGN(MockHostResolverProc);
};
-bool AddressListContains(const AddressList& list, const std::string& address,
- uint16 port) {
+bool AddressListContains(const AddressList& list,
+ const std::string& address,
+ uint16_t port) {
IPAddressNumber ip;
bool rv = ParseIPLiteralToNumber(address, &ip);
DCHECK(rv);
@@ -255,7 +257,7 @@
bool completed() const { return result_ != ERR_IO_PENDING; }
bool pending() const { return handle_ != NULL; }
- bool HasAddress(const std::string& address, uint16 port) const {
+ bool HasAddress(const std::string& address, uint16_t port) const {
return AddressListContains(list_, address, port);
}
@@ -264,7 +266,7 @@
return list_.size();
}
- bool HasOneAddress(const std::string& address, uint16 port) const {
+ bool HasOneAddress(const std::string& address, uint16_t port) const {
return HasAddress(address, port) && (NumberOfAddresses() == 1u);
}
@@ -1474,7 +1476,7 @@
// Adds a rule to |dns_rules_|. Must be followed by |CreateResolver| to apply.
void AddDnsRule(const std::string& prefix,
- uint16 qtype,
+ uint16_t qtype,
MockDnsClientRule::Result result,
bool delay) {
dns_rules_.push_back(MockDnsClientRule(prefix, qtype, result, delay));
diff --git a/net/dns/host_resolver_mojo.h b/net/dns/host_resolver_mojo.h
index 23fb0ff..905d6c94 100644
--- a/net/dns/host_resolver_mojo.h
+++ b/net/dns/host_resolver_mojo.h
@@ -5,6 +5,7 @@
#ifndef NET_DNS_HOST_RESOLVER_MOJO_H_
#define NET_DNS_HOST_RESOLVER_MOJO_H_
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "net/dns/host_cache.h"
diff --git a/net/dns/host_resolver_proc.h b/net/dns/host_resolver_proc.h
index cb61e19..182298b7 100644
--- a/net/dns/host_resolver_proc.h
+++ b/net/dns/host_resolver_proc.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/address_family.h"
#include "net/base/net_export.h"
diff --git a/net/dns/mdns_cache.h b/net/dns/mdns_cache.h
index 6a38fc8..e8f9153 100644
--- a/net/dns/mdns_cache.h
+++ b/net/dns/mdns_cache.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/callback.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
diff --git a/net/dns/mdns_cache_unittest.cc b/net/dns/mdns_cache_unittest.cc
index c12ad6b..8e6bd4a 100644
--- a/net/dns/mdns_cache_unittest.cc
+++ b/net/dns/mdns_cache_unittest.cc
@@ -18,111 +18,83 @@
namespace net {
-static const uint8 kTestResponsesDifferentAnswers[] = {
- // Answer 1
- // ghs.l.google.com in DNS format.
- 3, 'g', 'h', 's',
- 1, 'l',
- 6, 'g', 'o', 'o', 'g', 'l', 'e',
- 3, 'c', 'o', 'm',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
- 0, 4, // RDLENGTH is 4 bytes.
- 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
+static const uint8_t kTestResponsesDifferentAnswers[] = {
+ // Answer 1
+ // ghs.l.google.com in DNS format.
+ 3, 'g', 'h', 's', 1, 'l', 6, 'g', 'o', 'o', 'g', 'l', 'e', 3, 'c', 'o', 'm',
+ 0x00, 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
+ 0, 4, // RDLENGTH is 4 bytes.
+ 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
- // Answer 2
- // Pointer to answer 1
- 0xc0, 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
- 0, 4, // RDLENGTH is 4 bytes.
- 74, 125, 95, 122, // RDATA is the IP: 74.125.95.122
+ // Answer 2
+ // Pointer to answer 1
+ 0xc0, 0x00, 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
+ 0, 4, // RDLENGTH is 4 bytes.
+ 74, 125, 95, 122, // RDATA is the IP: 74.125.95.122
};
-static const uint8 kTestResponsesSameAnswers[] = {
- // Answer 1
- // ghs.l.google.com in DNS format.
- 3, 'g', 'h', 's',
- 1, 'l',
- 6, 'g', 'o', 'o', 'g', 'l', 'e',
- 3, 'c', 'o', 'm',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
- 0, 4, // RDLENGTH is 4 bytes.
- 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
+static const uint8_t kTestResponsesSameAnswers[] = {
+ // Answer 1
+ // ghs.l.google.com in DNS format.
+ 3, 'g', 'h', 's', 1, 'l', 6, 'g', 'o', 'o', 'g', 'l', 'e', 3, 'c', 'o', 'm',
+ 0x00, 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
+ 0, 4, // RDLENGTH is 4 bytes.
+ 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
- // Answer 2
- // Pointer to answer 1
- 0xc0, 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0, 0, 0, 112, // TTL (4 bytes) is 112 seconds.
- 0, 4, // RDLENGTH is 4 bytes.
- 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
+ // Answer 2
+ // Pointer to answer 1
+ 0xc0, 0x00, 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0, 0, 0, 112, // TTL (4 bytes) is 112 seconds.
+ 0, 4, // RDLENGTH is 4 bytes.
+ 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
};
-static const uint8 kTestResponseTwoRecords[] = {
- // Answer 1
- // ghs.l.google.com in DNS format. (A)
- 3, 'g', 'h', 's',
- 1, 'l',
- 6, 'g', 'o', 'o', 'g', 'l', 'e',
- 3, 'c', 'o', 'm',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
- 0, 4, // RDLENGTH is 4 bytes.
- 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
+static const uint8_t kTestResponseTwoRecords[] = {
+ // Answer 1
+ // ghs.l.google.com in DNS format. (A)
+ 3, 'g', 'h', 's', 1, 'l', 6, 'g', 'o', 'o', 'g', 'l', 'e', 3, 'c', 'o', 'm',
+ 0x00, 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
+ 0, 4, // RDLENGTH is 4 bytes.
+ 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
- // Answer 2
- // ghs.l.google.com in DNS format. (AAAA)
- 3, 'g', 'h', 's',
- 1, 'l',
- 6, 'g', 'o', 'o', 'g', 'l', 'e',
- 3, 'c', 'o', 'm',
- 0x00,
- 0x00, 0x1c, // TYPE is AAA.
- 0x00, 0x01, // CLASS is IN.
- 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
- 0, 16, // RDLENGTH is 16 bytes.
- 0x4a, 0x7d, 0x4a, 0x7d,
- 0x5f, 0x79, 0x5f, 0x79,
- 0x5f, 0x79, 0x5f, 0x79,
- 0x5f, 0x79, 0x5f, 0x79,
+ // Answer 2
+ // ghs.l.google.com in DNS format. (AAAA)
+ 3, 'g', 'h', 's', 1, 'l', 6, 'g', 'o', 'o', 'g', 'l', 'e', 3, 'c', 'o', 'm',
+ 0x00, 0x00, 0x1c, // TYPE is AAA.
+ 0x00, 0x01, // CLASS is IN.
+ 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
+ 0, 16, // RDLENGTH is 16 bytes.
+ 0x4a, 0x7d, 0x4a, 0x7d, 0x5f, 0x79, 0x5f, 0x79, 0x5f, 0x79, 0x5f, 0x79,
+ 0x5f, 0x79, 0x5f, 0x79,
};
-static const uint8 kTestResponsesGoodbyePacket[] = {
- // Answer 1
- // ghs.l.google.com in DNS format. (Goodbye packet)
- 3, 'g', 'h', 's',
- 1, 'l',
- 6, 'g', 'o', 'o', 'g', 'l', 'e',
- 3, 'c', 'o', 'm',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0, 0, 0, 0, // TTL (4 bytes) is zero.
- 0, 4, // RDLENGTH is 4 bytes.
- 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
+static const uint8_t kTestResponsesGoodbyePacket[] = {
+ // Answer 1
+ // ghs.l.google.com in DNS format. (Goodbye packet)
+ 3, 'g', 'h', 's', 1, 'l', 6, 'g', 'o', 'o', 'g', 'l', 'e', 3, 'c', 'o', 'm',
+ 0x00, 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0, 0, 0, 0, // TTL (4 bytes) is zero.
+ 0, 4, // RDLENGTH is 4 bytes.
+ 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
- // Answer 2
- // ghs.l.google.com in DNS format.
- 3, 'g', 'h', 's',
- 1, 'l',
- 6, 'g', 'o', 'o', 'g', 'l', 'e',
- 3, 'c', 'o', 'm',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
- 0, 4, // RDLENGTH is 4 bytes.
- 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
+ // Answer 2
+ // ghs.l.google.com in DNS format.
+ 3, 'g', 'h', 's', 1, 'l', 6, 'g', 'o', 'o', 'g', 'l', 'e', 3, 'c', 'o', 'm',
+ 0x00, 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0, 0, 0, 53, // TTL (4 bytes) is 53 seconds.
+ 0, 4, // RDLENGTH is 4 bytes.
+ 74, 125, 95, 121, // RDATA is the IP: 74.125.95.121
};
class RecordRemovalMock {
diff --git a/net/dns/mdns_client.cc b/net/dns/mdns_client.cc
index 4d52d73..f2b3f03 100644
--- a/net/dns/mdns_client.cc
+++ b/net/dns/mdns_client.cc
@@ -27,7 +27,7 @@
}
int Bind(const IPEndPoint& multicast_addr,
- uint32 interface_index,
+ uint32_t interface_index,
DatagramServerSocket* socket) {
IPAddressNumber address_any(multicast_addr.address().size());
IPEndPoint bind_endpoint(address_any, multicast_addr.port());
@@ -87,7 +87,7 @@
scoped_ptr<DatagramServerSocket> CreateAndBindMDnsSocket(
AddressFamily address_family,
- uint32 interface_index) {
+ uint32_t interface_index) {
scoped_ptr<DatagramServerSocket> socket(
new UDPServerSocket(NULL, NetLog::Source()));
diff --git a/net/dns/mdns_client.h b/net/dns/mdns_client.h
index 42da7e0e..279aa6d8 100644
--- a/net/dns/mdns_client.h
+++ b/net/dns/mdns_client.h
@@ -5,6 +5,8 @@
#ifndef NET_DNS_MDNS_CLIENT_H_
#define NET_DNS_MDNS_CLIENT_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
@@ -76,7 +78,7 @@
virtual const std::string& GetName() const = 0;
// Get the type for this transaction (SRV, TXT, A, AAA, etc)
- virtual uint16 GetType() const = 0;
+ virtual uint16_t GetType() const = 0;
};
// A listener listens for updates regarding a specific record or set of records.
@@ -122,7 +124,7 @@
virtual const std::string& GetName() const = 0;
// Get the type for this query (SRV, TXT, A, AAA, etc)
- virtual uint16 GetType() const = 0;
+ virtual uint16_t GetType() const = 0;
};
// Creates bound datagram sockets ready to use by MDnsClient.
@@ -146,7 +148,7 @@
// Create listener object for RRType |rrtype| and name |name|.
virtual scoped_ptr<MDnsListener> CreateListener(
- uint16 rrtype,
+ uint16_t rrtype,
const std::string& name,
MDnsListener::Delegate* delegate) = 0;
@@ -154,7 +156,7 @@
// network, or both for records of type |rrtype| and name |name|. |flags| is
// defined by MDnsTransactionFlags.
virtual scoped_ptr<MDnsTransaction> CreateTransaction(
- uint16 rrtype,
+ uint16_t rrtype,
const std::string& name,
int flags,
const MDnsTransaction::ResultCallback& callback) = 0;
@@ -172,7 +174,8 @@
NET_EXPORT IPEndPoint GetMDnsIPEndPoint(AddressFamily address_family);
-typedef std::vector<std::pair<uint32, AddressFamily> > InterfaceIndexFamilyList;
+typedef std::vector<std::pair<uint32_t, AddressFamily>>
+ InterfaceIndexFamilyList;
// Returns pairs of interface and address family to bind. Current
// implementation returns unique list of all available interfaces.
NET_EXPORT InterfaceIndexFamilyList GetMDnsInterfacesToBind();
@@ -182,7 +185,7 @@
// Returns NULL if failed.
NET_EXPORT scoped_ptr<DatagramServerSocket> CreateAndBindMDnsSocket(
AddressFamily address_family,
- uint32 interface_index);
+ uint32_t interface_index);
} // namespace net
diff --git a/net/dns/mdns_client_impl.cc b/net/dns/mdns_client_impl.cc
index 73e8de4..9782ddd 100644
--- a/net/dns/mdns_client_impl.cc
+++ b/net/dns/mdns_client_impl.cc
@@ -215,7 +215,7 @@
return connection_->Init(socket_factory);
}
-bool MDnsClientImpl::Core::SendQuery(uint16 rrtype, const std::string& name) {
+bool MDnsClientImpl::Core::SendQuery(uint16_t rrtype, const std::string& name) {
std::string name_dns;
if (!DNSDomainFromDot(name, &name_dns))
return false;
@@ -421,7 +421,8 @@
}
void MDnsClientImpl::Core::QueryCache(
- uint16 rrtype, const std::string& name,
+ uint16_t rrtype,
+ const std::string& name,
std::vector<const RecordParsed*>* records) const {
cache_.FindDnsRecords(rrtype, name, records, clock_->Now());
}
@@ -458,7 +459,7 @@
}
scoped_ptr<MDnsListener> MDnsClientImpl::CreateListener(
- uint16 rrtype,
+ uint16_t rrtype,
const std::string& name,
MDnsListener::Delegate* delegate) {
return scoped_ptr<MDnsListener>(
@@ -466,7 +467,7 @@
}
scoped_ptr<MDnsTransaction> MDnsClientImpl::CreateTransaction(
- uint16 rrtype,
+ uint16_t rrtype,
const std::string& name,
int flags,
const MDnsTransaction::ResultCallback& callback) {
@@ -474,7 +475,7 @@
new MDnsTransactionImpl(rrtype, name, flags, callback, this));
}
-MDnsListenerImpl::MDnsListenerImpl(uint16 rrtype,
+MDnsListenerImpl::MDnsListenerImpl(uint16_t rrtype,
const std::string& name,
base::Clock* clock,
MDnsListener::Delegate* delegate,
@@ -485,8 +486,7 @@
client_(client),
delegate_(delegate),
started_(false),
- active_refresh_(false) {
-}
+ active_refresh_(false) {}
MDnsListenerImpl::~MDnsListenerImpl() {
if (started_) {
@@ -522,7 +522,7 @@
return name_;
}
-uint16 MDnsListenerImpl::GetType() const {
+uint16_t MDnsListenerImpl::GetType() const {
return rrtype_;
}
@@ -605,13 +605,17 @@
}
MDnsTransactionImpl::MDnsTransactionImpl(
- uint16 rrtype,
+ uint16_t rrtype,
const std::string& name,
int flags,
const MDnsTransaction::ResultCallback& callback,
MDnsClientImpl* client)
- : rrtype_(rrtype), name_(name), callback_(callback), client_(client),
- started_(false), flags_(flags) {
+ : rrtype_(rrtype),
+ name_(name),
+ callback_(callback),
+ client_(client),
+ started_(false),
+ flags_(flags) {
DCHECK((flags_ & MDnsTransaction::FLAG_MASK) == flags_);
DCHECK(flags_ & MDnsTransaction::QUERY_CACHE ||
flags_ & MDnsTransaction::QUERY_NETWORK);
@@ -646,7 +650,7 @@
return name_;
}
-uint16 MDnsTransactionImpl::GetType() const {
+uint16_t MDnsTransactionImpl::GetType() const {
return rrtype_;
}
diff --git a/net/dns/mdns_client_impl.h b/net/dns/mdns_client_impl.h
index f33839f..16a216e 100644
--- a/net/dns/mdns_client_impl.h
+++ b/net/dns/mdns_client_impl.h
@@ -5,6 +5,8 @@
#ifndef NET_DNS_MDNS_CLIENT_IMPL_H_
#define NET_DNS_MDNS_CLIENT_IMPL_H_
+#include <stdint.h>
+
#include <map>
#include <queue>
#include <string>
@@ -13,6 +15,7 @@
#include "base/cancelable_callback.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "net/base/io_buffer.h"
@@ -124,14 +127,15 @@
bool Init(MDnsSocketFactory* socket_factory);
// Send a query with a specific rrtype and name. Returns true on success.
- bool SendQuery(uint16 rrtype, const std::string& name);
+ bool SendQuery(uint16_t rrtype, const std::string& name);
// Add/remove a listener to the list of listeners.
void AddListener(MDnsListenerImpl* listener);
void RemoveListener(MDnsListenerImpl* listener);
// Query the cache for records of a specific type and name.
- void QueryCache(uint16 rrtype, const std::string& name,
+ void QueryCache(uint16_t rrtype,
+ const std::string& name,
std::vector<const RecordParsed*>* records) const;
// Parse the response and alert relevant listeners.
@@ -142,7 +146,7 @@
private:
FRIEND_TEST_ALL_PREFIXES(MDnsTest, CacheCleanupWithShortTTL);
- typedef std::pair<std::string, uint16> ListenerKey;
+ typedef std::pair<std::string, uint16_t> ListenerKey;
typedef std::map<ListenerKey, base::ObserverList<MDnsListenerImpl>*>
ListenerMap;
@@ -183,12 +187,12 @@
// MDnsClient implementation:
scoped_ptr<MDnsListener> CreateListener(
- uint16 rrtype,
+ uint16_t rrtype,
const std::string& name,
MDnsListener::Delegate* delegate) override;
scoped_ptr<MDnsTransaction> CreateTransaction(
- uint16 rrtype,
+ uint16_t rrtype,
const std::string& name,
int flags,
const MDnsTransaction::ResultCallback& callback) override;
@@ -216,7 +220,7 @@
class MDnsListenerImpl : public MDnsListener,
public base::SupportsWeakPtr<MDnsListenerImpl> {
public:
- MDnsListenerImpl(uint16 rrtype,
+ MDnsListenerImpl(uint16_t rrtype,
const std::string& name,
base::Clock* clock,
MDnsListener::Delegate* delegate,
@@ -232,7 +236,7 @@
const std::string& GetName() const override;
- uint16 GetType() const override;
+ uint16_t GetType() const override;
MDnsListener::Delegate* delegate() { return delegate_; }
@@ -247,14 +251,14 @@
void ScheduleNextRefresh();
void DoRefresh();
- uint16 rrtype_;
+ uint16_t rrtype_;
std::string name_;
base::Clock* clock_;
MDnsClientImpl* client_;
MDnsListener::Delegate* delegate_;
base::Time last_update_;
- uint32 ttl_;
+ uint32_t ttl_;
bool started_;
bool active_refresh_;
@@ -266,7 +270,7 @@
public MDnsTransaction,
public MDnsListener::Delegate {
public:
- MDnsTransactionImpl(uint16 rrtype,
+ MDnsTransactionImpl(uint16_t rrtype,
const std::string& name,
int flags,
const MDnsTransaction::ResultCallback& callback,
@@ -277,7 +281,7 @@
bool Start() override;
const std::string& GetName() const override;
- uint16 GetType() const override;
+ uint16_t GetType() const override;
// MDnsListener::Delegate implementation:
void OnRecordUpdate(MDnsListener::UpdateType update,
@@ -310,7 +314,7 @@
// or if it fails to send a query.
bool QueryAndListen();
- uint16 rrtype_;
+ uint16_t rrtype_;
std::string name_;
MDnsTransaction::ResultCallback callback_;
diff --git a/net/dns/mdns_client_unittest.cc b/net/dns/mdns_client_unittest.cc
index e002bbe7..ae1a8d91 100644
--- a/net/dns/mdns_client_unittest.cc
+++ b/net/dns/mdns_client_unittest.cc
@@ -6,6 +6,7 @@
#include <vector>
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
@@ -36,201 +37,7 @@
namespace {
-const uint8 kSamplePacket1[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No questions (for simplicity)
- 0x00, 0x02, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
-
- // Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x00, // TTL (4 bytes) is 1 second;
- 0x00, 0x01,
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x05, 'h', 'e', 'l', 'l', 'o',
- 0xc0, 0x0c,
-
- // Answer 2
- 0x08, '_', 'p', 'r', 'i', 'n', 't', 'e', 'r',
- 0xc0, 0x14, // Pointer to "._tcp.local"
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 49 seconds.
- 0x24, 0x75,
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x05, 'h', 'e', 'l', 'l', 'o',
- 0xc0, 0x32
-};
-
-const uint8 kCorruptedPacketBadQuestion[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x01, // One question
- 0x00, 0x02, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
-
- // Question is corrupted and cannot be read.
- 0x99, 'h', 'e', 'l', 'l', 'o',
- 0x00,
- 0x00, 0x00,
- 0x00, 0x00,
-
- // Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x99, // RDLENGTH is impossible
- 0x05, 'h', 'e', 'l', 'l', 'o',
- 0xc0, 0x0c,
-
- // Answer 2
- 0x08, '_', 'p', 'r', // Useless trailing data.
-};
-
-const uint8 kCorruptedPacketUnsalvagable[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No questions (for simplicity)
- 0x00, 0x02, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
-
- // Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x99, // RDLENGTH is impossible
- 0x05, 'h', 'e', 'l', 'l', 'o',
- 0xc0, 0x0c,
-
- // Answer 2
- 0x08, '_', 'p', 'r', // Useless trailing data.
-};
-
-const uint8 kCorruptedPacketDoubleRecord[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No questions (for simplicity)
- 0x00, 0x02, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
-
- // Answer 1
- 0x06, 'p', 'r', 'i', 'v', 'e', 't',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x04, // RDLENGTH is 4
- 0x05, 0x03,
- 0xc0, 0x0c,
-
- // Answer 2 -- Same key
- 0x06, 'p', 'r', 'i', 'v', 'e', 't',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x04, // RDLENGTH is 4
- 0x02, 0x03,
- 0x04, 0x05,
-};
-
-const uint8 kCorruptedPacketSalvagable[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No questions (for simplicity)
- 0x00, 0x02, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
-
- // Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x99, 'h', 'e', 'l', 'l', 'o', // Bad RDATA format.
- 0xc0, 0x0c,
-
- // Answer 2
- 0x08, '_', 'p', 'r', 'i', 'n', 't', 'e', 'r',
- 0xc0, 0x14, // Pointer to "._tcp.local"
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 49 seconds.
- 0x24, 0x75,
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x05, 'h', 'e', 'l', 'l', 'o',
- 0xc0, 0x32
-};
-
-const uint8 kSamplePacket2[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No questions (for simplicity)
- 0x00, 0x02, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
-
- // Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x05, 'z', 'z', 'z', 'z', 'z',
- 0xc0, 0x0c,
-
- // Answer 2
- 0x08, '_', 'p', 'r', 'i', 'n', 't', 'e', 'r',
- 0xc0, 0x14, // Pointer to "._tcp.local"
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x05, 'z', 'z', 'z', 'z', 'z',
- 0xc0, 0x32
-};
-
-const uint8 kSamplePacket3[] = {
+const uint8_t kSamplePacket1[] = {
// Header
0x00, 0x00, // ID is zeroed out
0x81, 0x80, // Standard query response, RA, no error
@@ -240,159 +47,283 @@
0x00, 0x00, // 0 additional RRs
// Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', //
- 0x04, '_', 't', 'c', 'p', //
- 0x05, 'l', 'o', 'c', 'a', 'l', //
- 0x00, 0x00, 0x0c, // TYPE is PTR.
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x0c, // TYPE is PTR.
0x00, 0x01, // CLASS is IN.
0x00, 0x00, // TTL (4 bytes) is 1 second;
- 0x00, 0x01, //
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x05, 'h', 'e', 'l', 'l', 'o', //
- 0xc0, 0x0c, //
+ 0x00, 0x01, 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x05, 'h', 'e', 'l', 'l', 'o', 0xc0, 0x0c,
// Answer 2
- 0x08, '_', 'p', 'r', 'i', 'n', 't', 'e', 'r', //
- 0xc0, 0x14, // Pointer to "._tcp.local"
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x00, // TTL (4 bytes) is 3 seconds.
- 0x00, 0x03, //
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x05, 'h', 'e', 'l', 'l', 'o', //
+ 0x08, '_', 'p', 'r', 'i', 'n', 't', 'e', 'r', 0xc0,
+ 0x14, // Pointer to "._tcp.local"
+ 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 49 seconds.
+ 0x24, 0x75, 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x05, 'h', 'e', 'l', 'l', 'o', 0xc0, 0x32};
+
+const uint8_t kCorruptedPacketBadQuestion[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x01, // One question
+ 0x00, 0x02, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
+
+ // Question is corrupted and cannot be read.
+ 0x99, 'h', 'e', 'l', 'l', 'o', 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ // Answer 1
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x99, // RDLENGTH is impossible
+ 0x05, 'h', 'e', 'l', 'l', 'o', 0xc0, 0x0c,
+
+ // Answer 2
+ 0x08, '_', 'p', 'r', // Useless trailing data.
+};
+
+const uint8_t kCorruptedPacketUnsalvagable[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x02, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
+
+ // Answer 1
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x99, // RDLENGTH is impossible
+ 0x05, 'h', 'e', 'l', 'l', 'o', 0xc0, 0x0c,
+
+ // Answer 2
+ 0x08, '_', 'p', 'r', // Useless trailing data.
+};
+
+const uint8_t kCorruptedPacketDoubleRecord[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x02, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
+
+ // Answer 1
+ 0x06, 'p', 'r', 'i', 'v', 'e', 't', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00,
+ 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x04, // RDLENGTH is 4
+ 0x05, 0x03, 0xc0, 0x0c,
+
+ // Answer 2 -- Same key
+ 0x06, 'p', 'r', 'i', 'v', 'e', 't', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00,
+ 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x04, // RDLENGTH is 4
+ 0x02, 0x03, 0x04, 0x05,
+};
+
+const uint8_t kCorruptedPacketSalvagable[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x02, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
+
+ // Answer 1
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x99, 'h', 'e', 'l', 'l', 'o', // Bad RDATA format.
+ 0xc0, 0x0c,
+
+ // Answer 2
+ 0x08, '_', 'p', 'r', 'i', 'n', 't', 'e', 'r', 0xc0,
+ 0x14, // Pointer to "._tcp.local"
+ 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 49 seconds.
+ 0x24, 0x75, 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x05, 'h', 'e', 'l', 'l', 'o', 0xc0, 0x32};
+
+const uint8_t kSamplePacket2[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x02, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
+
+ // Answer 1
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x05, 'z', 'z', 'z', 'z', 'z', 0xc0, 0x0c,
+
+ // Answer 2
+ 0x08, '_', 'p', 'r', 'i', 'n', 't', 'e', 'r', 0xc0,
+ 0x14, // Pointer to "._tcp.local"
+ 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x05, 'z', 'z', 'z', 'z', 'z', 0xc0, 0x32};
+
+const uint8_t kSamplePacket3[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x02, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
+
+ // Answer 1
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', //
+ 0x04, '_', 't', 'c', 'p', //
+ 0x05, 'l', 'o', 'c', 'a', 'l', //
+ 0x00, 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x00, // TTL (4 bytes) is 1 second;
+ 0x00, 0x01, //
+ 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x05, 'h', 'e', 'l', 'l', 'o', //
+ 0xc0, 0x0c, //
+
+ // Answer 2
+ 0x08, '_', 'p', 'r', 'i', 'n', 't', 'e', 'r', //
+ 0xc0, 0x14, // Pointer to "._tcp.local"
+ 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x00, // TTL (4 bytes) is 3 seconds.
+ 0x00, 0x03, //
+ 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x05, 'h', 'e', 'l', 'l', 'o', //
0xc0, 0x32};
-const uint8 kQueryPacketPrivet[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x00, 0x00, // No flags.
- 0x00, 0x01, // One question.
- 0x00, 0x00, // 0 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
+const uint8_t kQueryPacketPrivet[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x00, 0x00, // No flags.
+ 0x00, 0x01, // One question.
+ 0x00, 0x00, // 0 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
- // Question
- // This part is echoed back from the respective query.
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
+ // Question
+ // This part is echoed back from the respective query.
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
};
-const uint8 kQueryPacketPrivetA[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x00, 0x00, // No flags.
- 0x00, 0x01, // One question.
- 0x00, 0x00, // 0 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
+const uint8_t kQueryPacketPrivetA[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x00, 0x00, // No flags.
+ 0x00, 0x01, // One question.
+ 0x00, 0x00, // 0 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
- // Question
- // This part is echoed back from the respective query.
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
+ // Question
+ // This part is echoed back from the respective query.
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
};
-const uint8 kSamplePacketAdditionalOnly[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No questions (for simplicity)
- 0x00, 0x00, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x01, // 0 additional RRs
+const uint8_t kSamplePacketAdditionalOnly[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x00, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x01, // 0 additional RRs
- // Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x05, 'h', 'e', 'l', 'l', 'o',
- 0xc0, 0x0c,
+ // Answer 1
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x05, 'h', 'e', 'l', 'l', 'o', 0xc0, 0x0c,
};
-const uint8 kSamplePacketNsec[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No questions (for simplicity)
- 0x00, 0x01, // 1 RR (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
+const uint8_t kSamplePacketNsec[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x01, // 1 RR (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
- // Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x2f, // TYPE is NSEC.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x06, // RDLENGTH is 6 bytes.
- 0xc0, 0x0c,
- 0x00, 0x02, 0x00, 0x08 // Only A record present
+ // Answer 1
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x2f, // TYPE is NSEC.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x06, // RDLENGTH is 6 bytes.
+ 0xc0, 0x0c, 0x00, 0x02, 0x00, 0x08 // Only A record present
};
-const uint8 kSamplePacketAPrivet[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No questions (for simplicity)
- 0x00, 0x01, // 1 RR (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
+const uint8_t kSamplePacketAPrivet[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x01, // 1 RR (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
- // Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x01, // TYPE is A.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x00, // TTL (4 bytes) is 5 seconds
- 0x00, 0x05,
- 0x00, 0x04, // RDLENGTH is 4 bytes.
- 0xc0, 0x0c,
- 0x00, 0x02,
+ // Answer 1
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x00, // TTL (4 bytes) is 5 seconds
+ 0x00, 0x05, 0x00, 0x04, // RDLENGTH is 4 bytes.
+ 0xc0, 0x0c, 0x00, 0x02,
};
-const uint8 kSamplePacketGoodbye[] = {
- // Header
- 0x00, 0x00, // ID is zeroed out
- 0x81, 0x80, // Standard query response, RA, no error
- 0x00, 0x00, // No questions (for simplicity)
- 0x00, 0x01, // 2 RRs (answers)
- 0x00, 0x00, // 0 authority RRs
- 0x00, 0x00, // 0 additional RRs
+const uint8_t kSamplePacketGoodbye[] = {
+ // Header
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x01, // 2 RRs (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
- // Answer 1
- 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
- 0x04, '_', 't', 'c', 'p',
- 0x05, 'l', 'o', 'c', 'a', 'l',
- 0x00,
- 0x00, 0x0c, // TYPE is PTR.
- 0x00, 0x01, // CLASS is IN.
- 0x00, 0x00, // TTL (4 bytes) is zero;
- 0x00, 0x00,
- 0x00, 0x08, // RDLENGTH is 8 bytes.
- 0x05, 'z', 'z', 'z', 'z', 'z',
- 0xc0, 0x0c,
+ // Answer 1
+ 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't', 0x04, '_', 't', 'c', 'p', 0x05,
+ 'l', 'o', 'c', 'a', 'l', 0x00, 0x00, 0x0c, // TYPE is PTR.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x00, // TTL (4 bytes) is zero;
+ 0x00, 0x00, 0x00, 0x08, // RDLENGTH is 8 bytes.
+ 0x05, 'z', 'z', 'z', 'z', 'z', 0xc0, 0x0c,
};
-std::string MakeString(const uint8* data, unsigned size) {
+std::string MakeString(const uint8_t* data, unsigned size) {
return std::string(reinterpret_cast<const char*>(data), size);
}
@@ -480,8 +411,8 @@
const RecordParsed* record));
protected:
- void ExpectPacket(const uint8* packet, unsigned size);
- void SimulatePacketReceive(const uint8* packet, unsigned size);
+ void ExpectPacket(const uint8_t* packet, unsigned size);
+ void SimulatePacketReceive(const uint8_t* packet, unsigned size);
scoped_ptr<MDnsClientImpl> test_client_;
IPEndPoint mdns_ipv4_endpoint_;
@@ -508,11 +439,11 @@
test_client_->StartListening(&socket_factory_);
}
-void MDnsTest::SimulatePacketReceive(const uint8* packet, unsigned size) {
+void MDnsTest::SimulatePacketReceive(const uint8_t* packet, unsigned size) {
socket_factory_.SimulateReceive(packet, size);
}
-void MDnsTest::ExpectPacket(const uint8* packet, unsigned size) {
+void MDnsTest::ExpectPacket(const uint8_t* packet, unsigned size) {
EXPECT_CALL(socket_factory_, OnSendTo(MakeString(packet, size)))
.Times(2);
}
diff --git a/net/dns/mock_host_resolver.h b/net/dns/mock_host_resolver.h
index 6920ae7..71f557e 100644
--- a/net/dns/mock_host_resolver.h
+++ b/net/dns/mock_host_resolver.h
@@ -5,9 +5,12 @@
#ifndef NET_DNS_MOCK_HOST_RESOLVER_H_
#define NET_DNS_MOCK_HOST_RESOLVER_H_
+#include <stddef.h>
+
#include <list>
#include <map>
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
diff --git a/net/dns/mock_mdns_socket_factory.cc b/net/dns/mock_mdns_socket_factory.cc
index 84359a4..354992b 100644
--- a/net/dns/mock_mdns_socket_factory.cc
+++ b/net/dns/mock_mdns_socket_factory.cc
@@ -89,7 +89,7 @@
sockets->push_back(new_socket.Pass());
}
-void MockMDnsSocketFactory::SimulateReceive(const uint8* packet, int size) {
+void MockMDnsSocketFactory::SimulateReceive(const uint8_t* packet, int size) {
DCHECK(recv_buffer_size_ >= size);
DCHECK(recv_buffer_.get());
DCHECK(!recv_callback_.is_null());
diff --git a/net/dns/mock_mdns_socket_factory.h b/net/dns/mock_mdns_socket_factory.h
index 9d9c682..a5b1422 100644
--- a/net/dns/mock_mdns_socket_factory.h
+++ b/net/dns/mock_mdns_socket_factory.h
@@ -5,6 +5,8 @@
#ifndef NET_DNS_MOCK_MDNS_SOCKET_FACTORY_H_
#define NET_DNS_MOCK_MDNS_SOCKET_FACTORY_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
@@ -37,8 +39,8 @@
const std::string address,
const CompletionCallback& callback));
- MOCK_METHOD1(SetReceiveBufferSize, int(int32 size));
- MOCK_METHOD1(SetSendBufferSize, int(int32 size));
+ MOCK_METHOD1(SetReceiveBufferSize, int(int32_t size));
+ MOCK_METHOD1(SetSendBufferSize, int(int32_t size));
MOCK_METHOD0(Close, void());
@@ -52,7 +54,7 @@
MOCK_CONST_METHOD1(JoinGroup, int(const IPAddressNumber& group_address));
MOCK_CONST_METHOD1(LeaveGroup, int(const IPAddressNumber& address));
- MOCK_METHOD1(SetMulticastInterface, int(uint32 interface_index));
+ MOCK_METHOD1(SetMulticastInterface, int(uint32_t interface_index));
MOCK_METHOD1(SetMulticastTimeToLive, int(int ttl));
MOCK_METHOD1(SetMulticastLoopbackMode, int(bool loopback));
@@ -81,7 +83,7 @@
void CreateSockets(
std::vector<scoped_ptr<DatagramServerSocket>>* sockets) override;
- void SimulateReceive(const uint8* packet, int size);
+ void SimulateReceive(const uint8_t* packet, int size);
MOCK_METHOD1(OnSendTo, void(const std::string&));
diff --git a/net/dns/mojo_host_resolver_impl.cc b/net/dns/mojo_host_resolver_impl.cc
index c39079c..ac2fe8bc 100644
--- a/net/dns/mojo_host_resolver_impl.cc
+++ b/net/dns/mojo_host_resolver_impl.cc
@@ -4,7 +4,6 @@
#include "net/dns/mojo_host_resolver_impl.h"
-#include "base/basictypes.h"
#include "base/stl_util.h"
#include "net/base/address_list.h"
#include "net/base/net_errors.h"
diff --git a/net/dns/notify_watcher_mac.h b/net/dns/notify_watcher_mac.h
index ded752c..5a873439 100644
--- a/net/dns/notify_watcher_mac.h
+++ b/net/dns/notify_watcher_mac.h
@@ -6,6 +6,7 @@
#define NET_DNS_NOTIFY_WATCHER_MAC_H_
#include "base/callback.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
namespace net {
diff --git a/net/dns/record_parsed.cc b/net/dns/record_parsed.cc
index 4ae6ed29..a5fcf19 100644
--- a/net/dns/record_parsed.cc
+++ b/net/dns/record_parsed.cc
@@ -10,12 +10,18 @@
namespace net {
-RecordParsed::RecordParsed(const std::string& name, uint16 type, uint16 klass,
- uint32 ttl, scoped_ptr<const RecordRdata> rdata,
+RecordParsed::RecordParsed(const std::string& name,
+ uint16_t type,
+ uint16_t klass,
+ uint32_t ttl,
+ scoped_ptr<const RecordRdata> rdata,
base::Time time_created)
- : name_(name), type_(type), klass_(klass), ttl_(ttl), rdata_(rdata.Pass()),
- time_created_(time_created) {
-}
+ : name_(name),
+ type_(type),
+ klass_(klass),
+ ttl_(ttl),
+ rdata_(rdata.Pass()),
+ time_created_(time_created) {}
RecordParsed::~RecordParsed() {
}
@@ -70,8 +76,8 @@
bool RecordParsed::IsEqual(const RecordParsed* other, bool is_mdns) const {
DCHECK(other);
- uint16 klass = klass_;
- uint16 other_klass = other->klass_;
+ uint16_t klass = klass_;
+ uint16_t other_klass = other->klass_;
if (is_mdns) {
klass &= dns_protocol::kMDnsClassMask;
diff --git a/net/dns/record_parsed.h b/net/dns/record_parsed.h
index 016c491..654574c 100644
--- a/net/dns/record_parsed.h
+++ b/net/dns/record_parsed.h
@@ -5,6 +5,8 @@
#ifndef NET_DNS_RECORD_PARSED_H_
#define NET_DNS_RECORD_PARSED_H_
+#include <stdint.h>
+
#include <string>
#include "base/memory/scoped_ptr.h"
@@ -27,9 +29,9 @@
base::Time time_created);
const std::string& name() const { return name_; }
- uint16 type() const { return type_; }
- uint16 klass() const { return klass_; }
- uint32 ttl() const { return ttl_; }
+ uint16_t type() const { return type_; }
+ uint16_t klass() const { return klass_; }
+ uint32_t ttl() const { return ttl_; }
base::Time time_created() const { return time_created_; }
@@ -45,14 +47,17 @@
bool IsEqual(const RecordParsed* other, bool is_mdns) const;
private:
- RecordParsed(const std::string& name, uint16 type, uint16 klass,
- uint32 ttl, scoped_ptr<const RecordRdata> rdata,
+ RecordParsed(const std::string& name,
+ uint16_t type,
+ uint16_t klass,
+ uint32_t ttl,
+ scoped_ptr<const RecordRdata> rdata,
base::Time time_created);
std::string name_; // in dotted form
- const uint16 type_;
- const uint16 klass_;
- const uint32 ttl_;
+ const uint16_t type_;
+ const uint16_t klass_;
+ const uint32_t ttl_;
const scoped_ptr<const RecordRdata> rdata_;
diff --git a/net/dns/record_parsed_unittest.cc b/net/dns/record_parsed_unittest.cc
index 2864dcb..cfaac31 100644
--- a/net/dns/record_parsed_unittest.cc
+++ b/net/dns/record_parsed_unittest.cc
@@ -12,23 +12,16 @@
namespace net {
-static const uint8 kT1ResponseWithCacheFlushBit[] = {
- 0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w',
- 0x08, 'c', 'h', 'r', 'o', 'm', 'i', 'u', 'm',
- 0x03, 'o', 'r', 'g',
- 0x00,
- 0x00, 0x05, // TYPE is CNAME.
- 0x80, 0x01, // CLASS is IN with cache flush bit set.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x12, // RDLENGTH is 18 bytes.
- // ghs.l.google.com in DNS format.
- 0x03, 'g', 'h', 's',
- 0x01, 'l',
- 0x06, 'g', 'o', 'o', 'g', 'l', 'e',
- 0x03, 'c', 'o', 'm',
- 0x00
-};
+static const uint8_t kT1ResponseWithCacheFlushBit[] = {
+ 0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w', 0x08, 'c', 'h', 'r',
+ 'o', 'm', 'i', 'u', 'm', 0x03, 'o', 'r', 'g', 0x00, 0x00,
+ 0x05, // TYPE is CNAME.
+ 0x80, 0x01, // CLASS is IN with cache flush bit set.
+ 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
+ 0x24, 0x74, 0x00, 0x12, // RDLENGTH is 18 bytes.
+ // ghs.l.google.com in DNS format.
+ 0x03, 'g', 'h', 's', 0x01, 'l', 0x06, 'g', 'o', 'o', 'g', 'l', 'e', 0x03,
+ 'c', 'o', 'm', 0x00};
TEST(RecordParsedTest, ParseSingleRecord) {
DnsRecordParser parser(kT1ResponseDatagram, sizeof(kT1ResponseDatagram),
diff --git a/net/dns/record_rdata.cc b/net/dns/record_rdata.cc
index 4503b68..fbe7c65 100644
--- a/net/dns/record_rdata.cc
+++ b/net/dns/record_rdata.cc
@@ -42,7 +42,7 @@
return rdata.Pass();
}
-uint16 SrvRecordRdata::Type() const {
+uint16_t SrvRecordRdata::Type() const {
return SrvRecordRdata::kType;
}
@@ -78,7 +78,7 @@
return rdata.Pass();
}
-uint16 ARecordRdata::Type() const {
+uint16_t ARecordRdata::Type() const {
return ARecordRdata::kType;
}
@@ -111,7 +111,7 @@
return rdata.Pass();
}
-uint16 AAAARecordRdata::Type() const {
+uint16_t AAAARecordRdata::Type() const {
return AAAARecordRdata::kType;
}
@@ -139,7 +139,7 @@
return rdata.Pass();
}
-uint16 CnameRecordRdata::Type() const {
+uint16_t CnameRecordRdata::Type() const {
return CnameRecordRdata::kType;
}
@@ -168,7 +168,7 @@
return rdata.Pass();
}
-uint16 PtrRecordRdata::Type() const {
+uint16_t PtrRecordRdata::Type() const {
return PtrRecordRdata::kType;
}
@@ -191,7 +191,7 @@
scoped_ptr<TxtRecordRdata> rdata(new TxtRecordRdata);
for (size_t i = 0; i < data.size(); ) {
- uint8 length = data[i];
+ uint8_t length = data[i];
if (i + length >= data.size())
return scoped_ptr<TxtRecordRdata>();
@@ -205,7 +205,7 @@
return rdata.Pass();
}
-uint16 TxtRecordRdata::Type() const {
+uint16_t TxtRecordRdata::Type() const {
return TxtRecordRdata::kType;
}
@@ -237,8 +237,8 @@
return scoped_ptr<NsecRecordRdata>();
struct BitmapHeader {
- uint8 block_number; // The block number should be zero.
- uint8 length; // Bitmap length in bytes. Between 1 and 32.
+ uint8_t block_number; // The block number should be zero.
+ uint8_t length; // Bitmap length in bytes. Between 1 and 32.
};
const BitmapHeader* header = reinterpret_cast<const BitmapHeader*>(
@@ -263,7 +263,7 @@
return rdata.Pass();
}
-uint16 NsecRecordRdata::Type() const {
+uint16_t NsecRecordRdata::Type() const {
return NsecRecordRdata::kType;
}
diff --git a/net/dns/record_rdata.h b/net/dns/record_rdata.h
index a94d628f..8184edd 100644
--- a/net/dns/record_rdata.h
+++ b/net/dns/record_rdata.h
@@ -5,11 +5,13 @@
#ifndef NET_DNS_RECORD_RDATA_H_
#define NET_DNS_RECORD_RDATA_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/ip_address_number.h"
@@ -27,7 +29,7 @@
virtual ~RecordRdata() {}
virtual bool IsEqual(const RecordRdata* other) const = 0;
- virtual uint16 Type() const = 0;
+ virtual uint16_t Type() const = 0;
protected:
RecordRdata();
@@ -42,27 +44,27 @@
// target: domain name (on-the-wire representation)
class NET_EXPORT_PRIVATE SrvRecordRdata : public RecordRdata {
public:
- static const uint16 kType = dns_protocol::kTypeSRV;
+ static const uint16_t kType = dns_protocol::kTypeSRV;
~SrvRecordRdata() override;
static scoped_ptr<SrvRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
bool IsEqual(const RecordRdata* other) const override;
- uint16 Type() const override;
+ uint16_t Type() const override;
- uint16 priority() const { return priority_; }
- uint16 weight() const { return weight_; }
- uint16 port() const { return port_; }
+ uint16_t priority() const { return priority_; }
+ uint16_t weight() const { return weight_; }
+ uint16_t port() const { return port_; }
const std::string& target() const { return target_; }
private:
SrvRecordRdata();
- uint16 priority_;
- uint16 weight_;
- uint16 port_;
+ uint16_t priority_;
+ uint16_t weight_;
+ uint16_t port_;
std::string target_;
@@ -73,13 +75,13 @@
// 4 bytes for IP address.
class NET_EXPORT_PRIVATE ARecordRdata : public RecordRdata {
public:
- static const uint16 kType = dns_protocol::kTypeA;
+ static const uint16_t kType = dns_protocol::kTypeA;
~ARecordRdata() override;
static scoped_ptr<ARecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
bool IsEqual(const RecordRdata* other) const override;
- uint16 Type() const override;
+ uint16_t Type() const override;
const IPAddressNumber& address() const { return address_; }
@@ -95,13 +97,13 @@
// 16 bytes for IP address.
class NET_EXPORT_PRIVATE AAAARecordRdata : public RecordRdata {
public:
- static const uint16 kType = dns_protocol::kTypeAAAA;
+ static const uint16_t kType = dns_protocol::kTypeAAAA;
~AAAARecordRdata() override;
static scoped_ptr<AAAARecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
bool IsEqual(const RecordRdata* other) const override;
- uint16 Type() const override;
+ uint16_t Type() const override;
const IPAddressNumber& address() const { return address_; }
@@ -117,13 +119,13 @@
// cname: On the wire representation of domain name.
class NET_EXPORT_PRIVATE CnameRecordRdata : public RecordRdata {
public:
- static const uint16 kType = dns_protocol::kTypeCNAME;
+ static const uint16_t kType = dns_protocol::kTypeCNAME;
~CnameRecordRdata() override;
static scoped_ptr<CnameRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
bool IsEqual(const RecordRdata* other) const override;
- uint16 Type() const override;
+ uint16_t Type() const override;
std::string cname() const { return cname_; }
@@ -139,13 +141,13 @@
// domain: On the wire representation of domain name.
class NET_EXPORT_PRIVATE PtrRecordRdata : public RecordRdata {
public:
- static const uint16 kType = dns_protocol::kTypePTR;
+ static const uint16_t kType = dns_protocol::kTypePTR;
~PtrRecordRdata() override;
static scoped_ptr<PtrRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
bool IsEqual(const RecordRdata* other) const override;
- uint16 Type() const override;
+ uint16_t Type() const override;
std::string ptrdomain() const { return ptrdomain_; }
@@ -162,13 +164,13 @@
// a <character-string> is a length octet followed by as many characters.
class NET_EXPORT_PRIVATE TxtRecordRdata : public RecordRdata {
public:
- static const uint16 kType = dns_protocol::kTypeTXT;
+ static const uint16_t kType = dns_protocol::kTypeTXT;
~TxtRecordRdata() override;
static scoped_ptr<TxtRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
bool IsEqual(const RecordRdata* other) const override;
- uint16 Type() const override;
+ uint16_t Type() const override;
const std::vector<std::string>& texts() const { return texts_; }
@@ -186,13 +188,13 @@
// http://www.rfc-editor.org/rfc/rfc6762.txt Section 6.1.
class NET_EXPORT_PRIVATE NsecRecordRdata : public RecordRdata {
public:
- static const uint16 kType = dns_protocol::kTypeNSEC;
+ static const uint16_t kType = dns_protocol::kTypeNSEC;
~NsecRecordRdata() override;
static scoped_ptr<NsecRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
bool IsEqual(const RecordRdata* other) const override;
- uint16 Type() const override;
+ uint16_t Type() const override;
// Length of the bitmap in bits.
unsigned bitmap_length() const { return bitmap_.size() * 8; }
@@ -205,7 +207,7 @@
private:
NsecRecordRdata();
- std::vector<uint8> bitmap_;
+ std::vector<uint8_t> bitmap_;
DISALLOW_COPY_AND_ASSIGN(NsecRecordRdata);
};
diff --git a/net/dns/record_rdata_unittest.cc b/net/dns/record_rdata_unittest.cc
index d5306d80..d83f497c 100644
--- a/net/dns/record_rdata_unittest.cc
+++ b/net/dns/record_rdata_unittest.cc
@@ -11,7 +11,7 @@
namespace net {
-base::StringPiece MakeStringPiece(const uint8* data, unsigned size) {
+base::StringPiece MakeStringPiece(const uint8_t* data, unsigned size) {
const char* data_cc = reinterpret_cast<const char*>(data);
return base::StringPiece(data_cc, size);
}
@@ -23,20 +23,15 @@
// These are just the rdata portions of the DNS records, rather than complete
// records, but it works well enough for this test.
- const uint8 record[] = {
- 0x00, 0x01,
- 0x00, 0x02,
- 0x00, 0x50,
- 0x03, 'w', 'w', 'w',
- 0x06, 'g', 'o', 'o', 'g', 'l', 'e',
- 0x03, 'c', 'o', 'm',
- 0x00,
- 0x01, 0x01,
- 0x01, 0x02,
- 0x01, 0x03,
- 0x04, 'w', 'w', 'w', '2',
- 0xc0, 0x0a, // Pointer to "google.com"
- };
+ const uint8_t
+ record[] =
+ {
+ 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x03, 'w', 'w',
+ 'w', 0x06, 'g', 'o', 'o', 'g', 'l', 'e', 0x03,
+ 'c', 'o', 'm', 0x00, 0x01, 0x01, 0x01, 0x02, 0x01,
+ 0x03, 0x04, 'w', 'w', 'w', '2', 0xc0, 0x0a, // Pointer to
+ // "google.com"
+ };
DnsRecordParser parser(record, sizeof(record), 0);
const unsigned first_record_len = 22;
@@ -71,8 +66,8 @@
// These are just the rdata portions of the DNS records, rather than complete
// records, but it works well enough for this test.
- const uint8 record[] = {
- 0x7F, 0x00, 0x00, 0x01 // 127.0.0.1
+ const uint8_t record[] = {
+ 0x7F, 0x00, 0x00, 0x01 // 127.0.0.1
};
DnsRecordParser parser(record, sizeof(record), 0);
@@ -92,11 +87,9 @@
// These are just the rdata portions of the DNS records, rather than complete
// records, but it works well enough for this test.
- const uint8 record[] = {
- 0x12, 0x34, 0x56, 0x78,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x09 // 1234:5678::9A
+ const uint8_t record[] = {
+ 0x12, 0x34, 0x56, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09 // 1234:5678::9A
};
DnsRecordParser parser(record, sizeof(record), 0);
@@ -117,12 +110,8 @@
// These are just the rdata portions of the DNS records, rather than complete
// records, but it works well enough for this test.
- const uint8 record[] = {
- 0x03, 'w', 'w', 'w',
- 0x06, 'g', 'o', 'o', 'g', 'l', 'e',
- 0x03, 'c', 'o', 'm',
- 0x00
- };
+ const uint8_t record[] = {0x03, 'w', 'w', 'w', 0x06, 'g', 'o', 'o',
+ 'g', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00};
DnsRecordParser parser(record, sizeof(record), 0);
base::StringPiece record_strpiece = MakeStringPiece(record, sizeof(record));
@@ -141,12 +130,8 @@
// These are just the rdata portions of the DNS records, rather than complete
// records, but it works well enough for this test.
- const uint8 record[] = {
- 0x03, 'w', 'w', 'w',
- 0x06, 'g', 'o', 'o', 'g', 'l', 'e',
- 0x03, 'c', 'o', 'm',
- 0x00
- };
+ const uint8_t record[] = {0x03, 'w', 'w', 'w', 0x06, 'g', 'o', 'o',
+ 'g', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00};
DnsRecordParser parser(record, sizeof(record), 0);
base::StringPiece record_strpiece = MakeStringPiece(record, sizeof(record));
@@ -165,11 +150,8 @@
// These are just the rdata portions of the DNS records, rather than complete
// records, but it works well enough for this test.
- const uint8 record[] = {
- 0x03, 'w', 'w', 'w',
- 0x06, 'g', 'o', 'o', 'g', 'l', 'e',
- 0x03, 'c', 'o', 'm'
- };
+ const uint8_t record[] = {0x03, 'w', 'w', 'w', 0x06, 'g', 'o', 'o',
+ 'g', 'l', 'e', 0x03, 'c', 'o', 'm'};
DnsRecordParser parser(record, sizeof(record), 0);
base::StringPiece record_strpiece = MakeStringPiece(record, sizeof(record));
@@ -193,13 +175,9 @@
// These are just the rdata portions of the DNS records, rather than complete
// records, but it works well enough for this test.
- const uint8 record[] = {
- 0x03, 'w', 'w', 'w',
- 0x06, 'g', 'o', 'o', 'g', 'l', 'e',
- 0x03, 'c', 'o', 'm',
- 0x00,
- 0x00, 0x02, 0x40, 0x01
- };
+ const uint8_t record[] = {0x03, 'w', 'w', 'w', 0x06, 'g', 'o',
+ 'o', 'g', 'l', 'e', 0x03, 'c', 'o',
+ 'm', 0x00, 0x00, 0x02, 0x40, 0x01};
DnsRecordParser parser(record, sizeof(record), 0);
base::StringPiece record_strpiece = MakeStringPiece(record, sizeof(record));
diff --git a/net/dns/serial_worker.h b/net/dns/serial_worker.h
index f63178a..c48a61b 100644
--- a/net/dns/serial_worker.h
+++ b/net/dns/serial_worker.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
diff --git a/net/dns/single_request_host_resolver.h b/net/dns/single_request_host_resolver.h
index 3c8ef02..f2843093 100644
--- a/net/dns/single_request_host_resolver.h
+++ b/net/dns/single_request_host_resolver.h
@@ -5,8 +5,7 @@
#ifndef NET_DNS_SINGLE_REQUEST_HOST_RESOLVER_H_
#define NET_DNS_SINGLE_REQUEST_HOST_RESOLVER_H_
-#include "base/basictypes.h"
-
+#include "base/macros.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
#include "net/base/request_priority.h"
diff --git a/net/dns/single_request_host_resolver_unittest.cc b/net/dns/single_request_host_resolver_unittest.cc
index 8bd285f..c5bb9f1a 100644
--- a/net/dns/single_request_host_resolver_unittest.cc
+++ b/net/dns/single_request_host_resolver_unittest.cc
@@ -4,6 +4,7 @@
#include "net/dns/single_request_host_resolver.h"
+#include "base/macros.h"
#include "net/base/address_list.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
diff --git a/net/extras/sqlite/sqlite_channel_id_store.cc b/net/extras/sqlite/sqlite_channel_id_store.cc
index 50e2291..5001494 100644
--- a/net/extras/sqlite/sqlite_channel_id_store.cc
+++ b/net/extras/sqlite/sqlite_channel_id_store.cc
@@ -7,12 +7,12 @@
#include <set>
#include <vector>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/sequenced_task_runner.h"
@@ -175,7 +175,7 @@
if (!base::PathExists(dir) && !base::CreateDirectory(dir))
return;
- int64 db_size = 0;
+ int64_t db_size = 0;
if (base::GetFileSize(path_, &db_size))
UMA_HISTOGRAM_COUNTS("DomainBoundCerts.DBSizeInKB", db_size / 1024);
@@ -218,7 +218,7 @@
}
while (smt.Step()) {
- std::vector<uint8> private_key_from_db, public_key_from_db;
+ std::vector<uint8_t> private_key_from_db, public_key_from_db;
smt.ColumnBlobAsVector(1, &private_key_from_db);
smt.ColumnBlobAsVector(2, &public_key_from_db);
scoped_ptr<crypto::ECPrivateKey> key(
@@ -493,7 +493,7 @@
case PendingOperation::CHANNEL_ID_ADD: {
add_statement.Reset(true);
add_statement.BindString(0, po->channel_id().server_identifier());
- std::vector<uint8> private_key, public_key;
+ std::vector<uint8_t> private_key, public_key;
if (!po->channel_id().key()->ExportEncryptedPrivateKey(
ChannelIDService::kEPKIPassword, 1, &private_key))
continue;
diff --git a/net/extras/sqlite/sqlite_channel_id_store_unittest.cc b/net/extras/sqlite/sqlite_channel_id_store_unittest.cc
index 7fa51ed..2b5e80a 100644
--- a/net/extras/sqlite/sqlite_channel_id_store_unittest.cc
+++ b/net/extras/sqlite/sqlite_channel_id_store_unittest.cc
@@ -58,11 +58,11 @@
GetTestCertsDirectory().AppendASCII("unittest.originbound.der");
ASSERT_TRUE(base::ReadFileToString(key_path, key_data));
ASSERT_TRUE(base::ReadFileToString(cert_path, cert_data));
- std::vector<uint8> private_key(key_data->size());
+ std::vector<uint8_t> private_key(key_data->size());
memcpy(private_key.data(), key_data->data(), key_data->size());
base::StringPiece spki;
ASSERT_TRUE(asn1::ExtractSPKIFromDERCert(*cert_data, &spki));
- std::vector<uint8> public_key(spki.size());
+ std::vector<uint8_t> public_key(spki.size());
memcpy(public_key.data(), spki.data(), spki.size());
key->reset(crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
ChannelIDService::kEPKIPassword, private_key, public_key));
diff --git a/net/extras/sqlite/sqlite_persistent_cookie_store.cc b/net/extras/sqlite/sqlite_persistent_cookie_store.cc
index cfe5922..6f46d4f 100644
--- a/net/extras/sqlite/sqlite_persistent_cookie_store.cc
+++ b/net/extras/sqlite/sqlite_persistent_cookie_store.cc
@@ -7,13 +7,13 @@
#include <map>
#include <set>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_macros.h"
@@ -598,7 +598,7 @@
return false;
}
- int64 db_size = 0;
+ int64_t db_size = 0;
if (base::GetFileSize(path_, &db_size))
UMA_HISTOGRAM_COUNTS("Cookie.DBSizeInKB", db_size / 1024);
diff --git a/net/extras/sqlite/sqlite_persistent_cookie_store.h b/net/extras/sqlite/sqlite_persistent_cookie_store.h
index c55ef6d..b8c1caad 100644
--- a/net/extras/sqlite/sqlite_persistent_cookie_store.h
+++ b/net/extras/sqlite/sqlite_persistent_cookie_store.h
@@ -11,6 +11,7 @@
#include <vector>
#include "base/callback_forward.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/cookies/cookie_monster.h"
diff --git a/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc b/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
index 92965ee..2166be02 100644
--- a/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
+++ b/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
@@ -419,7 +419,7 @@
base::FilePath path = temp_dir_.path().Append(kCookieFilename);
base::File::Info info;
ASSERT_TRUE(base::GetFileInfo(path, &info));
- int64 base_size = info.size;
+ int64_t base_size = info.size;
// Write some large cookies, so the DB will have to expand by several KB.
for (char c = 'a'; c < 'z'; ++c) {
diff --git a/net/filter/filter.h b/net/filter/filter.h
index 1904a8cd..6e111e18 100644
--- a/net/filter/filter.h
+++ b/net/filter/filter.h
@@ -46,11 +46,13 @@
#ifndef NET_FILTER_FILTER_H__
#define NET_FILTER_FILTER_H__
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
@@ -113,7 +115,7 @@
// How many bytes were read from the net or cache so far (and potentially
// pushed into a filter for processing)?
- virtual int64 GetByteReadCount() const = 0;
+ virtual int64_t GetByteReadCount() const = 0;
// What response code was received with the associated network transaction?
// For example: 200 is ok. 4xx are error codes. etc.
diff --git a/net/filter/filter_unittest.cc b/net/filter/filter_unittest.cc
index d0441fab..c44f23b 100644
--- a/net/filter/filter_unittest.cc
+++ b/net/filter/filter_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/macros.h"
#include "net/base/io_buffer.h"
#include "net/filter/filter.h"
#include "net/filter/mock_filter_context.h"
diff --git a/net/filter/gzip_filter.h b/net/filter/gzip_filter.h
index 2306c9b..67330d73 100644
--- a/net/filter/gzip_filter.h
+++ b/net/filter/gzip_filter.h
@@ -15,7 +15,7 @@
#ifndef NET_FILTER_GZIP_FILTER_H_
#define NET_FILTER_GZIP_FILTER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/filter/filter.h"
diff --git a/net/filter/gzip_header.cc b/net/filter/gzip_header.cc
index f4aca6b..36a1c866 100644
--- a/net/filter/gzip_header.cc
+++ b/net/filter/gzip_header.cc
@@ -11,7 +11,7 @@
namespace net {
-const uint8 GZipHeader::magic[] = { 0x1f, 0x8b };
+const uint8_t GZipHeader::magic[] = {0x1f, 0x8b};
GZipHeader::GZipHeader() {
Reset();
@@ -29,8 +29,8 @@
GZipHeader::Status GZipHeader::ReadMore(const char* inbuf, int inbuf_len,
const char** header_end) {
DCHECK_GE(inbuf_len, 0);
- const uint8* pos = reinterpret_cast<const uint8*>(inbuf);
- const uint8* const end = pos + inbuf_len;
+ const uint8_t* pos = reinterpret_cast<const uint8_t*>(inbuf);
+ const uint8_t* const end = pos + inbuf_len;
while ( pos < end ) {
switch ( state_ ) {
@@ -105,9 +105,8 @@
case IN_FEXTRA: {
// Grab the rest of the bytes in the extra field, or as many
// of them as are actually present so far.
- const uint16 num_extra_bytes = static_cast<uint16>(std::min(
- static_cast<ptrdiff_t>(extra_length_),
- (end - pos)));
+ const uint16_t num_extra_bytes = static_cast<uint16_t>(
+ std::min(static_cast<ptrdiff_t>(extra_length_), (end - pos)));
pos += num_extra_bytes;
extra_length_ -= num_extra_bytes;
if ( extra_length_ == 0 ) {
@@ -123,7 +122,7 @@
break;
}
// See if we can find the end of the \0-terminated FNAME field.
- pos = reinterpret_cast<const uint8*>(memchr(pos, '\0', (end - pos)));
+ pos = reinterpret_cast<const uint8_t*>(memchr(pos, '\0', (end - pos)));
if ( pos != NULL ) {
pos++; // advance past the '\0'
flags_ &= ~FLAG_FNAME; // we're done with the FNAME stuff
@@ -139,7 +138,7 @@
break;
}
// See if we can find the end of the \0-terminated FCOMMENT field.
- pos = reinterpret_cast<const uint8*>(memchr(pos, '\0', (end - pos)));
+ pos = reinterpret_cast<const uint8_t*>(memchr(pos, '\0', (end - pos)));
if ( pos != NULL ) {
pos++; // advance past the '\0'
flags_ &= ~FLAG_FCOMMENT; // we're done with the FCOMMENT stuff
diff --git a/net/filter/gzip_header.h b/net/filter/gzip_header.h
index 986afc4..91d69552 100644
--- a/net/filter/gzip_header.h
+++ b/net/filter/gzip_header.h
@@ -15,7 +15,9 @@
#ifndef NET_FILTER_GZIP_HEADER_H_
#define NET_FILTER_GZIP_HEADER_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
namespace net {
@@ -80,11 +82,11 @@
IN_DONE,
};
- static const uint8 magic[]; // gzip magic header
+ static const uint8_t magic[]; // gzip magic header
int state_; // our current State in the parsing FSM: an int so we can ++
- uint8 flags_; // the flags byte of the header ("FLG" in the RFC)
- uint16 extra_length_; // how much of the "extra field" we have yet to read
+ uint8_t flags_; // the flags byte of the header ("FLG" in the RFC)
+ uint16_t extra_length_; // how much of the "extra field" we have yet to read
DISALLOW_COPY_AND_ASSIGN(GZipHeader);
};
diff --git a/net/filter/mock_filter_context.cc b/net/filter/mock_filter_context.cc
index ebcaa18..2165aa05 100644
--- a/net/filter/mock_filter_context.cc
+++ b/net/filter/mock_filter_context.cc
@@ -48,7 +48,9 @@
return dictionaries_handle_.get();
}
-int64 MockFilterContext::GetByteReadCount() const { return 0; }
+int64_t MockFilterContext::GetByteReadCount() const {
+ return 0;
+}
int MockFilterContext::GetResponseCode() const { return response_code_; }
diff --git a/net/filter/mock_filter_context.h b/net/filter/mock_filter_context.h
index 33d41a6..6646cfd 100644
--- a/net/filter/mock_filter_context.h
+++ b/net/filter/mock_filter_context.h
@@ -5,8 +5,11 @@
#ifndef NET_FILTER_MOCK_FILTER_CONTEXT_H_
#define NET_FILTER_MOCK_FILTER_CONTEXT_H_
+#include <stdint.h>
+
#include <string>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/sdch_manager.h"
#include "net/filter/filter.h"
@@ -55,7 +58,7 @@
SdchManager::DictionarySet* SdchDictionariesAdvertised() const override;
// How many bytes were fed to filter(s) so far?
- int64 GetByteReadCount() const override;
+ int64_t GetByteReadCount() const override;
int GetResponseCode() const override;
diff --git a/net/filter/sdch_filter.h b/net/filter/sdch_filter.h
index 43125e8..83e29c5 100644
--- a/net/filter/sdch_filter.h
+++ b/net/filter/sdch_filter.h
@@ -14,8 +14,11 @@
#ifndef NET_FILTER_SDCH_FILTER_H_
#define NET_FILTER_SDCH_FILTER_H_
+#include <stddef.h>
+
#include <string>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/base/sdch_dictionary.h"
diff --git a/net/filter/sdch_filter_unittest.cc b/net/filter/sdch_filter_unittest.cc
index 35276cb..35c7ecc3 100644
--- a/net/filter/sdch_filter_unittest.cc
+++ b/net/filter/sdch_filter_unittest.cc
@@ -9,6 +9,7 @@
#include <vector>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/test/histogram_tester.h"
#include "base/test/simple_test_clock.h"
diff --git a/net/ftp/ftp_auth_cache.h b/net/ftp/ftp_auth_cache.h
index 526b358..e7f3057 100644
--- a/net/ftp/ftp_auth_cache.h
+++ b/net/ftp/ftp_auth_cache.h
@@ -5,6 +5,8 @@
#ifndef NET_FTP_FTP_AUTH_CACHE_H_
#define NET_FTP_FTP_AUTH_CACHE_H_
+#include <stddef.h>
+
#include <list>
#include "net/base/auth.h"
diff --git a/net/ftp/ftp_ctrl_response_buffer.h b/net/ftp/ftp_ctrl_response_buffer.h
index 92aaf53..ae90fea5 100644
--- a/net/ftp/ftp_ctrl_response_buffer.h
+++ b/net/ftp/ftp_ctrl_response_buffer.h
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
#ifndef NET_FTP_FTP_CTRL_RESPONSE_BUFFER_H_
#define NET_FTP_FTP_CTRL_RESPONSE_BUFFER_H_
@@ -10,7 +9,7 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/log/net_log.h"
diff --git a/net/ftp/ftp_directory_listing_parser.h b/net/ftp/ftp_directory_listing_parser.h
index d2dd677b..bcf9a7c0 100644
--- a/net/ftp/ftp_directory_listing_parser.h
+++ b/net/ftp/ftp_directory_listing_parser.h
@@ -5,10 +5,11 @@
#ifndef NET_FTP_FTP_DIRECTORY_LISTING_PARSER_H_
#define NET_FTP_FTP_DIRECTORY_LISTING_PARSER_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
@@ -28,7 +29,7 @@
Type type;
base::string16 name; // Name (UTF-16-encoded).
std::string raw_name; // Name in original character encoding.
- int64 size; // File size, in bytes. -1 if not applicable.
+ int64_t size; // File size, in bytes. -1 if not applicable.
// Last modified time, in local time zone.
base::Time last_modified;
diff --git a/net/ftp/ftp_directory_listing_parser_ls.cc b/net/ftp/ftp_directory_listing_parser_ls.cc
index b259cad0..9d1b711 100644
--- a/net/ftp/ftp_directory_listing_parser_ls.cc
+++ b/net/ftp/ftp_directory_listing_parser_ls.cc
@@ -145,7 +145,7 @@
// Some FTP servers incorrectly return a negative integer for "n". Since
// this value is ignored anyway, just check any valid integer was
// provided.
- int64 total_number;
+ int64_t total_number;
if (!base::StringToInt64(columns[1], &total_number))
return false;
diff --git a/net/ftp/ftp_directory_listing_parser_unittest.cc b/net/ftp/ftp_directory_listing_parser_unittest.cc
index 08abf17..5c98c23f6 100644
--- a/net/ftp/ftp_directory_listing_parser_unittest.cc
+++ b/net/ftp/ftp_directory_listing_parser_unittest.cc
@@ -81,7 +81,7 @@
for (size_t i = 0; i < lines.size() / 9; i++) {
std::string type(lines[9 * i]);
std::string name(lines[9 * i + 1]);
- int64 size;
+ int64_t size;
base::StringToInt64(lines[9 * i + 2], &size);
SCOPED_TRACE(base::StringPrintf("Filename: %s", name.c_str()));
diff --git a/net/ftp/ftp_directory_listing_parser_unittest.h b/net/ftp/ftp_directory_listing_parser_unittest.h
index 22c2cf9..3cbe17ad 100644
--- a/net/ftp/ftp_directory_listing_parser_unittest.h
+++ b/net/ftp/ftp_directory_listing_parser_unittest.h
@@ -5,6 +5,8 @@
#ifndef NET_FTP_FTP_DIRECTORY_LISTING_PARSER_UNITTEST_H_
#define NET_FTP_FTP_DIRECTORY_LISTING_PARSER_UNITTEST_H_
+#include <stdint.h>
+
#include <vector>
#include "base/strings/utf_string_conversions.h"
@@ -19,7 +21,7 @@
const char* input;
FtpDirectoryListingEntry::Type type;
const char* filename;
- int64 size;
+ int64_t size;
int year;
int month;
int day_of_month;
diff --git a/net/ftp/ftp_directory_listing_parser_vms.cc b/net/ftp/ftp_directory_listing_parser_vms.cc
index 2874548..e05f2c7 100644
--- a/net/ftp/ftp_directory_listing_parser_vms.cc
+++ b/net/ftp/ftp_directory_listing_parser_vms.cc
@@ -55,7 +55,7 @@
return true;
}
-bool ParseVmsFilesize(const base::string16& input, int64* size) {
+bool ParseVmsFilesize(const base::string16& input, int64_t* size) {
if (base::ContainsOnlyChars(input, base::ASCIIToUTF16("*"))) {
// Response consisting of asterisks means unknown size.
*size = -1;
@@ -80,7 +80,7 @@
if (parts.size() != 2)
return false;
- int64 blocks_used, blocks_allocated;
+ int64_t blocks_used, blocks_allocated;
if (!base::StringToInt64(parts[0], &blocks_used))
return false;
if (!base::StringToInt64(parts[1], &blocks_allocated))
diff --git a/net/ftp/ftp_network_layer.h b/net/ftp/ftp_network_layer.h
index e22ec49..d848ae8 100644
--- a/net/ftp/ftp_network_layer.h
+++ b/net/ftp/ftp_network_layer.h
@@ -5,8 +5,8 @@
#ifndef NET_FTP_FTP_NETWORK_LAYER_H_
#define NET_FTP_FTP_NETWORK_LAYER_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/ftp/ftp_transaction_factory.h"
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index 806f014..a197a87 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -319,7 +319,7 @@
return LOAD_STATE_IDLE;
}
-uint64 FtpNetworkTransaction::GetUploadProgress() const {
+uint64_t FtpNetworkTransaction::GetUploadProgress() const {
return 0;
}
@@ -961,7 +961,7 @@
!IsPortAllowedForScheme(port, url::kFtpScheme)) {
return Stop(ERR_UNSAFE_PORT);
}
- data_connection_port_ = static_cast<uint16>(port);
+ data_connection_port_ = static_cast<uint16_t>(port);
next_state_ = STATE_DATA_CONNECT;
break;
}
@@ -999,7 +999,7 @@
!IsPortAllowedForScheme(port, url::kFtpScheme)) {
return Stop(ERR_UNSAFE_PORT);
}
- data_connection_port_ = static_cast<uint16>(port);
+ data_connection_port_ = static_cast<uint16_t>(port);
next_state_ = STATE_DATA_CONNECT;
break;
}
@@ -1068,7 +1068,7 @@
case ERROR_CLASS_OK:
if (response.lines.size() != 1)
return Stop(ERR_INVALID_RESPONSE);
- int64 size;
+ int64_t size;
if (!base::StringToInt64(response.lines[0], &size))
return Stop(ERR_INVALID_RESPONSE);
if (size < 0)
diff --git a/net/ftp/ftp_network_transaction.h b/net/ftp/ftp_network_transaction.h
index 390a6c1..ec0c1f8 100644
--- a/net/ftp/ftp_network_transaction.h
+++ b/net/ftp/ftp_network_transaction.h
@@ -5,10 +5,11 @@
#ifndef NET_FTP_FTP_NETWORK_TRANSACTION_H_
#define NET_FTP_FTP_NETWORK_TRANSACTION_H_
+#include <stdint.h>
+
#include <string>
#include <utility>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
@@ -46,7 +47,7 @@
const CompletionCallback& callback) override;
const FtpResponseInfo* GetResponseInfo() const override;
LoadState GetLoadState() const override;
- uint64 GetUploadProgress() const override;
+ uint64_t GetUploadProgress() const override;
private:
FRIEND_TEST_ALL_PREFIXES(FtpNetworkTransactionTest,
@@ -244,7 +245,7 @@
// with any trailing slash removed.
std::string current_remote_directory_;
- uint16 data_connection_port_;
+ uint16_t data_connection_port_;
ClientSocketFactory* socket_factory_;
diff --git a/net/ftp/ftp_network_transaction_unittest.cc b/net/ftp/ftp_network_transaction_unittest.cc
index 0d364a1..ec1dc20 100644
--- a/net/ftp/ftp_network_transaction_unittest.cc
+++ b/net/ftp/ftp_network_transaction_unittest.cc
@@ -7,6 +7,7 @@
#include "build/build_config.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -1386,7 +1387,7 @@
// Test for http://crbug.com/23794.
TEST_P(FtpNetworkTransactionTest, DownloadTransactionEvilSize) {
- // Try to overflow int64 in the response.
+ // Try to overflow int64_t in the response.
FtpSocketDataProviderEvilSize ctrl_socket(
"213 99999999999999999999999999999999\r\n",
FtpSocketDataProvider::PRE_QUIT);
diff --git a/net/ftp/ftp_response_info.h b/net/ftp/ftp_response_info.h
index 8bae8c1..70d36536 100644
--- a/net/ftp/ftp_response_info.h
+++ b/net/ftp/ftp_response_info.h
@@ -5,6 +5,8 @@
#ifndef NET_FTP_FTP_RESPONSE_INFO_H_
#define NET_FTP_FTP_RESPONSE_INFO_H_
+#include <stdint.h>
+
#include "base/time/time.h"
#include "net/base/host_port_pair.h"
@@ -29,7 +31,7 @@
// Expected content size, in bytes, as reported by SIZE command. Only valid
// for file downloads. -1 means unknown size.
- int64 expected_content_size;
+ int64_t expected_content_size;
// True if the response data is of a directory listing.
bool is_directory_listing;
diff --git a/net/ftp/ftp_transaction.h b/net/ftp/ftp_transaction.h
index f0e1b41f..0740189 100644
--- a/net/ftp/ftp_transaction.h
+++ b/net/ftp/ftp_transaction.h
@@ -5,6 +5,8 @@
#ifndef NET_FTP_FTP_TRANSACTION_H_
#define NET_FTP_FTP_TRANSACTION_H_
+#include <stdint.h>
+
#include "net/base/completion_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/load_states.h"
@@ -72,7 +74,7 @@
// Returns the upload progress in bytes. If there is no upload data,
// zero will be returned.
- virtual uint64 GetUploadProgress() const = 0;
+ virtual uint64_t GetUploadProgress() const = 0;
};
} // namespace net
diff --git a/net/ftp/ftp_util.cc b/net/ftp/ftp_util.cc
index 2f1df69..a2bee15 100644
--- a/net/ftp/ftp_util.cc
+++ b/net/ftp/ftp_util.cc
@@ -10,6 +10,7 @@
#include "base/i18n/case_conversion.h"
#include "base/i18n/char_iterator.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/singleton.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
diff --git a/net/ftp/ftp_util_unittest.cc b/net/ftp/ftp_util_unittest.cc
index 121780bb..a6f2ff01 100644
--- a/net/ftp/ftp_util_unittest.cc
+++ b/net/ftp/ftp_util_unittest.cc
@@ -4,7 +4,6 @@
#include "net/ftp/ftp_util.h"
-#include "base/basictypes.h"
#include "base/format_macros.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
diff --git a/net/http/des.cc b/net/http/des.cc
index 874372f..4fce9ccd 100644
--- a/net/http/des.cc
+++ b/net/http/des.cc
@@ -56,7 +56,7 @@
* ***** END LICENSE BLOCK ***** */
// Set odd parity bit (in least significant bit position).
-static uint8 DESSetKeyParity(uint8 x) {
+static uint8_t DESSetKeyParity(uint8_t x) {
if ((((x >> 7) ^ (x >> 6) ^ (x >> 5) ^
(x >> 4) ^ (x >> 3) ^ (x >> 2) ^
(x >> 1)) & 0x01) == 0) {
@@ -69,7 +69,7 @@
namespace net {
-void DESMakeKey(const uint8* raw, uint8* key) {
+void DESMakeKey(const uint8_t* raw, uint8_t* key) {
key[0] = DESSetKeyParity(raw[0]);
key[1] = DESSetKeyParity((raw[0] << 7) | (raw[1] >> 1));
key[2] = DESSetKeyParity((raw[1] << 6) | (raw[2] >> 2));
@@ -82,7 +82,7 @@
#if defined(USE_OPENSSL)
-void DESEncrypt(const uint8* key, const uint8* src, uint8* hash) {
+void DESEncrypt(const uint8_t* key, const uint8_t* src, uint8_t* hash) {
crypto::EnsureOpenSSLInit();
DES_key_schedule ks;
@@ -95,7 +95,7 @@
#elif defined(OS_IOS)
-void DESEncrypt(const uint8* key, const uint8* src, uint8* hash) {
+void DESEncrypt(const uint8_t* key, const uint8_t* src, uint8_t* hash) {
CCCryptorStatus status;
size_t data_out_moved = 0;
status = CCCrypt(kCCEncrypt, kCCAlgorithmDES, kCCOptionECBMode,
diff --git a/net/http/des.h b/net/http/des.h
index a1803ba..8540d62 100644
--- a/net/http/des.h
+++ b/net/http/des.h
@@ -5,7 +5,8 @@
#ifndef NET_HTTP_DES_H_
#define NET_HTTP_DES_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "net/base/net_export.h"
namespace net {
@@ -16,13 +17,14 @@
// TODO(wtc): Turn this into a C++ API and move it to the base module.
// Build a 64-bit DES key from a 56-bit raw key.
-NET_EXPORT_PRIVATE void DESMakeKey(const uint8* raw, uint8* key);
+NET_EXPORT_PRIVATE void DESMakeKey(const uint8_t* raw, uint8_t* key);
// Run the DES encryption algorithm in ECB mode on one block (8 bytes) of
// data. |key| is a DES key (8 bytes), |src| is the input plaintext (8
// bytes), and |hash| is an 8-byte buffer receiving the output ciphertext.
-NET_EXPORT_PRIVATE void DESEncrypt(const uint8* key, const uint8* src,
- uint8* hash);
+NET_EXPORT_PRIVATE void DESEncrypt(const uint8_t* key,
+ const uint8_t* src,
+ uint8_t* hash);
} // namespace net
diff --git a/net/http/des_unittest.cc b/net/http/des_unittest.cc
index a615a08..63172bb7 100644
--- a/net/http/des_unittest.cc
+++ b/net/http/des_unittest.cc
@@ -12,17 +12,16 @@
// This test vector comes from the NSS FIPS power-up self-test.
TEST(DESTest, KnownAnswerTest1) {
// DES known key (56-bits).
- static const uint8 des_known_key[] = "ANSI DES";
+ static const uint8_t des_known_key[] = "ANSI DES";
// DES known plaintext (64-bits).
- static const uint8 des_ecb_known_plaintext[] = "Netscape";
+ static const uint8_t des_ecb_known_plaintext[] = "Netscape";
// DES known ciphertext (64-bits).
- static const uint8 des_ecb_known_ciphertext[] = {
- 0x26, 0x14, 0xe9, 0xc3, 0x28, 0x80, 0x50, 0xb0
- };
+ static const uint8_t des_ecb_known_ciphertext[] = {0x26, 0x14, 0xe9, 0xc3,
+ 0x28, 0x80, 0x50, 0xb0};
- uint8 ciphertext[8];
+ uint8_t ciphertext[8];
memset(ciphertext, 0xaf, sizeof(ciphertext));
DESEncrypt(des_known_key, des_ecb_known_plaintext, ciphertext);
@@ -33,14 +32,11 @@
// Operation Validation System (MOVS): Requirements and Procedures, Appendix
// A, page 124.
TEST(DESTest, KnownAnswerTest2) {
- static const uint8 key[] = {
- 0x10, 0x31, 0x6e, 0x02, 0x8c, 0x8f, 0x3b, 0x4a
- };
- static const uint8 plaintext[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
- static const uint8 known_ciphertext[] = {
- 0x82, 0xdc, 0xba, 0xfb, 0xde, 0xab, 0x66, 0x02
- };
- uint8 ciphertext[8];
+ static const uint8_t key[] = {0x10, 0x31, 0x6e, 0x02, 0x8c, 0x8f, 0x3b, 0x4a};
+ static const uint8_t plaintext[] = {0, 0, 0, 0, 0, 0, 0, 0};
+ static const uint8_t known_ciphertext[] = {0x82, 0xdc, 0xba, 0xfb,
+ 0xde, 0xab, 0x66, 0x02};
+ uint8_t ciphertext[8];
memset(ciphertext, 0xaf, sizeof(ciphertext));
DESEncrypt(key, plaintext, ciphertext);
diff --git a/net/http/disk_based_cert_cache.h b/net/http/disk_based_cert_cache.h
index 347d2f0..7c9edec 100644
--- a/net/http/disk_based_cert_cache.h
+++ b/net/http/disk_based_cert_cache.h
@@ -5,11 +5,14 @@
#ifndef NET_HTTP_DISK_BASED_CERT_CACHE_H
#define NET_HTTP_DISK_BASED_CERT_CACHE_H
+#include <stddef.h>
+
#include <string>
#include "base/callback.h"
#include "base/containers/hash_tables.h"
#include "base/containers/mru_cache.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/net_export.h"
#include "net/cert/x509_certificate.h"
diff --git a/net/http/disk_cache_based_quic_server_info.cc b/net/http/disk_cache_based_quic_server_info.cc
index d019f9b3..2ba6cf8 100644
--- a/net/http/disk_cache_based_quic_server_info.cc
+++ b/net/http/disk_cache_based_quic_server_info.cc
@@ -326,7 +326,7 @@
}
int DiskCacheBasedQuicServerInfo::DoRead() {
- const int32 size = entry_->GetDataSize(0 /* index */);
+ const int32_t size = entry_->GetDataSize(0 /* index */);
if (!size) {
state_ = WAIT_FOR_DATA_READY_DONE;
return OK;
diff --git a/net/http/disk_cache_based_quic_server_info.h b/net/http/disk_cache_based_quic_server_info.h
index 3076f3aa..9403d6f 100644
--- a/net/http/disk_cache_based_quic_server_info.h
+++ b/net/http/disk_cache_based_quic_server_info.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
diff --git a/net/http/disk_cache_based_quic_server_info_unittest.cc b/net/http/disk_cache_based_quic_server_info_unittest.cc
index 6962fdf..6f6425ea 100644
--- a/net/http/disk_cache_based_quic_server_info_unittest.cc
+++ b/net/http/disk_cache_based_quic_server_info_unittest.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "net/base/net_errors.h"
#include "net/http/mock_http_cache.h"
diff --git a/net/http/failing_http_transaction_factory.cc b/net/http/failing_http_transaction_factory.cc
index 854e7bf5..be82407 100644
--- a/net/http/failing_http_transaction_factory.cc
+++ b/net/http/failing_http_transaction_factory.cc
@@ -127,7 +127,7 @@
return false;
}
-int64 FailingHttpTransaction::GetTotalReceivedBytes() const {
+int64_t FailingHttpTransaction::GetTotalReceivedBytes() const {
return 0;
}
diff --git a/net/http/http_auth.cc b/net/http/http_auth.cc
index 1b96ba48..15768a0 100644
--- a/net/http/http_auth.cc
+++ b/net/http/http_auth.cc
@@ -6,7 +6,6 @@
#include <algorithm>
-#include "base/basictypes.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
#include "net/base/net_errors.h"
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h
index f05f8184..53b998f 100644
--- a/net/http/http_auth_cache.h
+++ b/net/http/http_auth_cache.h
@@ -5,6 +5,8 @@
#ifndef NET_HTTP_HTTP_AUTH_CACHE_H_
#define NET_HTTP_HTTP_AUTH_CACHE_H_
+#include <stddef.h>
+
#include <list>
#include <string>
diff --git a/net/http/http_auth_controller.h b/net/http/http_auth_controller.h
index 2df9d5727..b7d6e94d 100644
--- a/net/http/http_auth_controller.h
+++ b/net/http/http_auth_controller.h
@@ -8,7 +8,6 @@
#include <set>
#include <string>
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
diff --git a/net/http/http_auth_filter.h b/net/http/http_auth_filter.h
index 260da47..345149dd 100644
--- a/net/http/http_auth_filter.h
+++ b/net/http/http_auth_filter.h
@@ -8,6 +8,7 @@
#include <list>
#include <string>
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/http/http_auth.h"
#include "net/proxy/proxy_bypass_rules.h"
diff --git a/net/http/http_auth_filter_unittest.cc b/net/http/http_auth_filter_unittest.cc
index 25723c1..a23d73b8 100644
--- a/net/http/http_auth_filter_unittest.cc
+++ b/net/http/http_auth_filter_unittest.cc
@@ -4,7 +4,6 @@
#include <ostream>
-
#include "base/memory/scoped_ptr.h"
#include "net/http/http_auth_filter.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/http/http_auth_gssapi_posix.cc b/net/http/http_auth_gssapi_posix.cc
index 5fc1690..1c3352c9 100644
--- a/net/http/http_auth_gssapi_posix.cc
+++ b/net/http/http_auth_gssapi_posix.cc
@@ -11,6 +11,7 @@
#include "base/files/file_path.h"
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_restrictions.h"
diff --git a/net/http/http_auth_gssapi_posix.h b/net/http/http_auth_gssapi_posix.h
index 73502c9b..cf4dcd50 100644
--- a/net/http/http_auth_gssapi_posix.h
+++ b/net/http/http_auth_gssapi_posix.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/native_library.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
diff --git a/net/http/http_auth_gssapi_posix_unittest.cc b/net/http/http_auth_gssapi_posix_unittest.cc
index 79a248f..6334fbef 100644
--- a/net/http/http_auth_gssapi_posix_unittest.cc
+++ b/net/http/http_auth_gssapi_posix_unittest.cc
@@ -4,7 +4,6 @@
#include "net/http/http_auth_gssapi_posix.h"
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/native_library.h"
diff --git a/net/http/http_auth_handler_basic_unittest.cc b/net/http/http_auth_handler_basic_unittest.cc
index 60e58829..e6a9818 100644
--- a/net/http/http_auth_handler_basic_unittest.cc
+++ b/net/http/http_auth_handler_basic_unittest.cc
@@ -4,7 +4,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/net/http/http_auth_handler_digest.h b/net/http/http_auth_handler_digest.h
index dbe02b4..27cdfcd 100644
--- a/net/http/http_auth_handler_digest.h
+++ b/net/http/http_auth_handler_digest.h
@@ -7,8 +7,8 @@
#include <string>
-#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/http/http_auth_handler.h"
diff --git a/net/http/http_auth_handler_digest_unittest.cc b/net/http/http_auth_handler_digest_unittest.cc
index 8b5179e1..89f3010 100644
--- a/net/http/http_auth_handler_digest_unittest.cc
+++ b/net/http/http_auth_handler_digest_unittest.cc
@@ -4,7 +4,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/net_errors.h"
diff --git a/net/http/http_auth_handler_factory.h b/net/http/http_auth_handler_factory.h
index ed91fea..2cbf345 100644
--- a/net/http/http_auth_handler_factory.h
+++ b/net/http/http_auth_handler_factory.h
@@ -9,6 +9,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/http/http_auth.h"
diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc
index 7a41d5ac..2411f9f 100644
--- a/net/http/http_auth_handler_ntlm.cc
+++ b/net/http/http_auth_handler_ntlm.cc
@@ -47,7 +47,7 @@
// GenerateType1Msg, and GenerateType3Msg, and perhaps further.
const void* in_buf;
void* out_buf;
- uint32 in_buf_len, out_buf_len;
+ uint32_t in_buf_len, out_buf_len;
std::string decoded_auth_data;
// The username may be in the form "DOMAIN\user". Parse it into the two
diff --git a/net/http/http_auth_handler_ntlm.h b/net/http/http_auth_handler_ntlm.h
index 7a683bb..d71b498 100644
--- a/net/http/http_auth_handler_ntlm.h
+++ b/net/http/http_auth_handler_ntlm.h
@@ -5,6 +5,9 @@
#ifndef NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_
#define NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include "build/build_config.h"
// This contains the portable and the SSPI implementations for NTLM.
@@ -24,7 +27,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "net/http/http_auth_handler.h"
#include "net/http/http_auth_handler_factory.h"
@@ -67,7 +69,7 @@
#if defined(NTLM_PORTABLE)
// A function that generates n random bytes in the output buffer.
- typedef void (*GenerateRandomProc)(uint8* output, size_t n);
+ typedef void (*GenerateRandomProc)(uint8_t* output, size_t n);
// A function that returns the local host name. Returns an empty string if
// the local host name is not available.
@@ -139,9 +141,9 @@
// Given an input token received from the server, generate the next output
// token to be sent to the server.
int GetNextToken(const void* in_token,
- uint32 in_token_len,
+ uint32_t in_token_len,
void** out_token,
- uint32* out_token_len);
+ uint32_t* out_token_len);
// Create an NTLM SPN to identify the |origin| server.
static std::string CreateSPN(const GURL& origin);
diff --git a/net/http/http_auth_handler_ntlm_portable.cc b/net/http/http_auth_handler_ntlm_portable.cc
index 54d4492..0522c31 100644
--- a/net/http/http_auth_handler_ntlm_portable.cc
+++ b/net/http/http_auth_handler_ntlm_portable.cc
@@ -177,12 +177,12 @@
#define SWAP16(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
#define SWAP32(x) ((SWAP16((x) & 0xffff) << 16) | (SWAP16((x) >> 16)))
-static void* WriteBytes(void* buf, const void* data, uint32 data_len) {
+static void* WriteBytes(void* buf, const void* data, uint32_t data_len) {
memcpy(buf, data, data_len);
return static_cast<char*>(buf) + data_len;
}
-static void* WriteDWORD(void* buf, uint32 dword) {
+static void* WriteDWORD(void* buf, uint32_t dword) {
#ifdef IS_BIG_ENDIAN
// NTLM uses little endian on the wire.
dword = SWAP32(dword);
@@ -190,7 +190,7 @@
return WriteBytes(buf, &dword, sizeof(dword));
}
-static void* WriteSecBuf(void* buf, uint16 length, uint32 offset) {
+static void* WriteSecBuf(void* buf, uint16_t length, uint32_t offset) {
#ifdef IS_BIG_ENDIAN
length = SWAP16(length);
offset = SWAP32(offset);
@@ -213,14 +213,15 @@
* to pass the same buffer as both input and output, which is a handy way to
* convert the unicode buffer to little-endian on big-endian platforms.
*/
-static void* WriteUnicodeLE(
- void* buf, const base::char16* str, uint32 str_len) {
+static void* WriteUnicodeLE(void* buf,
+ const base::char16* str,
+ uint32_t str_len) {
// Convert input string from BE to LE.
- uint8* cursor = static_cast<uint8*>(buf);
- const uint8* input = reinterpret_cast<const uint8*>(str);
- for (uint32 i = 0; i < str_len; ++i, input += 2, cursor += 2) {
+ uint8_t* cursor = static_cast<uint8_t*>(buf);
+ const uint8_t* input = reinterpret_cast<const uint8_t*>(str);
+ for (uint32_t i = 0; i < str_len; ++i, input += 2, cursor += 2) {
// Allow for the case where |buf == str|.
- uint8 temp = input[0];
+ uint8_t temp = input[0];
cursor[0] = input[1];
cursor[1] = temp;
}
@@ -228,18 +229,18 @@
}
#endif
-static uint16 ReadUint16(const uint8*& buf) {
- uint16 x = (static_cast<uint16>(buf[0])) |
- (static_cast<uint16>(buf[1]) << 8);
+static uint16_t ReadUint16(const uint8_t*& buf) {
+ uint16_t x =
+ (static_cast<uint16_t>(buf[0])) | (static_cast<uint16_t>(buf[1]) << 8);
buf += sizeof(x);
return x;
}
-static uint32 ReadUint32(const uint8*& buf) {
- uint32 x = (static_cast<uint32>(buf[0])) |
- (static_cast<uint32>(buf[1]) << 8) |
- (static_cast<uint32>(buf[2]) << 16) |
- (static_cast<uint32>(buf[3]) << 24);
+static uint32_t ReadUint32(const uint8_t*& buf) {
+ uint32_t x = (static_cast<uint32_t>(buf[0])) |
+ (static_cast<uint32_t>(buf[1]) << 8) |
+ (static_cast<uint32_t>(buf[2]) << 16) |
+ (static_cast<uint32_t>(buf[3]) << 24);
buf += sizeof(x);
return x;
}
@@ -255,8 +256,8 @@
//
// Note: This function is not being used because our SendLM() function always
// returns false.
-static void LM_Hash(const base::string16& password, uint8* hash) {
- static const uint8 LM_MAGIC[] = "KGS!@#$%";
+static void LM_Hash(const base::string16& password, uint8_t* hash) {
+ static const uint8_t LM_MAGIC[] = "KGS!@#$%";
// Convert password to OEM character set. We'll just use the native
// filesystem charset.
@@ -264,9 +265,9 @@
passbuf = base::ToUpperASCII(passbuf);
passbuf.resize(14, '\0');
- uint8 k1[8], k2[8];
- DESMakeKey(reinterpret_cast<const uint8*>(passbuf.data()) , k1);
- DESMakeKey(reinterpret_cast<const uint8*>(passbuf.data()) + 7, k2);
+ uint8_t k1[8], k2[8];
+ DESMakeKey(reinterpret_cast<const uint8_t*>(passbuf.data()), k1);
+ DESMakeKey(reinterpret_cast<const uint8_t*>(passbuf.data()) + 7, k2);
ZapString(&passbuf);
// Use password keys to hash LM magic string twice.
@@ -280,19 +281,19 @@
// null-terminated unicode password.
// param hash
// 16-byte result buffer
-static void NTLM_Hash(const base::string16& password, uint8* hash) {
+static void NTLM_Hash(const base::string16& password, uint8_t* hash) {
#ifdef IS_BIG_ENDIAN
- uint32 len = password.length();
- uint8* passbuf;
+ uint32_t len = password.length();
+ uint8_t* passbuf;
- passbuf = static_cast<uint8*>(malloc(len * 2));
+ passbuf = static_cast<uint8_t*>(malloc(len * 2));
WriteUnicodeLE(passbuf, password.data(), len);
weak_crypto::MD4Sum(passbuf, len * 2, hash);
ZapBuf(passbuf, len * 2);
free(passbuf);
#else
- weak_crypto::MD4Sum(reinterpret_cast<const uint8*>(password.data()),
+ weak_crypto::MD4Sum(reinterpret_cast<const uint8_t*>(password.data()),
password.length() * 2, hash);
#endif
}
@@ -308,10 +309,10 @@
// 8-byte challenge from Type-2 message
// param response
// 24-byte buffer to contain the LM response upon return
-static void LM_Response(const uint8* hash,
- const uint8* challenge,
- uint8* response) {
- uint8 keybytes[21], k1[8], k2[8], k3[8];
+static void LM_Response(const uint8_t* hash,
+ const uint8_t* challenge,
+ uint8_t* response) {
+ uint8_t keybytes[21], k1[8], k2[8], k3[8];
memcpy(keybytes, hash, 16);
ZapBuf(keybytes + 16, 5);
@@ -328,7 +329,7 @@
//-----------------------------------------------------------------------------
// Returns OK or a network error code.
-static int GenerateType1Msg(void** out_buf, uint32* out_len) {
+static int GenerateType1Msg(void** out_buf, uint32_t* out_len) {
//
// Verify that buf_len is sufficient.
//
@@ -369,16 +370,16 @@
}
struct Type2Msg {
- uint32 flags; // NTLM_Xxx bitwise combination
- uint8 challenge[8]; // 8 byte challenge
+ uint32_t flags; // NTLM_Xxx bitwise combination
+ uint8_t challenge[8]; // 8 byte challenge
const void* target; // target string (type depends on flags)
- uint32 target_len; // target length in bytes
+ uint32_t target_len; // target length in bytes
};
// Returns OK or a network error code.
// TODO(wtc): This function returns ERR_UNEXPECTED when the input message is
// invalid. We should return a better error code.
-static int ParseType2Msg(const void* in_buf, uint32 in_len, Type2Msg* msg) {
+static int ParseType2Msg(const void* in_buf, uint32_t in_len, Type2Msg* msg) {
// Make sure in_buf is long enough to contain a meaningful type2 msg.
//
// 0 NTLMSSP Signature
@@ -391,7 +392,7 @@
if (in_len < NTLM_TYPE2_HEADER_LEN)
return ERR_UNEXPECTED;
- const uint8* cursor = (const uint8*) in_buf;
+ const uint8_t* cursor = (const uint8_t*)in_buf;
// verify NTLMSSP signature
if (memcmp(cursor, NTLM_SIGNATURE, sizeof(NTLM_SIGNATURE)) != 0)
@@ -404,16 +405,16 @@
cursor += sizeof(NTLM_TYPE2_MARKER);
// read target name security buffer
- uint32 target_len = ReadUint16(cursor);
+ uint32_t target_len = ReadUint16(cursor);
ReadUint16(cursor); // discard next 16-bit value
- uint32 offset = ReadUint32(cursor); // get offset from in_buf
+ uint32_t offset = ReadUint32(cursor); // get offset from in_buf
msg->target_len = 0;
msg->target = NULL;
// Check the offset / length combo is in range of the input buffer, including
// integer overflow checking.
if (offset + target_len > offset && offset + target_len <= in_len) {
msg->target_len = target_len;
- msg->target = ((const uint8*) in_buf) + offset;
+ msg->target = ((const uint8_t*)in_buf) + offset;
}
// read flags
@@ -424,8 +425,8 @@
cursor += sizeof(msg->challenge);
NTLM_LOG(("NTLM type 2 message:\n"));
- LogBuf("target", (const uint8*) msg->target, msg->target_len);
- LogBuf("flags", (const uint8*) &msg->flags, 4);
+ LogBuf("target", (const uint8_t*)msg->target, msg->target_len);
+ LogBuf("flags", (const uint8_t*)&msg->flags, 4);
LogFlags(msg->flags);
LogBuf("challenge", msg->challenge, sizeof(msg->challenge));
@@ -435,7 +436,7 @@
return OK;
}
-static void GenerateRandom(uint8* output, size_t n) {
+static void GenerateRandom(uint8_t* output, size_t n) {
for (size_t i = 0; i < n; ++i)
output[i] = base::RandInt(0, 255);
}
@@ -447,9 +448,9 @@
const std::string& hostname,
const void* rand_8_bytes,
const void* in_buf,
- uint32 in_len,
+ uint32_t in_len,
void** out_buf,
- uint32* out_len) {
+ uint32_t* out_len) {
// in_buf contains Type-2 msg (the challenge) from server.
int rv;
@@ -473,7 +474,7 @@
const void* domain_ptr;
const void* user_ptr;
const void* host_ptr;
- uint32 domain_len, user_len, host_len;
+ uint32_t domain_len, user_len, host_len;
//
// Get domain name.
@@ -545,13 +546,13 @@
//
// Next, we compute the LM and NTLM responses.
//
- uint8 lm_resp[LM_RESP_LEN];
- uint8 ntlm_resp[NTLM_RESP_LEN];
- uint8 ntlm_hash[NTLM_HASH_LEN];
+ uint8_t lm_resp[LM_RESP_LEN];
+ uint8_t ntlm_resp[NTLM_RESP_LEN];
+ uint8_t ntlm_hash[NTLM_HASH_LEN];
if (msg.flags & NTLM_NegotiateNTLM2Key) {
// compute NTLM2 session response
base::MD5Digest session_hash;
- uint8 temp[16];
+ uint8_t temp[16];
memcpy(lm_resp, rand_8_bytes, 8);
memset(lm_resp + 8, 0, LM_RESP_LEN - 8);
@@ -567,7 +568,7 @@
LM_Response(ntlm_hash, msg.challenge, ntlm_resp);
if (SendLM()) {
- uint8 lm_hash[LM_HASH_LEN];
+ uint8_t lm_hash[LM_HASH_LEN];
LM_Hash(password, lm_hash);
LM_Response(lm_hash, msg.challenge, lm_resp);
} else {
@@ -582,7 +583,7 @@
// Finally, we assemble the Type-3 msg :-)
//
void* cursor = *out_buf;
- uint32 offset;
+ uint32_t offset;
// 0 : signature
cursor = WriteBytes(cursor, NTLM_SIGNATURE, sizeof(NTLM_SIGNATURE));
@@ -593,27 +594,27 @@
// 12 : LM response sec buf
offset = NTLM_TYPE3_HEADER_LEN + domain_len + user_len + host_len;
cursor = WriteSecBuf(cursor, LM_RESP_LEN, offset);
- memcpy(static_cast<uint8*>(*out_buf) + offset, lm_resp, LM_RESP_LEN);
+ memcpy(static_cast<uint8_t*>(*out_buf) + offset, lm_resp, LM_RESP_LEN);
// 20 : NTLM response sec buf
offset += LM_RESP_LEN;
cursor = WriteSecBuf(cursor, NTLM_RESP_LEN, offset);
- memcpy(static_cast<uint8*>(*out_buf) + offset, ntlm_resp, NTLM_RESP_LEN);
+ memcpy(static_cast<uint8_t*>(*out_buf) + offset, ntlm_resp, NTLM_RESP_LEN);
// 28 : domain name sec buf
offset = NTLM_TYPE3_HEADER_LEN;
cursor = WriteSecBuf(cursor, domain_len, offset);
- memcpy(static_cast<uint8*>(*out_buf) + offset, domain_ptr, domain_len);
+ memcpy(static_cast<uint8_t*>(*out_buf) + offset, domain_ptr, domain_len);
// 36 : user name sec buf
offset += domain_len;
cursor = WriteSecBuf(cursor, user_len, offset);
- memcpy(static_cast<uint8*>(*out_buf) + offset, user_ptr, user_len);
+ memcpy(static_cast<uint8_t*>(*out_buf) + offset, user_ptr, user_len);
// 44 : workstation (host) name sec buf
offset += user_len;
cursor = WriteSecBuf(cursor, host_len, offset);
- memcpy(static_cast<uint8*>(*out_buf) + offset, host_ptr, host_len);
+ memcpy(static_cast<uint8_t*>(*out_buf) + offset, host_ptr, host_len);
// 52 : session key sec buf (not used)
cursor = WriteSecBuf(cursor, 0, 0);
@@ -683,9 +684,9 @@
}
int HttpAuthHandlerNTLM::GetNextToken(const void* in_token,
- uint32 in_token_len,
+ uint32_t in_token_len,
void** out_token,
- uint32* out_token_len) {
+ uint32_t* out_token_len) {
int rv = 0;
// If in_token is non-null, then assume it contains a type 2 message...
@@ -694,7 +695,7 @@
std::string hostname = get_host_name_proc_();
if (hostname.empty())
return ERR_UNEXPECTED;
- uint8 rand_buf[8];
+ uint8_t rand_buf[8];
generate_random_proc_(rand_buf, 8);
rv = GenerateType3Msg(domain_,
credentials_.username(), credentials_.password(),
diff --git a/net/http/http_auth_sspi_win_unittest.cc b/net/http/http_auth_sspi_win_unittest.cc
index 103d0c29..0bb90ff7 100644
--- a/net/http/http_auth_sspi_win_unittest.cc
+++ b/net/http/http_auth_sspi_win_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/basictypes.h"
#include "net/base/net_errors.h"
#include "net/http/http_auth_challenge_tokenizer.h"
#include "net/http/http_auth_sspi_win.h"
diff --git a/net/http/http_basic_state.cc b/net/http/http_basic_state.cc
index 060f2fe2..6c1f5a9 100644
--- a/net/http/http_basic_state.cc
+++ b/net/http/http_basic_state.cc
@@ -4,7 +4,6 @@
#include "net/http/http_basic_state.h"
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/base/io_buffer.h"
#include "net/http/http_request_info.h"
diff --git a/net/http/http_basic_state.h b/net/http/http_basic_state.h
index 259c502..41298e4 100644
--- a/net/http/http_basic_state.h
+++ b/net/http/http_basic_state.h
@@ -10,7 +10,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
diff --git a/net/http/http_basic_stream.h b/net/http/http_basic_stream.h
index 11a568e1..0ca1962 100644
--- a/net/http/http_basic_stream.h
+++ b/net/http/http_basic_stream.h
@@ -13,7 +13,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/http/http_basic_state.h"
#include "net/http/http_stream.h"
diff --git a/net/http/http_byte_range.cc b/net/http/http_byte_range.cc
index b43cb2e8..ad12fa9 100644
--- a/net/http/http_byte_range.cc
+++ b/net/http/http_byte_range.cc
@@ -11,7 +11,7 @@
namespace {
-const int64 kPositionNotSpecified = -1;
+const int64_t kPositionNotSpecified = -1;
} // namespace
@@ -25,8 +25,8 @@
}
// static
-HttpByteRange HttpByteRange::Bounded(int64 first_byte_position,
- int64 last_byte_position) {
+HttpByteRange HttpByteRange::Bounded(int64_t first_byte_position,
+ int64_t last_byte_position) {
HttpByteRange range;
range.set_first_byte_position(first_byte_position);
range.set_last_byte_position(last_byte_position);
@@ -34,14 +34,14 @@
}
// static
-HttpByteRange HttpByteRange::RightUnbounded(int64 first_byte_position) {
+HttpByteRange HttpByteRange::RightUnbounded(int64_t first_byte_position) {
HttpByteRange range;
range.set_first_byte_position(first_byte_position);
return range;
}
// static
-HttpByteRange HttpByteRange::Suffix(int64 suffix_length) {
+HttpByteRange HttpByteRange::Suffix(int64_t suffix_length) {
HttpByteRange range;
range.set_suffix_length(suffix_length);
return range;
@@ -82,7 +82,7 @@
first_byte_position(), last_byte_position());
}
-bool HttpByteRange::ComputeBounds(int64 size) {
+bool HttpByteRange::ComputeBounds(int64_t size) {
if (size < 0)
return false;
if (has_computed_bounds_)
diff --git a/net/http/http_byte_range.h b/net/http/http_byte_range.h
index 63c02f1..f831874 100644
--- a/net/http/http_byte_range.h
+++ b/net/http/http_byte_range.h
@@ -5,9 +5,10 @@
#ifndef NET_HTTP_HTTP_BYTE_RANGE_H_
#define NET_HTTP_HTTP_BYTE_RANGE_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
namespace net {
@@ -20,21 +21,21 @@
HttpByteRange();
// Convenience constructors.
- static HttpByteRange Bounded(int64 first_byte_position,
- int64 last_byte_position);
- static HttpByteRange RightUnbounded(int64 first_byte_position);
- static HttpByteRange Suffix(int64 suffix_length);
+ static HttpByteRange Bounded(int64_t first_byte_position,
+ int64_t last_byte_position);
+ static HttpByteRange RightUnbounded(int64_t first_byte_position);
+ static HttpByteRange Suffix(int64_t suffix_length);
// Since this class is POD, we use constructor, assignment operator
// and destructor provided by compiler.
- int64 first_byte_position() const { return first_byte_position_; }
- void set_first_byte_position(int64 value) { first_byte_position_ = value; }
+ int64_t first_byte_position() const { return first_byte_position_; }
+ void set_first_byte_position(int64_t value) { first_byte_position_ = value; }
- int64 last_byte_position() const { return last_byte_position_; }
- void set_last_byte_position(int64 value) { last_byte_position_ = value; }
+ int64_t last_byte_position() const { return last_byte_position_; }
+ void set_last_byte_position(int64_t value) { last_byte_position_ = value; }
- int64 suffix_length() const { return suffix_length_; }
- void set_suffix_length(int64 value) { suffix_length_ = value; }
+ int64_t suffix_length() const { return suffix_length_; }
+ void set_suffix_length(int64_t value) { suffix_length_ = value; }
// Returns true if this is a suffix byte range.
bool IsSuffixByteRange() const;
@@ -57,12 +58,12 @@
// no side effect.
// Returns false if this method is called more than once and there will be
// no side effect.
- bool ComputeBounds(int64 size);
+ bool ComputeBounds(int64_t size);
private:
- int64 first_byte_position_;
- int64 last_byte_position_;
- int64 suffix_length_;
+ int64_t first_byte_position_;
+ int64_t last_byte_position_;
+ int64_t suffix_length_;
bool has_computed_bounds_;
};
diff --git a/net/http/http_byte_range_unittest.cc b/net/http/http_byte_range_unittest.cc
index 0a77da3e..412c7f80 100644
--- a/net/http/http_byte_range_unittest.cc
+++ b/net/http/http_byte_range_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/macros.h"
#include "net/http/http_byte_range.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -11,9 +12,9 @@
TEST(HttpByteRangeTest, ValidRanges) {
const struct {
- int64 first_byte_position;
- int64 last_byte_position;
- int64 suffix_length;
+ int64_t first_byte_position;
+ int64_t last_byte_position;
+ int64_t suffix_length;
bool valid;
} tests[] = {
{ -1, -1, 0, false },
@@ -38,13 +39,13 @@
TEST(HttpByteRangeTest, SetInstanceSize) {
const struct {
- int64 first_byte_position;
- int64 last_byte_position;
- int64 suffix_length;
- int64 instance_size;
+ int64_t first_byte_position;
+ int64_t last_byte_position;
+ int64_t suffix_length;
+ int64_t instance_size;
bool expected_return_value;
- int64 expected_lower_bound;
- int64 expected_upper_bound;
+ int64_t expected_lower_bound;
+ int64_t expected_upper_bound;
} tests[] = {
{ -10, 0, -1, 0, false, -1, -1 },
{ 10, 0, -1, 0, false, -1, -1 },
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 6a33acb..ae49d56e 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -13,6 +13,7 @@
#include "base/files/file_util.h"
#include "base/format_macros.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
diff --git a/net/http/http_cache.h b/net/http/http_cache.h
index c960bbd..618709a 100644
--- a/net/http/http_cache.h
+++ b/net/http/http_cache.h
@@ -18,9 +18,9 @@
#include <set>
#include <string>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 39a65f3..3b9f28dc 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -18,6 +18,7 @@
#include "base/compiler_specific.h"
#include "base/format_macros.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
#include "base/single_thread_task_runner.h"
@@ -1882,7 +1883,7 @@
result = write_len_;
} else if (!done_reading_ && entry_ && (!partial_ || truncated_)) {
int current_size = entry_->disk_entry->GetDataSize(kResponseContentIndex);
- int64 body_size = response_.headers->GetContentLength();
+ int64_t body_size = response_.headers->GetContentLength();
if (body_size >= 0 && body_size <= current_size)
done_reading_ = true;
}
@@ -2901,8 +2902,9 @@
}
TimeDelta before_send_time = send_request_since_ - first_cache_access_since_;
- int64 before_send_percent = (total_time.ToInternalValue() == 0) ?
- 0 : before_send_time * 100 / total_time;
+ int64_t before_send_percent = (total_time.ToInternalValue() == 0)
+ ? 0
+ : before_send_time * 100 / total_time;
DCHECK_GE(before_send_percent, 0);
DCHECK_LE(before_send_percent, 100);
base::HistogramBase::Sample before_send_sample =
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h
index ac84578..175e3f9 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -13,7 +13,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index 76deac3f..4d0b81d3 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
@@ -491,10 +492,10 @@
ASSERT_EQ(206, headers->response_code());
- int64 range_start, range_end, object_size;
+ int64_t range_start, range_end, object_size;
ASSERT_TRUE(
headers->GetContentRange(&range_start, &range_end, &object_size));
- int64 content_length = headers->GetContentLength();
+ int64_t content_length = headers->GetContentLength();
int length = end - start + 1;
ASSERT_EQ(length, content_length);
@@ -2924,7 +2925,7 @@
MockTransaction transaction(kSimplePOST_Transaction);
- const int64 kUploadId = 1; // Just a dummy value.
+ const int64_t kUploadId = 1; // Just a dummy value.
std::vector<scoped_ptr<UploadElementReader>> element_readers;
element_readers.push_back(
@@ -2957,7 +2958,7 @@
MockTransaction transaction(kSimplePOST_Transaction);
transaction.request_headers = "Range: bytes = 0-4\r\n";
- const int64 kUploadId = 1; // Just a dummy value.
+ const int64_t kUploadId = 1; // Just a dummy value.
std::vector<scoped_ptr<UploadElementReader>> element_readers;
element_readers.push_back(
diff --git a/net/http/http_chunked_decoder.h b/net/http/http_chunked_decoder.h
index 23076f9..87412de 100644
--- a/net/http/http_chunked_decoder.h
+++ b/net/http/http_chunked_decoder.h
@@ -45,6 +45,8 @@
#ifndef NET_HTTP_HTTP_CHUNKED_DECODER_H_
#define NET_HTTP_HTTP_CHUNKED_DECODER_H_
+#include <stddef.h>
+
#include <string>
#include "net/base/net_export.h"
diff --git a/net/http/http_chunked_decoder_unittest.cc b/net/http/http_chunked_decoder_unittest.cc
index 06dd353c..2f2ab25 100644
--- a/net/http/http_chunked_decoder_unittest.cc
+++ b/net/http/http_chunked_decoder_unittest.cc
@@ -4,7 +4,6 @@
#include "net/http/http_chunked_decoder.h"
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_errors.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/http/http_content_disposition.h b/net/http/http_content_disposition.h
index c96ba6186..0f1b5ac0 100644
--- a/net/http/http_content_disposition.h
+++ b/net/http/http_content_disposition.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
namespace net {
diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h
index 89ff8eb..3026f2e1 100644
--- a/net/http/http_network_layer.h
+++ b/net/http/http_network_layer.h
@@ -7,8 +7,8 @@
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/power_monitor/power_observer.h"
diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc
index 7840902..90df3271 100644
--- a/net/http/http_network_layer_unittest.cc
+++ b/net/http/http_network_layer_unittest.cc
@@ -4,7 +4,6 @@
#include "net/http/http_network_layer.h"
-#include "base/basictypes.h"
#include "base/strings/stringprintf.h"
#include "net/cert/mock_cert_verifier.h"
#include "net/dns/mock_host_resolver.h"
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index 875f778..3bf68b42 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -57,18 +57,18 @@
} // unnamed namespace
// The maximum receive window sizes for HTTP/2 sessions and streams.
-const int32 kSpdySessionMaxRecvWindowSize = 15 * 1024 * 1024; // 15 MB
-const int32 kSpdyStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
+const int32_t kSpdySessionMaxRecvWindowSize = 15 * 1024 * 1024; // 15 MB
+const int32_t kSpdyStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
// QUIC's socket receive buffer size.
// We should adaptively set this buffer size, but for now, we'll use a size
// that seems large enough to receive data at line rate for most connections,
// and does not consume "too much" memory.
-const int32 kQuicSocketReceiveBufferSize = 1024 * 1024; // 1MB
+const int32_t kQuicSocketReceiveBufferSize = 1024 * 1024; // 1MB
// Number of recent connections to consider for certain thresholds
// that trigger disabling QUIC. E.g. disable QUIC if PUBLIC_RESET was
// received post handshake for at least 2 of 20 recent connections.
-const int32 kQuicMaxRecentDisabledReasons = 20;
+const int32_t kQuicMaxRecentDisabledReasons = 20;
HttpNetworkSession::Params::Params()
: client_socket_factory(NULL),
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index 563c4a9..0671ea4 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -5,11 +5,13 @@
#ifndef NET_HTTP_HTTP_NETWORK_SESSION_H_
#define NET_HTTP_HTTP_NETWORK_SESSION_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <set>
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
@@ -79,8 +81,8 @@
HostMappingRules* host_mapping_rules;
SocketPerformanceWatcherFactory* socket_performance_watcher_factory;
bool ignore_certificate_errors;
- uint16 testing_fixed_http_port;
- uint16 testing_fixed_https_port;
+ uint16_t testing_fixed_http_port;
+ uint16_t testing_fixed_https_port;
bool enable_tcp_fast_open_for_ssl;
// Compress SPDY headers.
diff --git a/net/http/http_network_session_peer.h b/net/http/http_network_session_peer.h
index ae57f39..18d7a23 100644
--- a/net/http/http_network_session_peer.h
+++ b/net/http/http_network_session_peer.h
@@ -5,6 +5,7 @@
#ifndef NET_HTTP_HTTP_NETWORK_SESSION_PEER_H_
#define NET_HTTP_HTTP_NETWORK_SESSION_PEER_H_
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index f1598cc9..8d02fedb 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -109,8 +109,8 @@
const GURL* url,
int net_error,
SSLFailureState ssl_failure_state,
- uint16 version_before,
- uint16 version_after,
+ uint16_t version_before,
+ uint16_t version_after,
NetLogCaptureMode /* capture_mode */) {
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("host_and_port", GetHostAndPort(*url));
@@ -1323,7 +1323,7 @@
}
bool should_fallback = false;
- uint16 version_max = server_ssl_config_.version_max;
+ uint16_t version_max = server_ssl_config_.version_max;
switch (error) {
case ERR_CONNECTION_CLOSED:
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h
index 0a76a4c..f62b951 100644
--- a/net/http/http_network_transaction.h
+++ b/net/http/http_network_transaction.h
@@ -9,8 +9,8 @@
#include <string>
-#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index b88d8ec..d935637e 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -12,12 +12,12 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc
index 5a3ec4b9..562bff36 100644
--- a/net/http/http_proxy_client_socket.cc
+++ b/net/http/http_proxy_client_socket.cc
@@ -244,11 +244,11 @@
return transport_->socket()->Write(buf, buf_len, callback);
}
-int HttpProxyClientSocket::SetReceiveBufferSize(int32 size) {
+int HttpProxyClientSocket::SetReceiveBufferSize(int32_t size) {
return transport_->socket()->SetReceiveBufferSize(size);
}
-int HttpProxyClientSocket::SetSendBufferSize(int32 size) {
+int HttpProxyClientSocket::SetSendBufferSize(int32_t size) {
return transport_->socket()->SetSendBufferSize(size);
}
diff --git a/net/http/http_proxy_client_socket.h b/net/http/http_proxy_client_socket.h
index 42e21b8..a8a5d27 100644
--- a/net/http/http_proxy_client_socket.h
+++ b/net/http/http_proxy_client_socket.h
@@ -9,7 +9,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/completion_callback.h"
#include "net/base/host_port_pair.h"
@@ -84,8 +84,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
int GetPeerAddress(IPEndPoint* address) const override;
int GetLocalAddress(IPEndPoint* address) const override;
diff --git a/net/http/http_proxy_client_socket_pool.h b/net/http/http_proxy_client_socket_pool.h
index 9e550b6..44f9ab6 100644
--- a/net/http/http_proxy_client_socket_pool.h
+++ b/net/http/http_proxy_client_socket_pool.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/http/http_proxy_client_socket_wrapper.cc b/net/http/http_proxy_client_socket_wrapper.cc
index d69ed34..fef16e39 100644
--- a/net/http/http_proxy_client_socket_wrapper.cc
+++ b/net/http/http_proxy_client_socket_wrapper.cc
@@ -294,7 +294,7 @@
return ERR_SOCKET_NOT_CONNECTED;
}
-int HttpProxyClientSocketWrapper::SetReceiveBufferSize(int32 size) {
+int HttpProxyClientSocketWrapper::SetReceiveBufferSize(int32_t size) {
// TODO(mmenke): Should this persist across reconnects? Seems a little
// weird, and not done for normal reconnects.
if (transport_socket_)
@@ -302,7 +302,7 @@
return ERR_SOCKET_NOT_CONNECTED;
}
-int HttpProxyClientSocketWrapper::SetSendBufferSize(int32 size) {
+int HttpProxyClientSocketWrapper::SetSendBufferSize(int32_t size) {
if (transport_socket_)
return transport_socket_->SetSendBufferSize(size);
return ERR_SOCKET_NOT_CONNECTED;
diff --git a/net/http/http_proxy_client_socket_wrapper.h b/net/http/http_proxy_client_socket_wrapper.h
index f8010e6..70e3882 100644
--- a/net/http/http_proxy_client_socket_wrapper.h
+++ b/net/http/http_proxy_client_socket_wrapper.h
@@ -5,9 +5,11 @@
#ifndef NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_WRAPPER_H_
#define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_WRAPPER_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
@@ -110,8 +112,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
int GetPeerAddress(IPEndPoint* address) const override;
int GetLocalAddress(IPEndPoint* address) const override;
diff --git a/net/http/http_request_headers.h b/net/http/http_request_headers.h
index e6f25eda..76bf25e 100644
--- a/net/http/http_request_headers.h
+++ b/net/http/http_request_headers.h
@@ -13,7 +13,7 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/log/net_log.h"
diff --git a/net/http/http_request_info.h b/net/http/http_request_info.h
index a587a421..0c4c09d 100644
--- a/net/http/http_request_info.h
+++ b/net/http/http_request_info.h
@@ -7,7 +7,6 @@
#include <string>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
#include "net/base/privacy_mode.h"
#include "net/http/http_request_headers.h"
diff --git a/net/http/http_response_body_drainer.h b/net/http/http_response_body_drainer.h
index 3336822..2ff4a76 100644
--- a/net/http/http_response_body_drainer.h
+++ b/net/http/http_response_body_drainer.h
@@ -5,7 +5,7 @@
#ifndef NET_HTTP_HTTP_RESPONSE_BODY_DRAINER_H_
#define NET_HTTP_HTTP_RESPONSE_BODY_DRAINER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/timer/timer.h"
diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc
index 7699e84..4568cba 100644
--- a/net/http/http_response_body_drainer_unittest.cc
+++ b/net/http/http_response_body_drainer_unittest.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
index 467fceda..c0f8039a 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -361,10 +361,9 @@
MergeWithHeaders(new_raw_headers, empty_to_remove);
}
-void HttpResponseHeaders::UpdateWithNewRange(
- const HttpByteRange& byte_range,
- int64 resource_size,
- bool replace_status_line) {
+void HttpResponseHeaders::UpdateWithNewRange(const HttpByteRange& byte_range,
+ int64_t resource_size,
+ bool replace_status_line) {
DCHECK(byte_range.IsValid());
DCHECK(byte_range.HasFirstBytePosition());
DCHECK(byte_range.HasLastBytePosition());
@@ -375,9 +374,9 @@
RemoveHeader(kLengthHeader);
RemoveHeader(kRangeHeader);
- int64 start = byte_range.first_byte_position();
- int64 end = byte_range.last_byte_position();
- int64 range_len = end - start + 1;
+ int64_t start = byte_range.first_byte_position();
+ int64_t end = byte_range.last_byte_position();
+ int64_t range_len = end - start + 1;
if (replace_status_line)
ReplaceStatusLine("HTTP/1.1 206 Partial Content");
@@ -659,8 +658,8 @@
return HttpVersion();
}
- uint16 major = *p - '0';
- uint16 minor = *dot - '0';
+ uint16_t major = *p - '0';
+ uint16_t minor = *dot - '0';
return HttpVersion(major, minor);
}
@@ -763,7 +762,7 @@
base::StartsWith(value, directive,
base::CompareCase::INSENSITIVE_ASCII) &&
value[directive_size] == '=') {
- int64 seconds;
+ int64_t seconds;
base::StringToInt64(
StringPiece(value.begin() + directive_size + 1, value.end()),
&seconds);
@@ -1155,7 +1154,7 @@
if (!EnumerateHeader(NULL, "Age", &value))
return false;
- int64 seconds;
+ int64_t seconds;
base::StringToInt64(value, &seconds);
*result = TimeDelta::FromSeconds(seconds);
return true;
@@ -1250,11 +1249,11 @@
// From RFC 2616:
// Content-Length = "Content-Length" ":" 1*DIGIT
-int64 HttpResponseHeaders::GetContentLength() const {
+int64_t HttpResponseHeaders::GetContentLength() const {
return GetInt64HeaderValue("content-length");
}
-int64 HttpResponseHeaders::GetInt64HeaderValue(
+int64_t HttpResponseHeaders::GetInt64HeaderValue(
const std::string& header) const {
void* iter = NULL;
std::string content_length_val;
@@ -1267,7 +1266,7 @@
if (content_length_val[0] == '+')
return -1;
- int64 result;
+ int64_t result;
bool ok = base::StringToInt64(content_length_val, &result);
if (!ok || result < 0)
return -1;
@@ -1281,9 +1280,9 @@
// byte-range-resp-spec = (first-byte-pos "-" last-byte-pos) | "*"
// instance-length = 1*DIGIT
// bytes-unit = "bytes"
-bool HttpResponseHeaders::GetContentRange(int64* first_byte_position,
- int64* last_byte_position,
- int64* instance_length) const {
+bool HttpResponseHeaders::GetContentRange(int64_t* first_byte_position,
+ int64_t* last_byte_position,
+ int64_t* instance_length) const {
void* iter = NULL;
std::string content_range_spec;
*first_byte_position = *last_byte_position = *instance_length = -1;
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
index d24d12d3..91c223eb 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -5,11 +5,14 @@
#ifndef NET_HTTP_HTTP_RESPONSE_HEADERS_H_
#define NET_HTTP_HTTP_RESPONSE_HEADERS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -104,7 +107,7 @@
// |byte_range| must have a valid, bounded range (i.e. coming from a valid
// response or should be usable for a response).
void UpdateWithNewRange(const HttpByteRange& byte_range,
- int64 resource_size,
+ int64_t resource_size,
bool replace_status_line);
// Creates a normalized header string. The output will be formatted exactly
@@ -257,11 +260,11 @@
// Extracts the value of the Content-Length header or returns -1 if there is
// no such header in the response.
- int64 GetContentLength() const;
+ int64_t GetContentLength() const;
// Extracts the value of the specified header or returns -1 if there is no
// such header in the response.
- int64 GetInt64HeaderValue(const std::string& header) const;
+ int64_t GetInt64HeaderValue(const std::string& header) const;
// Extracts the values in a Content-Range header and returns true if they are
// valid for a 206 response; otherwise returns false.
@@ -270,9 +273,9 @@
// |*last_byte_position| = inclusive position of the last byte of the range
// |*instance_length| = size in bytes of the object requested
// If any of the above values is unknown, its value will be -1.
- bool GetContentRange(int64* first_byte_position,
- int64* last_byte_position,
- int64* instance_length) const;
+ bool GetContentRange(int64_t* first_byte_position,
+ int64_t* last_byte_position,
+ int64_t* instance_length) const;
// Returns true if the response is chunk-encoded.
bool IsChunkEncoded() const;
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
index fa9d63c..4c15210 100644
--- a/net/http/http_response_info.cc
+++ b/net/http/http_response_info.cc
@@ -179,7 +179,7 @@
}
// Read request-time
- int64 time_val;
+ int64_t time_val;
if (!iter.ReadInt64(&time_val))
return false;
request_time = Time::FromInternalValue(time_val);
@@ -229,7 +229,7 @@
for (int i = 0; i < num_scts; ++i) {
scoped_refptr<ct::SignedCertificateTimestamp> sct(
ct::SignedCertificateTimestamp::CreateFromPickle(&iter));
- uint16 status;
+ uint16_t status;
if (!sct.get() || !iter.ReadUInt16(&status))
return false;
ssl_info.signed_certificate_timestamps.push_back(
@@ -248,7 +248,7 @@
std::string socket_address_host;
if (iter.ReadString(&socket_address_host)) {
// If the host was written, we always expect the port to follow.
- uint16 socket_address_port;
+ uint16_t socket_address_port;
if (!iter.ReadUInt16(&socket_address_port))
return false;
socket_address = HostPortPair(socket_address_host, socket_address_port);
@@ -365,7 +365,7 @@
ssl_info.signed_certificate_timestamps.begin(); it !=
ssl_info.signed_certificate_timestamps.end(); ++it) {
it->sct->Persist(pickle);
- pickle->WriteUInt16(static_cast<uint16>(it->status));
+ pickle->WriteUInt16(static_cast<uint16_t>(it->status));
}
}
}
diff --git a/net/http/http_security_headers_unittest.cc b/net/http/http_security_headers_unittest.cc
index 4a510f2..9c09972 100644
--- a/net/http/http_security_headers_unittest.cc
+++ b/net/http/http_security_headers_unittest.cc
@@ -21,13 +21,13 @@
namespace {
-HashValue GetTestHashValue(uint8 label, HashValueTag tag) {
+HashValue GetTestHashValue(uint8_t label, HashValueTag tag) {
HashValue hash_value(tag);
memset(hash_value.data(), label, hash_value.size());
return hash_value;
}
-std::string GetTestPinImpl(uint8 label, HashValueTag tag, bool quoted) {
+std::string GetTestPinImpl(uint8_t label, HashValueTag tag, bool quoted) {
HashValue hash_value = GetTestHashValue(label, tag);
std::string base64;
base::Base64Encode(base::StringPiece(
@@ -50,11 +50,11 @@
return ret;
}
-std::string GetTestPin(uint8 label, HashValueTag tag) {
+std::string GetTestPin(uint8_t label, HashValueTag tag) {
return GetTestPinImpl(label, tag, true);
}
-std::string GetTestPinUnquoted(uint8 label, HashValueTag tag) {
+std::string GetTestPinUnquoted(uint8_t label, HashValueTag tag) {
return GetTestPinImpl(label, tag, false);
}
@@ -389,7 +389,7 @@
"max-age=39408299 ;incLudesUbdOmains", &max_age,
&include_subdomains));
expect_max_age = base::TimeDelta::FromSeconds(
- std::min(kMaxHSTSAgeSecs, static_cast<int64>(INT64_C(39408299))));
+ std::min(kMaxHSTSAgeSecs, static_cast<int64_t>(INT64_C(39408299))));
EXPECT_EQ(expect_max_age, max_age);
EXPECT_TRUE(include_subdomains);
@@ -397,7 +397,7 @@
"max-age=394082038 ; incLudesUbdOmains", &max_age,
&include_subdomains));
expect_max_age = base::TimeDelta::FromSeconds(
- std::min(kMaxHSTSAgeSecs, static_cast<int64>(INT64_C(394082038))));
+ std::min(kMaxHSTSAgeSecs, static_cast<int64_t>(INT64_C(394082038))));
EXPECT_EQ(expect_max_age, max_age);
EXPECT_TRUE(include_subdomains);
@@ -405,7 +405,7 @@
"max-age=394082038 ; incLudesUbdOmains;", &max_age,
&include_subdomains));
expect_max_age = base::TimeDelta::FromSeconds(
- std::min(kMaxHSTSAgeSecs, static_cast<int64>(INT64_C(394082038))));
+ std::min(kMaxHSTSAgeSecs, static_cast<int64_t>(INT64_C(394082038))));
EXPECT_EQ(expect_max_age, max_age);
EXPECT_TRUE(include_subdomains);
@@ -413,7 +413,7 @@
";; max-age=394082038 ; incLudesUbdOmains; ;", &max_age,
&include_subdomains));
expect_max_age = base::TimeDelta::FromSeconds(
- std::min(kMaxHSTSAgeSecs, static_cast<int64>(INT64_C(394082038))));
+ std::min(kMaxHSTSAgeSecs, static_cast<int64_t>(INT64_C(394082038))));
EXPECT_EQ(expect_max_age, max_age);
EXPECT_TRUE(include_subdomains);
@@ -421,7 +421,7 @@
";; max-age=394082038 ;", &max_age,
&include_subdomains));
expect_max_age = base::TimeDelta::FromSeconds(
- std::min(kMaxHSTSAgeSecs, static_cast<int64>(INT64_C(394082038))));
+ std::min(kMaxHSTSAgeSecs, static_cast<int64_t>(INT64_C(394082038))));
EXPECT_EQ(expect_max_age, max_age);
EXPECT_FALSE(include_subdomains);
@@ -429,7 +429,7 @@
";; ; ; max-age=394082038;;; includeSubdomains ;; ;", &max_age,
&include_subdomains));
expect_max_age = base::TimeDelta::FromSeconds(
- std::min(kMaxHSTSAgeSecs, static_cast<int64>(INT64_C(394082038))));
+ std::min(kMaxHSTSAgeSecs, static_cast<int64_t>(INT64_C(394082038))));
EXPECT_EQ(expect_max_age, max_age);
EXPECT_TRUE(include_subdomains);
@@ -437,7 +437,7 @@
"incLudesUbdOmains ; max-age=394082038 ;;", &max_age,
&include_subdomains));
expect_max_age = base::TimeDelta::FromSeconds(
- std::min(kMaxHSTSAgeSecs, static_cast<int64>(INT64_C(394082038))));
+ std::min(kMaxHSTSAgeSecs, static_cast<int64_t>(INT64_C(394082038))));
EXPECT_EQ(expect_max_age, max_age);
EXPECT_TRUE(include_subdomains);
@@ -530,7 +530,7 @@
"max-age=39408299 ;" + backup_pin + ";" + good_pin + "; ", chain_hashes,
&max_age, &include_subdomains, &hashes, &report_uri));
expect_max_age = base::TimeDelta::FromSeconds(
- std::min(kMaxHSTSAgeSecs, static_cast<int64>(INT64_C(39408299))));
+ std::min(kMaxHSTSAgeSecs, static_cast<int64_t>(INT64_C(39408299))));
EXPECT_EQ(expect_max_age, max_age);
EXPECT_FALSE(include_subdomains);
@@ -539,7 +539,7 @@
good_pin + ";" + backup_pin + "; ",
chain_hashes, &max_age, &include_subdomains, &hashes, &report_uri));
expect_max_age = base::TimeDelta::FromSeconds(
- std::min(kMaxHSTSAgeSecs, static_cast<int64>(INT64_C(394082038))));
+ std::min(kMaxHSTSAgeSecs, static_cast<int64_t>(INT64_C(394082038))));
EXPECT_EQ(expect_max_age, max_age);
EXPECT_TRUE(include_subdomains);
diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h
index 983828a..85b7285 100644
--- a/net/http/http_server_properties.h
+++ b/net/http/http_server_properties.h
@@ -5,13 +5,15 @@
#ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_H_
#define NET_HTTP_HTTP_SERVER_PROPERTIES_H_
+#include <stdint.h>
+
#include <map>
#include <string>
#include <tuple>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/mru_cache.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "net/base/host_port_pair.h"
@@ -101,7 +103,7 @@
AlternativeService(AlternateProtocol protocol,
const std::string& host,
- uint16 port)
+ uint16_t port)
: protocol(protocol), host(host), port(port) {}
AlternativeService(AlternateProtocol protocol,
@@ -134,7 +136,7 @@
AlternateProtocol protocol;
std::string host;
- uint16 port;
+ uint16_t port;
};
struct NET_EXPORT AlternativeServiceInfo {
@@ -149,7 +151,7 @@
AlternativeServiceInfo(AlternateProtocol protocol,
const std::string& host,
- uint16 port,
+ uint16_t port,
double probability,
base::Time expiration)
: alternative_service(protocol, host, port),
@@ -342,7 +344,7 @@
virtual bool SetSpdySetting(const HostPortPair& host_port_pair,
SpdySettingsIds id,
SpdySettingsFlags flags,
- uint32 value) = 0;
+ uint32_t value) = 0;
// Clears all SPDY settings for a host.
virtual void ClearSpdySettings(const HostPortPair& host_port_pair) = 0;
diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc
index 0c184d2..5e425851 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -22,7 +22,7 @@
namespace {
-const uint64 kBrokenAlternativeProtocolDelaySecs = 300;
+const uint64_t kBrokenAlternativeProtocolDelaySecs = 300;
} // namespace
@@ -71,7 +71,7 @@
void HttpServerPropertiesImpl::InitializeAlternativeServiceServers(
AlternativeServiceMap* alternative_service_map) {
- int32 size_diff =
+ int32_t size_diff =
alternative_service_map->size() - alternative_service_map_.size();
if (size_diff > 0) {
UMA_HISTOGRAM_COUNTS("Net.AlternativeServiceServers.MorePrefsEntries",
@@ -104,7 +104,7 @@
}
// Attempt to find canonical servers.
- uint16 canonical_ports[] = { 80, 443 };
+ uint16_t canonical_ports[] = {80, 443};
for (size_t i = 0; i < canonical_suffixes_.size(); ++i) {
std::string canonical_suffix = canonical_suffixes_[i];
for (size_t j = 0; j < arraysize(canonical_ports); ++j) {
@@ -580,7 +580,7 @@
const HostPortPair& host_port_pair,
SpdySettingsIds id,
SpdySettingsFlags flags,
- uint32 value) {
+ uint32_t value) {
if (!(flags & SETTINGS_FLAG_PLEASE_PERSIST))
return false;
diff --git a/net/http/http_server_properties_impl.h b/net/http/http_server_properties_impl.h
index 093f5d20..a169362 100644
--- a/net/http/http_server_properties_impl.h
+++ b/net/http/http_server_properties_impl.h
@@ -5,14 +5,17 @@
#ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_
#define NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <deque>
#include <map>
#include <set>
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/threading/non_thread_safe.h"
#include "base/values.h"
#include "net/base/host_port_pair.h"
@@ -116,7 +119,7 @@
bool SetSpdySetting(const HostPortPair& host_port_pair,
SpdySettingsIds id,
SpdySettingsFlags flags,
- uint32 value) override;
+ uint32_t value) override;
void ClearSpdySettings(const HostPortPair& host_port_pair) override;
void ClearAllSpdySettings() override;
const SpdySettingsMap& spdy_settings_map() const override;
diff --git a/net/http/http_server_properties_impl_unittest.cc b/net/http/http_server_properties_impl_unittest.cc
index 5bc43f4..cf24fc7 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -7,7 +7,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -51,7 +50,7 @@
struct SpdySettingsDataToVerify {
HostPortPair spdy_server;
- uint32 value;
+ uint32_t value;
};
class HttpServerPropertiesImplTest : public testing::Test {
@@ -73,7 +72,7 @@
void InitializeSpdySettingsUploadBandwidth(SpdySettingsMap* spdy_settings_map,
const HostPortPair& spdy_server,
- uint32 value) {
+ uint32_t value) {
SettingsMap settings_map;
settings_map[kSpdySettingsId] =
SettingsFlagsAndValue(kSpdySettingsFlags, value);
@@ -1109,7 +1108,7 @@
HostPortPair spdy_server_google("www.google.com", 443);
const SpdySettingsIds id1 = SETTINGS_UPLOAD_BANDWIDTH;
const SpdySettingsFlags flags1 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value1 = 31337;
+ const uint32_t value1 = 31337;
EXPECT_TRUE(impl_.SetSpdySetting(spdy_server_google, id1, flags1, value1));
// Check the values.
const SettingsMap& settings_map1_ret =
@@ -1125,7 +1124,7 @@
HostPortPair spdy_server_mail("mail.google.com", 443);
const SpdySettingsIds id2 = SETTINGS_DOWNLOAD_BANDWIDTH;
const SpdySettingsFlags flags2 = SETTINGS_FLAG_NONE;
- const uint32 value2 = 62667;
+ const uint32_t value2 = 62667;
EXPECT_FALSE(impl_.SetSpdySetting(spdy_server_mail, id2, flags2, value2));
const SettingsMap& settings_map2_ret =
impl_.GetSpdySettings(spdy_server_mail);
@@ -1135,7 +1134,7 @@
HostPortPair spdy_server_docs("docs.google.com", 443);
const SpdySettingsIds id3 = SETTINGS_ROUND_TRIP_TIME;
const SpdySettingsFlags flags3 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value3 = 93997;
+ const uint32_t value3 = 93997;
SettingsFlagsAndValue flags_and_value3(flags3, value3);
EXPECT_TRUE(impl_.SetSpdySetting(spdy_server_docs, id3, flags3, value3));
// Check the values.
@@ -1176,7 +1175,7 @@
HostPortPair spdy_server_google("www.google.com", 443);
const SpdySettingsIds id1 = SETTINGS_UPLOAD_BANDWIDTH;
const SpdySettingsFlags flags1 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value1 = 31337;
+ const uint32_t value1 = 31337;
EXPECT_TRUE(impl_.SetSpdySetting(spdy_server_google, id1, flags1, value1));
// Check the values.
const SettingsMap& settings_map1_ret =
@@ -1192,7 +1191,7 @@
HostPortPair spdy_server_docs("docs.google.com", 443);
const SpdySettingsIds id3 = SETTINGS_ROUND_TRIP_TIME;
const SpdySettingsFlags flags3 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value3 = 93997;
+ const uint32_t value3 = 93997;
EXPECT_TRUE(impl_.SetSpdySetting(spdy_server_docs, id3, flags3, value3));
// Check the values.
const SettingsMap& settings_map3_ret =
@@ -1214,14 +1213,14 @@
HostPortPair spdy_server_google("www.google.com", 443);
const SpdySettingsIds id1 = SETTINGS_UPLOAD_BANDWIDTH;
const SpdySettingsFlags flags1 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value1 = 31337;
+ const uint32_t value1 = 31337;
EXPECT_TRUE(impl_.SetSpdySetting(spdy_server_google, id1, flags1, value1));
// Add docs.google.com:443 as persisting
HostPortPair spdy_server_docs("docs.google.com", 443);
const SpdySettingsIds id2 = SETTINGS_ROUND_TRIP_TIME;
const SpdySettingsFlags flags2 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value2 = 93997;
+ const uint32_t value2 = 93997;
EXPECT_TRUE(impl_.SetSpdySetting(spdy_server_docs, id2, flags2, value2));
// Verify the first element is docs.google.com:443.
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc
index 8f8b581..65a5662 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -23,12 +23,12 @@
// Time to wait before starting an update the http_server_properties_impl_ cache
// from preferences. Scheduling another update during this period will reset the
// timer.
-const int64 kUpdateCacheDelayMs = 1000;
+const int64_t kUpdateCacheDelayMs = 1000;
// Time to wait before starting an update the preferences from the
// http_server_properties_impl_ cache. Scheduling another update during this
// period will reset the timer.
-const int64 kUpdatePrefsDelayMs = 60000;
+const int64_t kUpdatePrefsDelayMs = 60000;
// "version" 0 indicates, http_server_properties doesn't have "version"
// property.
@@ -310,7 +310,7 @@
const HostPortPair& host_port_pair,
SpdySettingsIds id,
SpdySettingsFlags flags,
- uint32 value) {
+ uint32_t value) {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
bool persist = http_server_properties_impl_->SetSpdySetting(
host_port_pair, id, flags, value);
@@ -594,7 +594,7 @@
return false;
}
alternative_service_info->alternative_service.port =
- static_cast<uint32>(port);
+ static_cast<uint32_t>(port);
// Probability is optional, defaults to 1.0.
alternative_service_info->probability = 1.0;
@@ -617,7 +617,7 @@
std::string expiration_string;
if (alternative_service_dict.GetStringWithoutPathExpansion(
kExpirationKey, &expiration_string)) {
- int64 expiration_int64 = 0;
+ int64_t expiration_int64 = 0;
if (!base::StringToInt64(expiration_string, &expiration_int64)) {
DVLOG(1) << "Malformed alternative service expiration for server: "
<< server_str;
@@ -1069,7 +1069,7 @@
for (SettingsMap::const_iterator it = settings_map->begin();
it != settings_map->end(); ++it) {
SpdySettingsIds id = it->first;
- uint32 value = it->second.second;
+ uint32_t value = it->second.second;
std::string key = base::StringPrintf("%u", id);
spdy_settings_dict->SetInteger(key, value);
}
@@ -1098,7 +1098,7 @@
kProtocolKey, AlternateProtocolToString(alternative_service.protocol));
alternative_service_dict->SetDouble(kProbabilityKey,
alternative_service_info.probability);
- // JSON cannot store int64, so expiration is converted to a string.
+ // JSON cannot store int64_t, so expiration is converted to a string.
alternative_service_dict->SetString(
kExpirationKey,
base::Int64ToString(
@@ -1132,7 +1132,7 @@
return;
base::DictionaryValue* server_network_stats_dict = new base::DictionaryValue;
- // Becasue JSON doesn't support int64, persist int64 as a string.
+ // Becasue JSON doesn't support int64_t, persist int64_t as a string.
server_network_stats_dict->SetInteger(
kSrttKey, static_cast<int>(server_network_stats->srtt.ToInternalValue()));
// TODO(rtenneti): When QUIC starts using bandwidth_estimate, then persist
diff --git a/net/http/http_server_properties_manager.h b/net/http/http_server_properties_manager.h
index b4f06f4..ef881572 100644
--- a/net/http/http_server_properties_manager.h
+++ b/net/http/http_server_properties_manager.h
@@ -5,12 +5,14 @@
#ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_
#define NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/prefs/pref_change_registrar.h"
@@ -116,7 +118,7 @@
bool SetSpdySetting(const HostPortPair& host_port_pair,
SpdySettingsIds id,
SpdySettingsFlags flags,
- uint32 value) override;
+ uint32_t value) override;
void ClearSpdySettings(const HostPortPair& host_port_pair) override;
void ClearAllSpdySettings() override;
const SpdySettingsMap& spdy_settings_map() const override;
diff --git a/net/http/http_server_properties_manager_unittest.cc b/net/http/http_server_properties_manager_unittest.cc
index b093c61e..5461872 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -4,9 +4,9 @@
#include "net/http/http_server_properties_manager.h"
-#include "base/basictypes.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/testing_pref_service.h"
@@ -467,7 +467,7 @@
HostPortPair spdy_server_mail("mail.google.com", 443);
const SpdySettingsIds id1 = SETTINGS_UPLOAD_BANDWIDTH;
const SpdySettingsFlags flags1 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value1 = 31337;
+ const uint32_t value1 = 31337;
http_server_props_manager_->SetSpdySetting(
spdy_server_mail, id1, flags1, value1);
@@ -494,7 +494,7 @@
HostPortPair spdy_server_mail("mail.google.com", 443);
const SpdySettingsIds id1 = SETTINGS_UPLOAD_BANDWIDTH;
const SpdySettingsFlags flags1 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value1 = 31337;
+ const uint32_t value1 = 31337;
http_server_props_manager_->SetSpdySetting(
spdy_server_mail, id1, flags1, value1);
@@ -533,7 +533,7 @@
HostPortPair spdy_server_mail("mail.google.com", 443);
const SpdySettingsIds id1 = SETTINGS_UPLOAD_BANDWIDTH;
const SpdySettingsFlags flags1 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value1 = 31337;
+ const uint32_t value1 = 31337;
http_server_props_manager_->SetSpdySetting(
spdy_server_mail, id1, flags1, value1);
@@ -790,7 +790,7 @@
const SpdySettingsIds id1 = SETTINGS_UPLOAD_BANDWIDTH;
const SpdySettingsFlags flags1 = SETTINGS_FLAG_PLEASE_PERSIST;
- const uint32 value1 = 31337;
+ const uint32_t value1 = 31337;
http_server_props_manager_->SetSpdySetting(spdy_server_mail, id1, flags1,
value1);
@@ -1021,7 +1021,7 @@
EXPECT_EQ("", alternative_service_info_vector[1].alternative_service.host);
EXPECT_EQ(123, alternative_service_info_vector[1].alternative_service.port);
EXPECT_DOUBLE_EQ(0.7, alternative_service_info_vector[1].probability);
- // numeric_limits<int64>::max() represents base::Time::Max().
+ // numeric_limits<int64_t>::max() represents base::Time::Max().
EXPECT_EQ(base::Time::Max(), alternative_service_info_vector[1].expiration);
EXPECT_EQ(NPN_HTTP_2,
diff --git a/net/http/http_status_line_validator.h b/net/http/http_status_line_validator.h
index 1bfa69f..1a12cd03 100644
--- a/net/http/http_status_line_validator.h
+++ b/net/http/http_status_line_validator.h
@@ -5,9 +5,11 @@
#ifndef NET_HTTP_HTTP_STATUS_LINE_VALIDATOR_H_
#define NET_HTTP_HTTP_STATUS_LINE_VALIDATOR_H_
+#include <stddef.h>
+
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
diff --git a/net/http/http_stream.h b/net/http/http_stream.h
index 4640804..b7e7888 100644
--- a/net/http/http_stream.h
+++ b/net/http/http_stream.h
@@ -13,7 +13,7 @@
#include <stdint.h>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
#include "net/base/net_error_details.h"
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc
index 0038a8a3..d6d76b4 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -59,7 +59,7 @@
if (protocol == QUIC && !alternative_service_entry.version.empty()) {
bool match_found = false;
for (QuicVersion supported : session.params().quic_supported_versions) {
- for (uint16 advertised : alternative_service_entry.version) {
+ for (uint16_t advertised : alternative_service_entry.version) {
if (supported == advertised) {
match_found = true;
break;
@@ -152,8 +152,8 @@
http_server_properties->SetAlternativeService(
RewriteHost(http_host_port_pair),
- AlternativeService(protocol, "", static_cast<uint16>(port)), probability,
- base::Time::Now() + base::TimeDelta::FromDays(30));
+ AlternativeService(protocol, "", static_cast<uint16_t>(port)),
+ probability, base::Time::Now() + base::TimeDelta::FromDays(30));
}
GURL HttpStreamFactory::ApplyHostMappingRules(const GURL& url,
diff --git a/net/http/http_stream_factory.h b/net/http/http_stream_factory.h
index c2f4b6e9..68e6810 100644
--- a/net/http/http_stream_factory.h
+++ b/net/http/http_stream_factory.h
@@ -8,7 +8,7 @@
#include <list>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "net/base/completion_callback.h"
diff --git a/net/http/http_stream_factory_impl.h b/net/http/http_stream_factory_impl.h
index 6ed8b2cc..da1de979 100644
--- a/net/http/http_stream_factory_impl.h
+++ b/net/http/http_stream_factory_impl.h
@@ -5,11 +5,14 @@
#ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_
#define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_
+#include <stddef.h>
+
#include <map>
#include <set>
#include <vector>
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/host_port_pair.h"
#include "net/http/http_stream_factory.h"
diff --git a/net/http/http_stream_factory_impl_job.h b/net/http/http_stream_factory_impl_job.h
index 81b812a..94c1b74 100644
--- a/net/http/http_stream_factory_impl_job.h
+++ b/net/http/http_stream_factory_impl_job.h
@@ -5,6 +5,7 @@
#ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_
#define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/http/http_stream_factory_impl_request.h b/net/http/http_stream_factory_impl_request.h
index e65dac88..dfa9d2e 100644
--- a/net/http/http_stream_factory_impl_request.h
+++ b/net/http/http_stream_factory_impl_request.h
@@ -6,6 +6,8 @@
#define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_REQUEST_H_
#include <set>
+
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/http/http_stream_factory_impl.h"
#include "net/log/net_log.h"
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc
index 91a350b..7653e8f 100644
--- a/net/http/http_stream_factory_impl_unittest.cc
+++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -9,8 +9,8 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/port_util.h"
#include "net/base/test_completion_callback.h"
#include "net/cert/mock_cert_verifier.h"
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 4e4b6b6..2372065 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -44,7 +44,7 @@
NUM_HEADER_EVENTS);
}
-const uint64 kMaxMergedHeaderAndBodySize = 1400;
+const uint64_t kMaxMergedHeaderAndBodySize = 1400;
const size_t kRequestBodyBufferSize = 1 << 14; // 16KB
std::string GetResponseHeaderLines(const HttpResponseHeaders& headers) {
@@ -79,7 +79,7 @@
}
scoped_ptr<base::Value> NetLogSendRequestBodyCallback(
- uint64 length,
+ uint64_t length,
bool is_chunked,
bool did_merge,
NetLogCaptureMode /* capture_mode */) {
@@ -287,7 +287,7 @@
memcpy(request_headers_->data(), request.data(), request_headers_length_);
request_headers_->DidConsume(request_headers_length_);
- uint64 todo = request_->upload_data_stream->size();
+ uint64_t todo = request_->upload_data_stream->size();
while (todo) {
int consumed = request_->upload_data_stream->Read(
request_headers_.get(), static_cast<int>(todo), CompletionCallback());
@@ -735,7 +735,7 @@
if (chunked_decoder_.get()) {
save_amount = chunked_decoder_->bytes_after_eof();
} else if (response_body_length_ >= 0) {
- int64 extra_data_read = response_body_read_ - response_body_length_;
+ int64_t extra_data_read = response_body_read_ - response_body_length_;
if (extra_data_read > 0) {
save_amount = static_cast<int>(extra_data_read);
if (result > 0)
@@ -1130,7 +1130,7 @@
// IsInMemory() ensures that the request body is not chunked.
request_body->IsInMemory() &&
request_body->size() > 0) {
- uint64 merged_size = request_headers.size() + request_body->size();
+ uint64_t merged_size = request_headers.size() + request_body->size();
if (merged_size <= kMaxMergedHeaderAndBodySize)
return true;
}
diff --git a/net/http/http_stream_parser.h b/net/http/http_stream_parser.h
index f8700c4..d51cb91 100644
--- a/net/http/http_stream_parser.h
+++ b/net/http/http_stream_parser.h
@@ -5,11 +5,12 @@
#ifndef NET_HTTP_HTTP_STREAM_PARSER_H_
#define NET_HTTP_HTTP_STREAM_PARSER_H_
+#include <stddef.h>
#include <stdint.h>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -226,10 +227,10 @@
// Indicates the content length. If this value is less than zero
// (and chunked_decoder_ is null), then we must read until the server
// closes the connection.
- int64 response_body_length_;
+ int64_t response_body_length_;
// Keep track of the number of response body bytes read so far.
- int64 response_body_read_;
+ int64_t response_body_read_;
// Helper if the data is chunked.
scoped_ptr<HttpChunkedDecoder> chunked_decoder_;
diff --git a/net/http/http_stream_parser_unittest.cc b/net/http/http_stream_parser_unittest.cc
index 77da8b2..2651edc2 100644
--- a/net/http/http_stream_parser_unittest.cc
+++ b/net/http/http_stream_parser_unittest.cc
@@ -1035,12 +1035,12 @@
get_runner.AddRead(response);
get_runner.SetupParserAndSendRequest();
get_runner.ReadHeaders();
- int64 headers_size = headers.size();
+ int64_t headers_size = headers.size();
EXPECT_EQ(headers_size, get_runner.parser()->received_bytes());
int body_size = body.size();
int read_lengths[] = {body_size, 0};
get_runner.ReadBody(body_size, read_lengths);
- int64 response_size = response.size();
+ int64_t response_size = response.size();
EXPECT_EQ(response_size, get_runner.parser()->received_bytes());
}
@@ -1059,14 +1059,14 @@
get_runner.SetupParserAndSendRequest();
get_runner.ReadHeaders();
EXPECT_EQ(39, get_runner.parser()->received_bytes());
- int64 headers_size = headers.size();
+ int64_t headers_size = headers.size();
EXPECT_EQ(headers_size, get_runner.parser()->received_bytes());
int body_size = body.size();
int read_lengths[] = {body_size, 0};
get_runner.ReadBody(body_size, read_lengths);
- int64 response_size = response.size();
+ int64_t response_size = response.size();
EXPECT_EQ(response_size, get_runner.parser()->received_bytes());
- int64 next_response_size = next_response.size();
+ int64_t next_response_size = next_response.size();
EXPECT_EQ(next_response_size, get_runner.read_buffer()->offset());
}
@@ -1080,7 +1080,7 @@
TEST(HttpStreamParser, ReceivedBytesMultiReadExcludesNextResponse) {
std::string headers = "HTTP/1.1 200 OK\r\n"
"Content-Length: 36\r\n\r\n";
- int64 user_buf_len = 32;
+ int64_t user_buf_len = 32;
std::string body_start = std::string(user_buf_len, '#');
int body_start_size = body_start.size();
EXPECT_EQ(user_buf_len, body_start_size);
@@ -1094,14 +1094,14 @@
get_runner.AddRead(response_end);
get_runner.SetupParserAndSendRequest();
get_runner.ReadHeaders();
- int64 headers_size = headers.size();
+ int64_t headers_size = headers.size();
EXPECT_EQ(headers_size, get_runner.parser()->received_bytes());
int body_end_size = body_end.size();
int read_lengths[] = {body_start_size, body_end_size, 0};
get_runner.ReadBody(body_start_size, read_lengths);
- int64 response_size = response_start.size() + body_end_size;
+ int64_t response_size = response_start.size() + body_end_size;
EXPECT_EQ(response_size, get_runner.parser()->received_bytes());
- int64 next_response_size = next_response.size();
+ int64_t next_response_size = next_response.size();
EXPECT_EQ(next_response_size, get_runner.read_buffer()->offset());
}
@@ -1121,14 +1121,14 @@
get_runner.AddInitialData(data);
get_runner.SetupParserAndSendRequest();
get_runner.ReadHeaders();
- int64 headers_size = headers.size();
+ int64_t headers_size = headers.size();
EXPECT_EQ(headers_size, get_runner.parser()->received_bytes());
int body_size = body.size();
int read_lengths[] = {body_size, 0};
get_runner.ReadBody(body_size, read_lengths);
- int64 response_size = response.size();
+ int64_t response_size = response.size();
EXPECT_EQ(response_size, get_runner.parser()->received_bytes());
- int64 next_response_size = next_response.size();
+ int64_t next_response_size = next_response.size();
EXPECT_EQ(next_response_size, get_runner.read_buffer()->offset());
}
@@ -1137,7 +1137,7 @@
TEST(HttpStreamParser, ReceivedBytesUseReadBuf) {
std::string buffer = "HTTP/1.1 200 OK\r\n";
std::string remaining_headers = "Content-Length: 7\r\n\r\n";
- int64 headers_size = buffer.size() + remaining_headers.size();
+ int64_t headers_size = buffer.size() + remaining_headers.size();
std::string body = "content";
std::string response = remaining_headers + body;
@@ -1172,9 +1172,9 @@
get_runner.ReadHeaders();
int read_lengths[] = {4, 3, 6, 2, 6, 0};
get_runner.ReadBody(7, read_lengths);
- int64 response_size = response.size();
+ int64_t response_size = response.size();
EXPECT_EQ(response_size, get_runner.parser()->received_bytes());
- int64 next_response_size = next_response.size();
+ int64_t next_response_size = next_response.size();
EXPECT_EQ(next_response_size, get_runner.read_buffer()->offset());
}
@@ -1200,11 +1200,11 @@
get_runner.AddRead(blocks[i]);
get_runner.SetupParserAndSendRequest();
get_runner.ReadHeaders();
- int64 headers_size = headers.size();
+ int64_t headers_size = headers.size();
EXPECT_EQ(headers_size, get_runner.parser()->received_bytes());
int read_lengths[] = {1, 4, 4, 4, 4, 4, 4, 4, 4, 0};
get_runner.ReadBody(receive_length + 1, read_lengths);
- int64 response_size = response.size();
+ int64_t response_size = response.size();
EXPECT_EQ(response_size, get_runner.parser()->received_bytes());
}
@@ -1213,7 +1213,7 @@
std::string status100 = "HTTP/1.1 100 OK\r\n\r\n";
std::string headers = "HTTP/1.1 200 OK\r\n"
"Content-Length: 7\r\n\r\n";
- int64 headers_size = status100.size() + headers.size();
+ int64_t headers_size = status100.size() + headers.size();
std::string body = "content";
std::string response = headers + body;
@@ -1223,12 +1223,12 @@
get_runner.SetupParserAndSendRequest();
get_runner.ReadHeaders();
EXPECT_EQ(100, get_runner.response_info()->headers->response_code());
- int64 status100_size = status100.size();
+ int64_t status100_size = status100.size();
EXPECT_EQ(status100_size, get_runner.parser()->received_bytes());
get_runner.ReadHeaders();
EXPECT_EQ(200, get_runner.response_info()->headers->response_code());
EXPECT_EQ(headers_size, get_runner.parser()->received_bytes());
- int64 response_size = headers_size + body.size();
+ int64_t response_size = headers_size + body.size();
int body_size = body.size();
int read_lengths[] = {body_size, 0};
get_runner.ReadBody(body_size, read_lengths);
diff --git a/net/http/http_util.cc b/net/http/http_util.cc
index f1e5143..2b3db6d 100644
--- a/net/http/http_util.cc
+++ b/net/http/http_util.cc
@@ -9,7 +9,6 @@
#include <algorithm>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
@@ -18,7 +17,6 @@
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
-
namespace net {
// Helpers --------------------------------------------------------------------
@@ -210,7 +208,7 @@
HttpByteRange range;
// Try to obtain first-byte-pos.
if (!first_byte_pos.empty()) {
- int64 first_byte_position = -1;
+ int64_t first_byte_position = -1;
if (!base::StringToInt64(first_byte_pos, &first_byte_position))
return false;
range.set_first_byte_position(first_byte_position);
@@ -225,7 +223,7 @@
// We have last-byte-pos or suffix-byte-range-spec in this case.
if (!last_byte_pos.empty()) {
- int64 last_byte_position;
+ int64_t last_byte_position;
if (!base::StringToInt64(last_byte_pos, &last_byte_position))
return false;
if (range.HasFirstBytePosition())
diff --git a/net/http/http_util.h b/net/http/http_util.h
index 1bb3c93..21a1f42 100644
--- a/net/http/http_util.h
+++ b/net/http/http_util.h
@@ -5,6 +5,8 @@
#ifndef NET_HTTP_HTTP_UTIL_H_
#define NET_HTTP_HTTP_UTIL_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc
index a5c984d..90750e9 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -4,7 +4,6 @@
#include <algorithm>
-#include "base/basictypes.h"
#include "base/strings/string_util.h"
#include "net/http/http_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -766,9 +765,9 @@
bool expected_return_value;
size_t expected_ranges_size;
const struct {
- int64 expected_first_byte_position;
- int64 expected_last_byte_position;
- int64 expected_suffix_length;
+ int64_t expected_first_byte_position;
+ int64_t expected_last_byte_position;
+ int64_t expected_suffix_length;
} expected_ranges[10];
} tests[] = {
{ "Range: bytes=0-10",
diff --git a/net/http/http_version.h b/net/http/http_version.h
index 127e711..13864a6 100644
--- a/net/http/http_version.h
+++ b/net/http/http_version.h
@@ -5,7 +5,7 @@
#ifndef NET_HTTP_HTTP_VERSION_H_
#define NET_HTTP_HTTP_VERSION_H_
-#include "base/basictypes.h"
+#include <stdint.h>
namespace net {
@@ -16,17 +16,13 @@
HttpVersion() : value_(0) { }
// Build from unsigned major/minor pair.
- HttpVersion(uint16 major, uint16 minor) : value_(major << 16 | minor) { }
+ HttpVersion(uint16_t major, uint16_t minor) : value_(major << 16 | minor) {}
// Major version number.
- uint16 major_value() const {
- return value_ >> 16;
- }
+ uint16_t major_value() const { return value_ >> 16; }
// Minor version number.
- uint16 minor_value() const {
- return value_ & 0xffff;
- }
+ uint16_t minor_value() const { return value_ & 0xffff; }
// Overloaded operators:
@@ -50,7 +46,7 @@
}
private:
- uint32 value_; // Packed as <major>:<minor>
+ uint32_t value_; // Packed as <major>:<minor>
};
} // namespace net
diff --git a/net/http/md4.cc b/net/http/md4.cc
index da1e8d3..7de9cb0b 100644
--- a/net/http/md4.cc
+++ b/net/http/md4.cc
@@ -49,8 +49,8 @@
#include <string.h>
-typedef uint32 Uint32;
-typedef uint8 Uint8;
+typedef uint32_t Uint32;
+typedef uint8_t Uint8;
/* the "conditional" function */
#define F(x,y,z) (((x) & (y)) | (~(x) & (z)))
diff --git a/net/http/md4.h b/net/http/md4.h
index b416e26..0b74df5 100644
--- a/net/http/md4.h
+++ b/net/http/md4.h
@@ -44,7 +44,7 @@
#ifndef NET_HTTP_MD4_H_
#define NET_HTTP_MD4_H_
-#include "base/basictypes.h"
+#include <stdint.h>
namespace net {
namespace weak_crypto {
@@ -66,7 +66,7 @@
* interface would make more sense if that were a requirement. Currently, this
* is good enough for the applications we care about.
*/
-void MD4Sum(const uint8 *input, uint32 inputLen, uint8 *result);
+void MD4Sum(const uint8_t* input, uint32_t inputLen, uint8_t* result);
} // namespace net::weak_crypto
} // namespace net
diff --git a/net/http/mock_sspi_library_win.cc b/net/http/mock_sspi_library_win.cc
index 7721853..1d3379c 100644
--- a/net/http/mock_sspi_library_win.cc
+++ b/net/http/mock_sspi_library_win.cc
@@ -47,7 +47,7 @@
// Fill in the outbound buffer with garbage data.
PSecBuffer out_buffer = pOutput->pBuffers;
out_buffer->cbBuffer = 2;
- uint8* buf = reinterpret_cast<uint8 *>(out_buffer->pvBuffer);
+ uint8_t* buf = reinterpret_cast<uint8_t*>(out_buffer->pvBuffer);
buf[0] = 0xAB;
buf[1] = 0xBA;
diff --git a/net/http/proxy_client_socket.h b/net/http/proxy_client_socket.h
index 2d6688f..b240689b 100644
--- a/net/http/proxy_client_socket.h
+++ b/net/http/proxy_client_socket.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "net/socket/ssl_client_socket.h"
#include "net/socket/stream_socket.h"
diff --git a/net/http/transport_security_persister.h b/net/http/transport_security_persister.h
index 27ecc23c..d4e1e36a 100644
--- a/net/http/transport_security_persister.h
+++ b/net/http/transport_security_persister.h
@@ -37,6 +37,7 @@
#include "base/files/file_path.h"
#include "base/files/important_file_writer.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc
index 47bfea4..5f2b010 100644
--- a/net/http/transport_security_state.cc
+++ b/net/http/transport_security_state.cc
@@ -222,7 +222,7 @@
// BitReader is a class that allows a bytestring to be read bit-by-bit.
class BitReader {
public:
- BitReader(const uint8* bytes, size_t num_bits)
+ BitReader(const uint8_t* bytes, size_t num_bits)
: bytes_(bytes),
num_bits_(num_bits),
num_bytes_((num_bits + 7) / 8),
@@ -248,16 +248,16 @@
// Read sets the |num_bits| least-significant bits of |*out| to the value of
// the next |num_bits| bits from the input. It returns false if there are
// insufficient bits in the input or true otherwise.
- bool Read(unsigned num_bits, uint32* out) {
+ bool Read(unsigned num_bits, uint32_t* out) {
DCHECK_LE(num_bits, 32u);
- uint32 ret = 0;
+ uint32_t ret = 0;
for (unsigned i = 0; i < num_bits; ++i) {
bool bit;
if (!Next(&bit)) {
return false;
}
- ret |= static_cast<uint32>(bit) << (num_bits - 1 - i);
+ ret |= static_cast<uint32_t>(bit) << (num_bits - 1 - i);
}
*out = ret;
@@ -299,13 +299,13 @@
}
private:
- const uint8* const bytes_;
+ const uint8_t* const bytes_;
const size_t num_bits_;
const size_t num_bytes_;
// current_byte_index_ contains the current byte offset in |bytes_|.
size_t current_byte_index_;
// current_byte_ contains the current byte of the input.
- uint8 current_byte_;
+ uint8_t current_byte_;
// num_bits_used_ contains the number of bits of |current_byte_| that have
// been read.
unsigned num_bits_used_;
@@ -320,11 +320,11 @@
// The tree is decoded by walking rather than a table-driven approach.
class HuffmanDecoder {
public:
- HuffmanDecoder(const uint8* tree, size_t tree_bytes)
+ HuffmanDecoder(const uint8_t* tree, size_t tree_bytes)
: tree_(tree), tree_bytes_(tree_bytes) {}
bool Decode(BitReader* reader, char* out) {
- const uint8* current = &tree_[tree_bytes_ - 2];
+ const uint8_t* current = &tree_[tree_bytes_ - 2];
for (;;) {
bool bit;
@@ -332,7 +332,7 @@
return false;
}
- uint8 b = current[bit];
+ uint8_t b = current[bit];
if (b & 0x80) {
*out = static_cast<char>(b & 0x7f);
return true;
@@ -349,15 +349,15 @@
}
private:
- const uint8* const tree_;
+ const uint8_t* const tree_;
const size_t tree_bytes_;
};
// PreloadResult is the result of resolving a specific name in the preloaded
// data.
struct PreloadResult {
- uint32 pinset_id;
- uint32 domain_id;
+ uint32_t pinset_id;
+ uint32_t domain_id;
// hostname_offset contains the number of bytes from the start of the given
// hostname where the name of the matching entry starts.
size_t hostname_offset;
@@ -366,7 +366,7 @@
bool force_https;
bool has_pins;
bool expect_ct;
- uint32 expect_ct_report_uri_id;
+ uint32_t expect_ct_report_uri_id;
};
// DecodeHSTSPreloadRaw resolves |hostname| in the preloaded data. It returns
@@ -527,8 +527,8 @@
if (is_first_offset) {
// The first offset is backwards from the current position.
- uint32 jump_delta_bits;
- uint32 jump_delta;
+ uint32_t jump_delta_bits;
+ uint32_t jump_delta;
if (!reader.Read(5, &jump_delta_bits) ||
!reader.Read(jump_delta_bits, &jump_delta)) {
return false;
@@ -542,18 +542,18 @@
is_first_offset = false;
} else {
// Subsequent offsets are forward from the target of the first offset.
- uint32 is_long_jump;
+ uint32_t is_long_jump;
if (!reader.Read(1, &is_long_jump)) {
return false;
}
- uint32 jump_delta;
+ uint32_t jump_delta;
if (!is_long_jump) {
if (!reader.Read(7, &jump_delta)) {
return false;
}
} else {
- uint32 jump_delta_bits;
+ uint32_t jump_delta_bits;
if (!reader.Read(4, &jump_delta_bits) ||
!reader.Read(jump_delta_bits + 8, &jump_delta)) {
return false;
diff --git a/net/http/transport_security_state.h b/net/http/transport_security_state.h
index 4d3ab67..afdf6c3 100644
--- a/net/http/transport_security_state.h
+++ b/net/http/transport_security_state.h
@@ -13,6 +13,7 @@
#include <vector>
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/time.h"
#include "net/base/expiring_cache.h"
diff --git a/net/http/transport_security_state_static.h b/net/http/transport_security_state_static.h
index 3f61ae1..00e5687 100644
--- a/net/http/transport_security_state_static.h
+++ b/net/http/transport_security_state_static.h
@@ -8,6 +8,8 @@
#ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
#define NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
+#include <stdint.h>
+
enum SecondLevelDomainName {
DOMAIN_NOT_PINNED,
DOMAIN_GOOGLE_COM,
@@ -728,10 +730,11 @@
// kHSTSHuffmanTree describes a Huffman tree. The nodes of the tree are pairs
// of uint8s. The last node in the array is the root of the tree. Each pair is
-// two uint8 values, the first is "left" and the second is "right". If a uint8
+// two uint8_t values, the first is "left" and the second is "right". If a
+// uint8_t
// value has the MSB set then it represents a literal leaf value. Otherwise
// it's a pointer to the n'th element of the array.
-static const uint8 kHSTSHuffmanTree[] = {
+static const uint8_t kHSTSHuffmanTree[] = {
0xf0, 0xe4, 0x00, 0xf2, 0x01, 0x80, 0xf9, 0xe6, 0x03, 0xe7, 0xe9, 0x04,
0xb7, 0xb6, 0xb1, 0x06, 0xb0, 0xb3, 0x07, 0x08, 0x09, 0xea, 0xf8, 0x0a,
0x0b, 0xf7, 0xed, 0x0c, 0x0d, 0xef, 0x05, 0x0e, 0x02, 0x0f, 0xeb, 0xe2,
@@ -741,7 +744,7 @@
0x16, 0x23, 0x14, 0x24, 0x10, 0x25,
};
-static const uint8 kPreloadedHSTSData[] = {
+static const uint8_t kPreloadedHSTSData[] = {
0xfe, 0xfb, 0x9b, 0x5b, 0xba, 0xcd, 0x11, 0x2a, 0xe0, 0x7e, 0x72, 0xf4,
0x85, 0xac, 0xe5, 0xdc, 0xf8, 0xe5, 0xff, 0xf4, 0x76, 0x24, 0x2e, 0xaf,
0x32, 0x8c, 0xf1, 0xcb, 0x9f, 0x47, 0x2a, 0x47, 0xfa, 0x11, 0x84, 0x4f,
diff --git a/net/http/url_security_manager.h b/net/http/url_security_manager.h
index d851b370..694e606 100644
--- a/net/http/url_security_manager.h
+++ b/net/http/url_security_manager.h
@@ -5,7 +5,7 @@
#ifndef NET_HTTP_URL_SECURITY_MANAGER_H_
#define NET_HTTP_URL_SECURITY_MANAGER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/http/url_security_manager_unittest.cc b/net/http/url_security_manager_unittest.cc
index ba5e36f..14406a8 100644
--- a/net/http/url_security_manager_unittest.cc
+++ b/net/http/url_security_manager_unittest.cc
@@ -4,7 +4,6 @@
#include "net/http/url_security_manager.h"
-#include "base/basictypes.h"
#include "net/base/net_errors.h"
#include "net/http/http_auth_filter.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/http/url_security_manager_win.cc b/net/http/url_security_manager_win.cc
index 9872595..19d2550 100644
--- a/net/http/url_security_manager_win.cc
+++ b/net/http/url_security_manager_win.cc
@@ -7,6 +7,7 @@
#include <urlmon.h>
#pragma comment(lib, "urlmon.lib")
+#include "base/macros.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/scoped_comptr.h"
diff --git a/net/log/net_log.cc b/net/log/net_log.cc
index 79a8886..4fae9e08 100644
--- a/net/log/net_log.cc
+++ b/net/log/net_log.cc
@@ -62,7 +62,7 @@
scoped_ptr<base::Value> NetLogInt64Callback(
const char* name,
- int64 value,
+ int64_t value,
NetLogCaptureMode /* capture_mode */) {
scoped_ptr<base::DictionaryValue> event_params(new base::DictionaryValue());
event_params->SetString(name, base::Int64ToString(value));
@@ -90,13 +90,12 @@
} // namespace
// LoadTimingInfo requires this be 0.
-const uint32 NetLog::Source::kInvalidId = 0;
+const uint32_t NetLog::Source::kInvalidId = 0;
NetLog::Source::Source() : type(SOURCE_NONE), id(kInvalidId) {
}
-NetLog::Source::Source(SourceType type, uint32 id) : type(type), id(id) {
-}
+NetLog::Source::Source(SourceType type, uint32_t id) : type(type), id(id) {}
bool NetLog::Source::IsValid() const {
return id != kInvalidId;
@@ -230,7 +229,7 @@
¶meters_callback);
}
-uint32 NetLog::NextID() {
+uint32_t NetLog::NextID() {
return base::subtle::NoBarrier_AtomicIncrement(&last_id_, 1);
}
@@ -277,7 +276,7 @@
// static
std::string NetLog::TickCountToString(const base::TimeTicks& time) {
- int64 delta_time = (time - base::TimeTicks()).InMilliseconds();
+ int64_t delta_time = (time - base::TimeTicks()).InMilliseconds();
return base::Int64ToString(delta_time);
}
@@ -353,7 +352,7 @@
// static
NetLog::ParametersCallback NetLog::Int64Callback(const char* name,
- int64 value) {
+ int64_t value) {
return base::Bind(&NetLogInt64Callback, name, value);
}
diff --git a/net/log/net_log.h b/net/log/net_log.h
index 1b3f27c7..aac2e99 100644
--- a/net/log/net_log.h
+++ b/net/log/net_log.h
@@ -5,14 +5,16 @@
#ifndef NET_LOG_NET_LOG_H_
#define NET_LOG_NET_LOG_H_
+#include <stdint.h>
+
#include <string>
#include "build/build_config.h"
#include "base/atomicops.h"
-#include "base/basictypes.h"
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
#include "base/synchronization/lock.h"
@@ -78,10 +80,10 @@
// uniquely identify the source, and is used by log observers to infer
// message groupings. Can use NetLog::NextID() to create unique IDs.
struct NET_EXPORT Source {
- static const uint32 kInvalidId;
+ static const uint32_t kInvalidId;
Source();
- Source(SourceType type, uint32 id);
+ Source(SourceType type, uint32_t id);
bool IsValid() const;
// Adds the source to a DictionaryValue containing event parameters,
@@ -99,7 +101,7 @@
static bool FromEventParameters(base::Value* event_params, Source* source);
SourceType type;
- uint32 id;
+ uint32_t id;
};
struct NET_EXPORT EntryData {
@@ -206,7 +208,7 @@
// Returns a unique ID which can be used as a source ID. All returned IDs
// will be unique and greater than 0.
- uint32 NextID();
+ uint32_t NextID();
// Returns true if there are any observers attached to the NetLog. This can be
// used as an optimization to avoid emitting log entries when there is no
@@ -270,11 +272,11 @@
// Warning: |name| must remain valid for the life of the callback.
static ParametersCallback IntCallback(const char* name, int value);
- // Creates a ParametersCallback that encapsulates a single int64. The
+ // Creates a ParametersCallback that encapsulates a single int64_t. The
// callback will return the value as a StringValue, since IntegerValues
// only support 32-bit values.
// Warning: |name| must remain valid for the life of the callback.
- static ParametersCallback Int64Callback(const char* name, int64 value);
+ static ParametersCallback Int64Callback(const char* name, int64_t value);
// Creates a ParametersCallback that encapsulates a single UTF8 string. Takes
// |value| as a pointer to avoid copying, and emphasize it must be valid for
diff --git a/net/log/net_log_capture_mode.h b/net/log/net_log_capture_mode.h
index 8865e5f..a2555d6 100644
--- a/net/log/net_log_capture_mode.h
+++ b/net/log/net_log_capture_mode.h
@@ -6,6 +6,7 @@
#define NET_LOG_NET_LOG_CAPTURE_MODE_H_
#include <stdint.h>
+
#include <string>
#include "net/base/net_export.h"
diff --git a/net/log/net_log_unittest.cc b/net/log/net_log_unittest.cc
index fd2a2925..e1a55e5d8 100644
--- a/net/log/net_log_unittest.cc
+++ b/net/log/net_log_unittest.cc
@@ -5,6 +5,7 @@
#include "net/log/net_log.h"
#include "base/bind.h"
+#include "base/macros.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/simple_thread.h"
#include "base/values.h"
diff --git a/net/log/net_log_util.cc b/net/log/net_log_util.cc
index 4d5074c7..2a82abc 100644
--- a/net/log/net_log_util.cc
+++ b/net/log/net_log_util.cc
@@ -275,7 +275,7 @@
// actual system times. Time ticks are used throughout since they are stable
// across system clock changes.
{
- int64 tick_to_unix_time_ms =
+ int64_t tick_to_unix_time_ms =
(base::TimeTicks() - base::TimeTicks::UnixEpoch()).InMilliseconds();
// Pass it as a string, since it may be too large to fit in an integer.
diff --git a/net/log/test_net_log.cc b/net/log/test_net_log.cc
index a1b383e..0e82ae1e 100644
--- a/net/log/test_net_log.cc
+++ b/net/log/test_net_log.cc
@@ -4,6 +4,7 @@
#include "net/log/test_net_log.h"
+#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "base/values.h"
diff --git a/net/log/test_net_log.h b/net/log/test_net_log.h
index 7dc301147..3605a9c 100644
--- a/net/log/test_net_log.h
+++ b/net/log/test_net_log.h
@@ -5,11 +5,13 @@
#ifndef NET_LOG_TEST_NET_LOG_H_
#define NET_LOG_TEST_NET_LOG_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/log/net_log.h"
#include "net/log/test_net_log_entry.h"
diff --git a/net/log/test_net_log_util.h b/net/log/test_net_log_util.h
index b0e4503..8734cea9 100644
--- a/net/log/test_net_log_util.h
+++ b/net/log/test_net_log_util.h
@@ -5,6 +5,8 @@
#ifndef NET_LOG_TEST_NET_LOG_UTIL_H_
#define NET_LOG_TEST_NET_LOG_UTIL_H_
+#include <stddef.h>
+
#include "net/log/net_log.h"
#include "net/log/test_net_log_entry.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.h b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.h
index 5e5a691..e3699aa 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.h
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.h
@@ -5,8 +5,11 @@
#ifndef NET_PROXY_DHCP_PROXY_SCRIPT_ADAPTER_FETCHER_WIN_H_
#define NET_PROXY_DHCP_PROXY_SCRIPT_ADAPTER_FETCHER_WIN_H_
+#include <stddef.h>
+
#include <string>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/proxy/dhcp_proxy_script_fetcher.h b/net/proxy/dhcp_proxy_script_fetcher.h
index 85d4df8..2d33e2f 100644
--- a/net/proxy/dhcp_proxy_script_fetcher.h
+++ b/net/proxy/dhcp_proxy_script_fetcher.h
@@ -5,8 +5,8 @@
#ifndef NET_PROXY_DHCP_SCRIPT_FETCHER_H_
#define NET_PROXY_DHCP_SCRIPT_FETCHER_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/strings/string16.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
diff --git a/net/proxy/dhcp_proxy_script_fetcher_factory.h b/net/proxy/dhcp_proxy_script_fetcher_factory.h
index 1c315ad..b017bb63 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_factory.h
+++ b/net/proxy/dhcp_proxy_script_fetcher_factory.h
@@ -5,7 +5,7 @@
#ifndef NET_PROXY_DHCP_SCRIPT_FETCHER_FACTORY_H_
#define NET_PROXY_DHCP_SCRIPT_FETCHER_FACTORY_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/singleton.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
diff --git a/net/proxy/dhcp_proxy_script_fetcher_win.h b/net/proxy/dhcp_proxy_script_fetcher_win.h
index df24d10e..2620fc5f 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_win.h
+++ b/net/proxy/dhcp_proxy_script_fetcher_win.h
@@ -9,6 +9,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
diff --git a/net/proxy/mock_proxy_resolver.h b/net/proxy/mock_proxy_resolver.h
index aec8432..9ed3348 100644
--- a/net/proxy/mock_proxy_resolver.h
+++ b/net/proxy/mock_proxy_resolver.h
@@ -7,6 +7,7 @@
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_errors.h"
#include "net/proxy/proxy_resolver.h"
diff --git a/net/proxy/mojo_proxy_resolver_factory_impl.cc b/net/proxy/mojo_proxy_resolver_factory_impl.cc
index a24edc2..3ea3135 100644
--- a/net/proxy/mojo_proxy_resolver_factory_impl.cc
+++ b/net/proxy/mojo_proxy_resolver_factory_impl.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "base/macros.h"
#include "base/stl_util.h"
#include "net/base/net_errors.h"
#include "net/proxy/mojo_proxy_resolver_impl.h"
diff --git a/net/proxy/mojo_proxy_resolver_factory_impl.h b/net/proxy/mojo_proxy_resolver_factory_impl.h
index 4c8252e..44646e7 100644
--- a/net/proxy/mojo_proxy_resolver_factory_impl.h
+++ b/net/proxy/mojo_proxy_resolver_factory_impl.h
@@ -8,6 +8,7 @@
#include <set>
#include "base/callback.h"
+#include "base/macros.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "net/interfaces/proxy_resolver_service.mojom.h"
diff --git a/net/proxy/mojo_proxy_resolver_impl.cc b/net/proxy/mojo_proxy_resolver_impl.cc
index c5ae0340..e8c400b 100644
--- a/net/proxy/mojo_proxy_resolver_impl.cc
+++ b/net/proxy/mojo_proxy_resolver_impl.cc
@@ -4,6 +4,7 @@
#include "net/proxy/mojo_proxy_resolver_impl.h"
+#include "base/macros.h"
#include "base/stl_util.h"
#include "mojo/common/url_type_converters.h"
#include "net/base/net_errors.h"
diff --git a/net/proxy/mojo_proxy_resolver_impl.h b/net/proxy/mojo_proxy_resolver_impl.h
index 479fcfc..7528004 100644
--- a/net/proxy/mojo_proxy_resolver_impl.h
+++ b/net/proxy/mojo_proxy_resolver_impl.h
@@ -9,6 +9,7 @@
#include <queue>
#include <set>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/interfaces/proxy_resolver_service.mojom.h"
diff --git a/net/proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc b/net/proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc
index ce11b710..60058a7 100644
--- a/net/proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc
+++ b/net/proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc
@@ -8,6 +8,7 @@
#include <utility>
#include <vector>
+#include "base/macros.h"
#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/proxy/multi_threaded_proxy_resolver.h b/net/proxy/multi_threaded_proxy_resolver.h
index 30a7b1b..f00249f 100644
--- a/net/proxy/multi_threaded_proxy_resolver.h
+++ b/net/proxy/multi_threaded_proxy_resolver.h
@@ -5,9 +5,10 @@
#ifndef NET_PROXY_MULTI_THREADED_PROXY_RESOLVER_H_
#define NET_PROXY_MULTI_THREADED_PROXY_RESOLVER_H_
+#include <stddef.h>
+
#include <set>
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/proxy/network_delegate_error_observer.cc b/net/proxy/network_delegate_error_observer.cc
index 1bb0537..b5d85c4 100644
--- a/net/proxy/network_delegate_error_observer.cc
+++ b/net/proxy/network_delegate_error_observer.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/single_thread_task_runner.h"
#include "net/base/net_errors.h"
#include "net/base/network_delegate.h"
diff --git a/net/proxy/network_delegate_error_observer.h b/net/proxy/network_delegate_error_observer.h
index 2463913f..50a3f64 100644
--- a/net/proxy/network_delegate_error_observer.h
+++ b/net/proxy/network_delegate_error_observer.h
@@ -6,6 +6,7 @@
#define NET_PROXY_NETWORK_DELEGATE_ERROR_OBSERVER_H_
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/proxy/proxy_resolver_error_observer.h"
diff --git a/net/proxy/polling_proxy_config_service.h b/net/proxy/polling_proxy_config_service.h
index c8230561..f4db0df 100644
--- a/net/proxy/polling_proxy_config_service.h
+++ b/net/proxy/polling_proxy_config_service.h
@@ -6,6 +6,7 @@
#define NET_PROXY_POLLING_PROXY_CONFIG_SERVICE_H_
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "net/proxy/proxy_config_service.h"
diff --git a/net/proxy/proxy_bypass_rules.h b/net/proxy/proxy_bypass_rules.h
index c8fe069..c7960743 100644
--- a/net/proxy/proxy_bypass_rules.h
+++ b/net/proxy/proxy_bypass_rules.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "url/gurl.h"
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc
index 3cd8317..990b614f 100644
--- a/net/proxy/proxy_config_service_android.cc
+++ b/net/proxy/proxy_config_service_android.cc
@@ -9,12 +9,12 @@
#include "base/android/context_utils.h"
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
#include "base/sequenced_task_runner.h"
@@ -60,8 +60,7 @@
return ProxyServer();
DCHECK(port_as_int > 0);
return ProxyServer(
- scheme,
- HostPortPair(proxy_host, static_cast<uint16>(port_as_int)));
+ scheme, HostPortPair(proxy_host, static_cast<uint16_t>(port_as_int)));
}
ProxyServer LookupProxy(const std::string& prefix,
diff --git a/net/proxy/proxy_config_service_android.h b/net/proxy/proxy_config_service_android.h
index b98fd6b1..1b45eb1 100644
--- a/net/proxy/proxy_config_service_android.h
+++ b/net/proxy/proxy_config_service_android.h
@@ -8,9 +8,9 @@
#include <string>
#include "base/android/jni_android.h"
-#include "base/basictypes.h"
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
#include "net/proxy/proxy_config_service.h"
diff --git a/net/proxy/proxy_config_service_ios.h b/net/proxy/proxy_config_service_ios.h
index c79a6b6..d239f37 100644
--- a/net/proxy/proxy_config_service_ios.h
+++ b/net/proxy/proxy_config_service_ios.h
@@ -5,6 +5,7 @@
#ifndef NET_PROXY_PROXY_CONFIG_SERVICE_IOS_H_
#define NET_PROXY_PROXY_CONFIG_SERVICE_IOS_H_
+#include "base/macros.h"
#include "net/proxy/polling_proxy_config_service.h"
namespace net {
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index ea2ec20..139e308 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -24,6 +24,7 @@
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/nix/xdg_util.h"
#include "base/single_thread_task_runner.h"
diff --git a/net/proxy/proxy_config_service_linux.h b/net/proxy/proxy_config_service_linux.h
index 311f81f..d6faab0 100644
--- a/net/proxy/proxy_config_service_linux.h
+++ b/net/proxy/proxy_config_service_linux.h
@@ -5,12 +5,14 @@
#ifndef NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_
#define NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/environment.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
diff --git a/net/proxy/proxy_config_service_mac.h b/net/proxy/proxy_config_service_mac.h
index 01a0e26..b81ffa0 100644
--- a/net/proxy/proxy_config_service_mac.h
+++ b/net/proxy/proxy_config_service_mac.h
@@ -5,8 +5,8 @@
#ifndef NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_
#define NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
diff --git a/net/proxy/proxy_config_source.cc b/net/proxy/proxy_config_source.cc
index f3137ff..6dd6071a 100644
--- a/net/proxy/proxy_config_source.cc
+++ b/net/proxy/proxy_config_source.cc
@@ -4,7 +4,6 @@
#include "net/proxy/proxy_config_source.h"
-#include "base/basictypes.h"
#include "base/logging.h"
namespace net {
diff --git a/net/proxy/proxy_list.h b/net/proxy/proxy_list.h
index 97e0af65..82c637d 100644
--- a/net/proxy/proxy_list.h
+++ b/net/proxy/proxy_list.h
@@ -5,6 +5,8 @@
#ifndef NET_PROXY_PROXY_LIST_H_
#define NET_PROXY_PROXY_LIST_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
diff --git a/net/proxy/proxy_resolver.h b/net/proxy/proxy_resolver.h
index b303e2b..81efe05 100644
--- a/net/proxy/proxy_resolver.h
+++ b/net/proxy/proxy_resolver.h
@@ -7,6 +7,7 @@
#include "base/callback_forward.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "net/base/completion_callback.h"
diff --git a/net/proxy/proxy_resolver_error_observer.h b/net/proxy/proxy_resolver_error_observer.h
index 190b787..0212f82 100644
--- a/net/proxy/proxy_resolver_error_observer.h
+++ b/net/proxy/proxy_resolver_error_observer.h
@@ -5,7 +5,7 @@
#ifndef NET_PROXY_PROXY_RESOLVER_ERROR_OBSERVER_H_
#define NET_PROXY_PROXY_RESOLVER_ERROR_OBSERVER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string16.h"
#include "net/base/net_export.h"
diff --git a/net/proxy/proxy_resolver_factory.h b/net/proxy/proxy_resolver_factory.h
index 282dd24..0cc98df 100644
--- a/net/proxy/proxy_resolver_factory.h
+++ b/net/proxy/proxy_resolver_factory.h
@@ -7,6 +7,7 @@
#include <set>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
diff --git a/net/proxy/proxy_resolver_factory_mojo.cc b/net/proxy/proxy_resolver_factory_mojo.cc
index e79f5c2c2..d69e76d2 100644
--- a/net/proxy/proxy_resolver_factory_mojo.cc
+++ b/net/proxy/proxy_resolver_factory_mojo.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/stl_util.h"
#include "base/threading/thread_checker.h"
#include "base/values.h"
diff --git a/net/proxy/proxy_resolver_factory_mojo.h b/net/proxy/proxy_resolver_factory_mojo.h
index 23a679d..f3e8483 100644
--- a/net/proxy/proxy_resolver_factory_mojo.h
+++ b/net/proxy/proxy_resolver_factory_mojo.h
@@ -5,6 +5,7 @@
#ifndef NET_PROXY_PROXY_RESOLVER_FACTORY_MOJO_H_
#define NET_PROXY_PROXY_RESOLVER_FACTORY_MOJO_H_
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/public/cpp/bindings/binding.h"
diff --git a/net/proxy/proxy_resolver_mac.h b/net/proxy/proxy_resolver_mac.h
index 6d89ef5..f865021 100644
--- a/net/proxy/proxy_resolver_mac.h
+++ b/net/proxy/proxy_resolver_mac.h
@@ -6,6 +6,7 @@
#define NET_PROXY_PROXY_RESOLVER_MAC_H_
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/proxy/proxy_resolver_factory.h"
#include "url/gurl.h"
diff --git a/net/proxy/proxy_resolver_perftest.cc b/net/proxy/proxy_resolver_perftest.cc
index 6b9759f4..6b8501c 100644
--- a/net/proxy/proxy_resolver_perftest.cc
+++ b/net/proxy/proxy_resolver_perftest.cc
@@ -5,6 +5,7 @@
#include "base/base_paths.h"
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc
index b62d52d..f386e1b 100644
--- a/net/proxy/proxy_resolver_v8.cc
+++ b/net/proxy/proxy_resolver_v8.cc
@@ -8,11 +8,11 @@
#include <cstdio>
#include "base/auto_reset.h"
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/debug/leak_annotations.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -97,7 +97,7 @@
: script_data_(script_data) {}
const uint16_t* data() const override {
- return reinterpret_cast<const uint16*>(script_data_->utf16().data());
+ return reinterpret_cast<const uint16_t*>(script_data_->utf16().data());
}
size_t length() const override { return script_data_->utf16().size(); }
diff --git a/net/proxy/proxy_resolver_v8.h b/net/proxy/proxy_resolver_v8.h
index 98746ac..abd2e94 100644
--- a/net/proxy/proxy_resolver_v8.h
+++ b/net/proxy/proxy_resolver_v8.h
@@ -5,7 +5,10 @@
#ifndef NET_PROXY_PROXY_RESOLVER_V8_H_
#define NET_PROXY_PROXY_RESOLVER_V8_H_
+#include <stddef.h>
+
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
diff --git a/net/proxy/proxy_resolver_v8_tracing.cc b/net/proxy/proxy_resolver_v8_tracing.cc
index 27cf5f7..00b59e2 100644
--- a/net/proxy/proxy_resolver_v8_tracing.cc
+++ b/net/proxy/proxy_resolver_v8_tracing.cc
@@ -9,6 +9,7 @@
#include <vector>
#include "base/bind.h"
+#include "base/macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/cancellation_flag.h"
diff --git a/net/proxy/proxy_resolver_v8_tracing.h b/net/proxy/proxy_resolver_v8_tracing.h
index cd9ae6c8..f5f66cf7 100644
--- a/net/proxy/proxy_resolver_v8_tracing.h
+++ b/net/proxy/proxy_resolver_v8_tracing.h
@@ -5,7 +5,7 @@
#ifndef NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_
#define NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/proxy/proxy_resolver_v8_tracing_wrapper.cc b/net/proxy/proxy_resolver_v8_tracing_wrapper.cc
index 01dde664..fa06298 100644
--- a/net/proxy/proxy_resolver_v8_tracing_wrapper.cc
+++ b/net/proxy/proxy_resolver_v8_tracing_wrapper.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/bind.h"
+#include "base/macros.h"
#include "base/values.h"
#include "net/base/net_errors.h"
#include "net/log/net_log.h"
diff --git a/net/proxy/proxy_resolver_v8_tracing_wrapper.h b/net/proxy/proxy_resolver_v8_tracing_wrapper.h
index 28343d80..000f94d 100644
--- a/net/proxy/proxy_resolver_v8_tracing_wrapper.h
+++ b/net/proxy/proxy_resolver_v8_tracing_wrapper.h
@@ -5,7 +5,7 @@
#ifndef NET_PROXY_PROXY_RESOLVER_V8_TRACING_WRAPPER_H_
#define NET_PROXY_PROXY_RESOLVER_V8_TRACING_WRAPPER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/proxy/proxy_resolver_winhttp.cc b/net/proxy/proxy_resolver_winhttp.cc
index bfdce33..7dccbf0b 100644
--- a/net/proxy/proxy_resolver_winhttp.cc
+++ b/net/proxy/proxy_resolver_winhttp.cc
@@ -7,6 +7,7 @@
#include <windows.h>
#include <winhttp.h>
+#include "base/macros.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/net_errors.h"
diff --git a/net/proxy/proxy_resolver_winhttp.h b/net/proxy/proxy_resolver_winhttp.h
index 843711c..c6e8ac5 100644
--- a/net/proxy/proxy_resolver_winhttp.h
+++ b/net/proxy/proxy_resolver_winhttp.h
@@ -6,6 +6,7 @@
#define NET_PROXY_PROXY_RESOLVER_WINHTTP_H_
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/proxy/proxy_resolver_factory.h"
#include "url/gurl.h"
diff --git a/net/proxy/proxy_script_decider.h b/net/proxy/proxy_script_decider.h
index cf5edff..60cb24b 100644
--- a/net/proxy/proxy_script_decider.h
+++ b/net/proxy/proxy_script_decider.h
@@ -5,9 +5,12 @@
#ifndef NET_PROXY_PROXY_SCRIPT_DECIDER_H_
#define NET_PROXY_PROXY_SCRIPT_DECIDER_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "base/time/time.h"
diff --git a/net/proxy/proxy_script_decider_unittest.cc b/net/proxy/proxy_script_decider_unittest.cc
index cc320a4..33e8aa5 100644
--- a/net/proxy/proxy_script_decider_unittest.cc
+++ b/net/proxy/proxy_script_decider_unittest.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
diff --git a/net/proxy/proxy_script_fetcher_impl.h b/net/proxy/proxy_script_fetcher_impl.h
index b02c9fc5..fe0bf33 100644
--- a/net/proxy/proxy_script_fetcher_impl.h
+++ b/net/proxy/proxy_script_fetcher_impl.h
@@ -5,10 +5,12 @@
#ifndef NET_PROXY_PROXY_SCRIPT_FETCHER_IMPL_H_
#define NET_PROXY_PROXY_SCRIPT_FETCHER_IMPL_H_
+#include <stddef.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc
index 7d117eb..ecbe3fd 100644
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc
@@ -8,6 +8,7 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/path_service.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/net/proxy/proxy_server.cc b/net/proxy/proxy_server.cc
index e451265..d3ba5ba1 100644
--- a/net/proxy/proxy_server.cc
+++ b/net/proxy/proxy_server.cc
@@ -6,7 +6,6 @@
#include <algorithm>
-#include "base/basictypes.h"
#include "base/strings/string_util.h"
#include "net/base/net_util.h"
#include "net/http/http_util.h"
@@ -236,7 +235,7 @@
if (port == -1)
port = GetDefaultPortForScheme(scheme);
- host_port_pair = HostPortPair(host, static_cast<uint16>(port));
+ host_port_pair = HostPortPair(host, static_cast<uint16_t>(port));
}
return ProxyServer(scheme, host_port_pair);
diff --git a/net/proxy/proxy_server_unittest.cc b/net/proxy/proxy_server_unittest.cc
index 25ad434..3589517b 100644
--- a/net/proxy/proxy_server_unittest.cc
+++ b/net/proxy/proxy_server_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/proxy/proxy_server.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 7738de7..47cf452c 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
@@ -74,7 +75,7 @@
// set up. Network failures can happen at any time though, so we additionally
// poll the PAC script for changes, which will allow us to recover from these
// sorts of problems.
-const int64 kDelayAfterNetworkChangesMs = 2000;
+const int64_t kDelayAfterNetworkChangesMs = 2000;
// This is the default policy for polling the PAC script.
//
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index da4e970..e71fe9b9 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -5,11 +5,14 @@
#ifndef NET_PROXY_PROXY_SERVICE_H_
#define NET_PROXY_PROXY_SERVICE_H_
+#include <stddef.h>
+
#include <set>
#include <string>
#include <vector>
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/waitable_event.h"
diff --git a/net/proxy/proxy_service_mojo.h b/net/proxy/proxy_service_mojo.h
index 8fc88c0..a728337 100644
--- a/net/proxy/proxy_service_mojo.h
+++ b/net/proxy/proxy_service_mojo.h
@@ -5,7 +5,6 @@
#ifndef NET_PROXY_PROXY_SERVICE_MOJO_H_
#define NET_PROXY_PROXY_SERVICE_MOJO_H_
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/proxy/dhcp_proxy_script_fetcher.h"
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index 6e8dcdb7..3d23b58 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -9,6 +9,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/load_flags.h"
diff --git a/net/proxy/proxy_service_v8.h b/net/proxy/proxy_service_v8.h
index 88e7fcc0..2919553 100644
--- a/net/proxy/proxy_service_v8.h
+++ b/net/proxy/proxy_service_v8.h
@@ -5,7 +5,6 @@
#ifndef NET_PROXY_PROXY_SERVICE_V8_H_
#define NET_PROXY_PROXY_SERVICE_V8_H_
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/proxy/dhcp_proxy_script_fetcher.h"
diff --git a/net/quic/congestion_control/cubic.cc b/net/quic/congestion_control/cubic.cc
index d07af17..6cd6557 100644
--- a/net/quic/congestion_control/cubic.cc
+++ b/net/quic/congestion_control/cubic.cc
@@ -8,7 +8,6 @@
#include <algorithm>
#include <cmath>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/quic/quic_flags.h"
#include "net/quic/quic_protocol.h"
@@ -27,10 +26,10 @@
// where 0.100 is 100 ms which is the scaling
// round trip time.
const int kCubeCongestionWindowScale = 410;
-const uint64 kCubeFactor =
+const uint64_t kCubeFactor =
(UINT64_C(1) << kCubeScale) / kCubeCongestionWindowScale;
-const uint32 kDefaultNumConnections = 2;
+const uint32_t kDefaultNumConnections = 2;
const float kBeta = 0.7f; // Default Cubic backoff factor.
// Additional backoff factor when loss occurs in the concave part of the Cubic
// curve. This additional backoff factor is expected to give up bandwidth to
@@ -136,9 +135,9 @@
time_to_origin_point_ = 0;
origin_point_congestion_window_ = current_congestion_window;
} else {
- time_to_origin_point_ =
- static_cast<uint32>(cbrt(kCubeFactor * (last_max_congestion_window_ -
- current_congestion_window)));
+ time_to_origin_point_ = static_cast<uint32_t>(
+ cbrt(kCubeFactor *
+ (last_max_congestion_window_ - current_congestion_window)));
origin_point_congestion_window_ = last_max_congestion_window_;
}
} else {
@@ -157,11 +156,11 @@
// Change the time unit from microseconds to 2^10 fractions per second. Take
// the round trip time in account. This is done to allow us to use shift as a
// divide operator.
- int64 elapsed_time =
+ int64_t elapsed_time =
(current_time.Add(delay_min).Subtract(epoch_).ToMicroseconds() << 10) /
kNumMicrosPerSecond;
- int64 offset = time_to_origin_point_ - elapsed_time;
+ int64_t offset = time_to_origin_point_ - elapsed_time;
QuicPacketCount delta_congestion_window =
(kCubeCongestionWindowScale * offset * offset * offset) >> kCubeScale;
diff --git a/net/quic/congestion_control/cubic.h b/net/quic/congestion_control/cubic.h
index 481b8dc..493cc58 100644
--- a/net/quic/congestion_control/cubic.h
+++ b/net/quic/congestion_control/cubic.h
@@ -8,7 +8,9 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_CUBIC_H_
#define NET_QUIC_CONGESTION_CONTROL_CUBIC_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/quic_bandwidth.h"
#include "net/quic/quic_clock.h"
@@ -85,7 +87,7 @@
QuicPacketCount origin_point_congestion_window_;
// Time to origin point of cubic function in 2^10 fractions of a second.
- uint32 time_to_origin_point_;
+ uint32_t time_to_origin_point_;
// Last congestion window in packets computed by cubic function.
QuicPacketCount last_target_congestion_window_;
diff --git a/net/quic/congestion_control/cubic_bytes.cc b/net/quic/congestion_control/cubic_bytes.cc
index 520c3b2..e09cc76 100644
--- a/net/quic/congestion_control/cubic_bytes.cc
+++ b/net/quic/congestion_control/cubic_bytes.cc
@@ -8,7 +8,6 @@
#include <algorithm>
#include <cmath>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/quic/quic_protocol.h"
@@ -26,10 +25,10 @@
// round trip time.
const int kCubeCongestionWindowScale = 410;
// The cube factor for packets in bytes.
-const uint64 kCubeFactor =
+const uint64_t kCubeFactor =
(UINT64_C(1) << kCubeScale) / kCubeCongestionWindowScale / kDefaultTCPMSS;
-const uint32 kDefaultNumConnections = 2;
+const uint32_t kDefaultNumConnections = 2;
const float kBeta = 0.7f; // Default Cubic backoff factor.
// Additional backoff factor when loss occurs in the concave part of the Cubic
// curve. This additional backoff factor is expected to give up bandwidth to
@@ -131,20 +130,20 @@
time_to_origin_point_ = 0;
origin_point_congestion_window_ = current_congestion_window;
} else {
- time_to_origin_point_ =
- static_cast<uint32>(cbrt(kCubeFactor * (last_max_congestion_window_ -
- current_congestion_window)));
+ time_to_origin_point_ = static_cast<uint32_t>(
+ cbrt(kCubeFactor *
+ (last_max_congestion_window_ - current_congestion_window)));
origin_point_congestion_window_ = last_max_congestion_window_;
}
}
// Change the time unit from microseconds to 2^10 fractions per second. Take
// the round trip time in account. This is done to allow us to use shift as a
// divide operator.
- int64 elapsed_time =
+ int64_t elapsed_time =
(current_time.Add(delay_min).Subtract(epoch_).ToMicroseconds() << 10) /
kNumMicrosPerSecond;
- int64 offset = time_to_origin_point_ - elapsed_time;
+ int64_t offset = time_to_origin_point_ - elapsed_time;
QuicByteCount delta_congestion_window =
((kCubeCongestionWindowScale * offset * offset * offset) >> kCubeScale) *
kDefaultTCPMSS;
diff --git a/net/quic/congestion_control/cubic_bytes.h b/net/quic/congestion_control/cubic_bytes.h
index 9b4e2ad9..b1b4344f 100644
--- a/net/quic/congestion_control/cubic_bytes.h
+++ b/net/quic/congestion_control/cubic_bytes.h
@@ -8,7 +8,9 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_
#define NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/quic_bandwidth.h"
#include "net/quic/quic_clock.h"
@@ -82,7 +84,7 @@
QuicByteCount origin_point_congestion_window_;
// Time to origin point of cubic function in 2^10 fractions of a second.
- uint32 time_to_origin_point_;
+ uint32_t time_to_origin_point_;
// Last congestion window in packets computed by cubic function.
QuicByteCount last_target_congestion_window_;
diff --git a/net/quic/congestion_control/cubic_bytes_test.cc b/net/quic/congestion_control/cubic_bytes_test.cc
index 3de16510..1d4b94e 100644
--- a/net/quic/congestion_control/cubic_bytes_test.cc
+++ b/net/quic/congestion_control/cubic_bytes_test.cc
@@ -4,7 +4,6 @@
#include "net/quic/congestion_control/cubic_bytes.h"
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/quic/quic_connection_stats.h"
#include "net/quic/test_tools/mock_clock.h"
@@ -14,7 +13,7 @@
namespace test {
const float kBeta = 0.7f; // Default Cubic backoff factor.
-const uint32 kNumConnections = 2;
+const uint32_t kNumConnections = 2;
const float kNConnectionBeta = (kNumConnections - 1 + kBeta) / kNumConnections;
const float kNConnectionAlpha = 3 * kNumConnections * kNumConnections *
(1 - kNConnectionBeta) / (1 + kNConnectionBeta);
diff --git a/net/quic/congestion_control/cubic_test.cc b/net/quic/congestion_control/cubic_test.cc
index 92f7550..fb88de6 100644
--- a/net/quic/congestion_control/cubic_test.cc
+++ b/net/quic/congestion_control/cubic_test.cc
@@ -4,7 +4,6 @@
#include "net/quic/congestion_control/cubic.h"
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/quic/quic_connection_stats.h"
#include "net/quic/test_tools/mock_clock.h"
@@ -14,7 +13,7 @@
namespace test {
const float kBeta = 0.7f; // Default Cubic backoff factor.
-const uint32 kNumConnections = 2;
+const uint32_t kNumConnections = 2;
const float kNConnectionBeta = (kNumConnections - 1 + kBeta) / kNumConnections;
const float kNConnectionAlpha = 3 * kNumConnections * kNumConnections *
(1 - kNConnectionBeta) / (1 + kNConnectionBeta);
diff --git a/net/quic/congestion_control/general_loss_algorithm.h b/net/quic/congestion_control/general_loss_algorithm.h
index eda03e4e..54c170f 100644
--- a/net/quic/congestion_control/general_loss_algorithm.h
+++ b/net/quic/congestion_control/general_loss_algorithm.h
@@ -8,7 +8,7 @@
#include <algorithm>
#include <map>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/quic/congestion_control/loss_detection_interface.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
diff --git a/net/quic/congestion_control/general_loss_algorithm_test.cc b/net/quic/congestion_control/general_loss_algorithm_test.cc
index 5e71df1..84377bd8 100644
--- a/net/quic/congestion_control/general_loss_algorithm_test.cc
+++ b/net/quic/congestion_control/general_loss_algorithm_test.cc
@@ -20,7 +20,7 @@
namespace {
// Default packet length.
-const uint32 kDefaultLength = 1000;
+const uint32_t kDefaultLength = 1000;
class GeneralLossAlgorithmTest : public ::testing::Test {
protected:
diff --git a/net/quic/congestion_control/hybrid_slow_start.cc b/net/quic/congestion_control/hybrid_slow_start.cc
index c21eec4..a5f53f9 100644
--- a/net/quic/congestion_control/hybrid_slow_start.cc
+++ b/net/quic/congestion_control/hybrid_slow_start.cc
@@ -13,14 +13,14 @@
// Note(pwestin): the magic clamping numbers come from the original code in
// tcp_cubic.c.
-const int64 kHybridStartLowWindow = 16;
+const int64_t kHybridStartLowWindow = 16;
// Number of delay samples for detecting the increase of delay.
-const uint32 kHybridStartMinSamples = 8;
+const uint32_t kHybridStartMinSamples = 8;
// Exit slow start if the min rtt has increased by more than 1/8th.
const int kHybridStartDelayFactorExp = 3; // 2^3 = 8
// The original paper specifies 2 and 8ms, but those have changed over time.
-const int64 kHybridStartDelayMinThresholdUs = 4000;
-const int64 kHybridStartDelayMaxThresholdUs = 16000;
+const int64_t kHybridStartDelayMinThresholdUs = 4000;
+const int64_t kHybridStartDelayMaxThresholdUs = 16000;
HybridSlowStart::HybridSlowStart()
: started_(false),
@@ -86,7 +86,7 @@
// We only need to check this once per round.
if (rtt_sample_count_ == kHybridStartMinSamples) {
// Divide min_rtt by 8 to get a rtt increase threshold for exiting.
- int64 min_rtt_increase_threshold_us =
+ int64_t min_rtt_increase_threshold_us =
min_rtt.ToMicroseconds() >> kHybridStartDelayFactorExp;
// Ensure the rtt threshold is never less than 2ms or more than 16ms.
min_rtt_increase_threshold_us =
diff --git a/net/quic/congestion_control/hybrid_slow_start.h b/net/quic/congestion_control/hybrid_slow_start.h
index 0124a9e1..cf752f6 100644
--- a/net/quic/congestion_control/hybrid_slow_start.h
+++ b/net/quic/congestion_control/hybrid_slow_start.h
@@ -16,7 +16,9 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_HYBRID_SLOW_START_H_
#define NET_QUIC_CONGESTION_CONTROL_HYBRID_SLOW_START_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
@@ -71,7 +73,7 @@
// Variables for tracking acks received during a slow start round.
QuicPacketNumber end_packet_number_; // End of the receive round.
- uint32 rtt_sample_count_; // Number of rtt samples in the current round.
+ uint32_t rtt_sample_count_; // Number of rtt samples in the current round.
QuicTime::Delta current_min_rtt_; // The minimum rtt of current round.
DISALLOW_COPY_AND_ASSIGN(HybridSlowStart);
diff --git a/net/quic/congestion_control/loss_detection_interface.h b/net/quic/congestion_control/loss_detection_interface.h
index d58284f..d337dbe2 100644
--- a/net/quic/congestion_control/loss_detection_interface.h
+++ b/net/quic/congestion_control/loss_detection_interface.h
@@ -7,7 +7,6 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_
#define NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_
-#include "base/basictypes.h"
#include "net/quic/congestion_control/send_algorithm_interface.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
diff --git a/net/quic/congestion_control/pacing_sender.cc b/net/quic/congestion_control/pacing_sender.cc
index e3f6276..040310f 100644
--- a/net/quic/congestion_control/pacing_sender.cc
+++ b/net/quic/congestion_control/pacing_sender.cc
@@ -10,7 +10,7 @@
PacingSender::PacingSender(SendAlgorithmInterface* sender,
QuicTime::Delta alarm_granularity,
- uint32 initial_packet_burst)
+ uint32_t initial_packet_burst)
: sender_(sender),
alarm_granularity_(alarm_granularity),
initial_packet_burst_(initial_packet_burst),
@@ -68,7 +68,7 @@
// current CWND in packets.
burst_tokens_ = min(
initial_packet_burst_,
- static_cast<uint32>(sender_->GetCongestionWindow() / kDefaultTCPMSS));
+ static_cast<uint32_t>(sender_->GetCongestionWindow() / kDefaultTCPMSS));
}
if (burst_tokens_ > 0) {
--burst_tokens_;
diff --git a/net/quic/congestion_control/pacing_sender.h b/net/quic/congestion_control/pacing_sender.h
index bc59aec4..185fec4 100644
--- a/net/quic/congestion_control/pacing_sender.h
+++ b/net/quic/congestion_control/pacing_sender.h
@@ -11,9 +11,11 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_
#define NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_
+#include <stdint.h>
+
#include <map>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/quic/congestion_control/send_algorithm_interface.h"
#include "net/quic/quic_bandwidth.h"
@@ -31,7 +33,7 @@
// the number of packets sent without pacing after quiescence.
PacingSender(SendAlgorithmInterface* sender,
QuicTime::Delta alarm_granularity,
- uint32 initial_packet_burst);
+ uint32_t initial_packet_burst);
~PacingSender() override;
// SendAlgorithmInterface methods.
@@ -73,9 +75,9 @@
const QuicTime::Delta alarm_granularity_;
// Configured maximum size of the burst coming out of quiescence. The burst
// is never larger than the current CWND in packets.
- const uint32 initial_packet_burst_;
+ const uint32_t initial_packet_burst_;
// Number of unpaced packets to be sent before packets are delayed.
- uint32 burst_tokens_;
+ uint32_t burst_tokens_;
// Send time of the last packet considered delayed.
QuicTime last_delayed_packet_sent_time_;
QuicTime ideal_next_packet_send_time_; // When can the next packet be sent.
diff --git a/net/quic/congestion_control/prr_sender.h b/net/quic/congestion_control/prr_sender.h
index c783668..df73a9f 100644
--- a/net/quic/congestion_control/prr_sender.h
+++ b/net/quic/congestion_control/prr_sender.h
@@ -7,6 +7,8 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_PRR_SENDER_H_
#define NET_QUIC_CONGESTION_CONTROL_PRR_SENDER_H_
+#include <stddef.h>
+
#include "net/quic/quic_bandwidth.h"
#include "net/quic/quic_time.h"
diff --git a/net/quic/congestion_control/prr_sender_test.cc b/net/quic/congestion_control/prr_sender_test.cc
index ed8397f..f7082f2 100644
--- a/net/quic/congestion_control/prr_sender_test.cc
+++ b/net/quic/congestion_control/prr_sender_test.cc
@@ -46,7 +46,7 @@
// One packet is lost, and one ack was consumed above. PRR now paces
// transmissions through the remaining 48 acks. PRR will alternatively
// disallow and allow a packet to be sent in response to an ack.
- for (uint64 i = 0; i < ssthresh_after_loss - 1; ++i) {
+ for (uint64_t i = 0; i < ssthresh_after_loss - 1; ++i) {
// Ack a packet. PRR shouldn't allow sending a packet in response.
prr.OnPacketAcked(kMaxSegmentSize);
bytes_in_flight -= kMaxSegmentSize;
diff --git a/net/quic/congestion_control/rtt_stats.cc b/net/quic/congestion_control/rtt_stats.cc
index 7a373ac..2e66c8e 100644
--- a/net/quic/congestion_control/rtt_stats.cc
+++ b/net/quic/congestion_control/rtt_stats.cc
@@ -32,7 +32,7 @@
num_min_rtt_samples_remaining_(0),
recent_min_rtt_window_(QuicTime::Delta::Infinite()) {}
-void RttStats::SampleNewRecentMinRtt(uint32 num_samples) {
+void RttStats::SampleNewRecentMinRtt(uint32_t num_samples) {
num_min_rtt_samples_remaining_ = num_samples;
new_min_rtt_ = RttSample();
}
@@ -79,7 +79,7 @@
mean_deviation_ =
QuicTime::Delta::FromMicroseconds(rtt_sample.ToMicroseconds() / 2);
} else {
- mean_deviation_ = QuicTime::Delta::FromMicroseconds(static_cast<int64>(
+ mean_deviation_ = QuicTime::Delta::FromMicroseconds(static_cast<int64_t>(
kOneMinusBeta * mean_deviation_.ToMicroseconds() +
kBeta * std::abs(smoothed_rtt_.Subtract(rtt_sample).ToMicroseconds())));
smoothed_rtt_ =
diff --git a/net/quic/congestion_control/rtt_stats.h b/net/quic/congestion_control/rtt_stats.h
index 5571aef..0827fa3 100644
--- a/net/quic/congestion_control/rtt_stats.h
+++ b/net/quic/congestion_control/rtt_stats.h
@@ -7,9 +7,11 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
#define NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
+#include <stdint.h>
+
#include <algorithm>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
@@ -36,7 +38,7 @@
// Forces RttStats to sample a new recent min rtt within the next
// |num_samples| UpdateRtt calls.
- void SampleNewRecentMinRtt(uint32 num_samples);
+ void SampleNewRecentMinRtt(uint32_t num_samples);
// Called when connection migrates and rtt measurement needs to be reset.
void OnConnectionMigration();
@@ -45,10 +47,10 @@
// May return Zero if no valid updates have occurred.
QuicTime::Delta smoothed_rtt() const { return smoothed_rtt_; }
- int64 initial_rtt_us() const { return initial_rtt_us_; }
+ int64_t initial_rtt_us() const { return initial_rtt_us_; }
// Sets an initial RTT to be used for SmoothedRtt before any RTT updates.
- void set_initial_rtt_us(int64 initial_rtt_us) {
+ void set_initial_rtt_us(int64_t initial_rtt_us) {
if (initial_rtt_us <= 0) {
LOG(DFATAL) << "Attempt to set initial rtt to <= 0.";
return;
@@ -97,10 +99,10 @@
// Approximation of standard deviation, the error is roughly 1.25 times
// larger than the standard deviation, for a normally distributed signal.
QuicTime::Delta mean_deviation_;
- int64 initial_rtt_us_;
+ int64_t initial_rtt_us_;
RttSample new_min_rtt_;
- uint32 num_min_rtt_samples_remaining_;
+ uint32_t num_min_rtt_samples_remaining_;
// State variables for Kathleen Nichols MinRTT algorithm.
QuicTime::Delta recent_min_rtt_window_;
diff --git a/net/quic/congestion_control/send_algorithm_interface.h b/net/quic/congestion_control/send_algorithm_interface.h
index 4f090f91..fcd9db4 100644
--- a/net/quic/congestion_control/send_algorithm_interface.h
+++ b/net/quic/congestion_control/send_algorithm_interface.h
@@ -10,7 +10,6 @@
#include <algorithm>
#include <map>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
#include "net/quic/quic_bandwidth.h"
#include "net/quic/quic_clock.h"
diff --git a/net/quic/congestion_control/send_algorithm_simulator.h b/net/quic/congestion_control/send_algorithm_simulator.h
index e6d3888..7fe0f01 100644
--- a/net/quic/congestion_control/send_algorithm_simulator.h
+++ b/net/quic/congestion_control/send_algorithm_simulator.h
@@ -7,12 +7,14 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_SIMULATOR_H_
#define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_SIMULATOR_H_
+#include <stddef.h>
+
#include <algorithm>
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/format_macros.h"
+#include "base/macros.h"
#include "base/strings/stringprintf.h"
#include "net/quic/congestion_control/send_algorithm_interface.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/congestion_control/tcp_cubic_bytes_sender.cc b/net/quic/congestion_control/tcp_cubic_bytes_sender.cc
index 56717e9..7f817ebf 100644
--- a/net/quic/congestion_control/tcp_cubic_bytes_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_bytes_sender.cc
@@ -24,7 +24,7 @@
const QuicByteCount kDefaultMinimumCongestionWindow = 2 * kDefaultTCPMSS;
const QuicByteCount kMaxBurstBytes = 3 * kDefaultTCPMSS;
const float kRenoBeta = 0.7f; // Reno backoff factor.
-const uint32 kDefaultNumConnections = 2; // N-connection emulation.
+const uint32_t kDefaultNumConnections = 2; // N-connection emulation.
} // namespace
TcpCubicBytesSender::TcpCubicBytesSender(
diff --git a/net/quic/congestion_control/tcp_cubic_bytes_sender.h b/net/quic/congestion_control/tcp_cubic_bytes_sender.h
index 4113794c..c96b178 100644
--- a/net/quic/congestion_control/tcp_cubic_bytes_sender.h
+++ b/net/quic/congestion_control/tcp_cubic_bytes_sender.h
@@ -7,7 +7,9 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_BYTES_SENDER_H_
#define NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_BYTES_SENDER_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/congestion_control/cubic_bytes.h"
#include "net/quic/congestion_control/hybrid_slow_start.h"
@@ -97,10 +99,10 @@
const bool reno_;
// Number of connections to simulate.
- uint32 num_connections_;
+ uint32_t num_connections_;
// ACK counter for the Reno implementation.
- uint64 num_acked_packets_;
+ uint64_t num_acked_packets_;
// Track the largest packet that has been sent.
QuicPacketNumber largest_sent_packet_number_;
diff --git a/net/quic/congestion_control/tcp_cubic_bytes_sender_test.cc b/net/quic/congestion_control/tcp_cubic_bytes_sender_test.cc
index 5681003..48f290c 100644
--- a/net/quic/congestion_control/tcp_cubic_bytes_sender_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_bytes_sender_test.cc
@@ -25,8 +25,8 @@
// TODO(ianswett): A number of theses tests were written with the assumption of
// an initial CWND of 10. They have carefully calculated values which should be
// updated to be based on kInitialCongestionWindowInsecure.
-const uint32 kInitialCongestionWindowPackets = 10;
-const uint32 kDefaultWindowTCP =
+const uint32_t kInitialCongestionWindowPackets = 10;
+const uint32_t kDefaultWindowTCP =
kInitialCongestionWindowPackets * kDefaultTCPMSS;
const float kRenoBeta = 0.7f; // Reno backoff factor.
@@ -371,8 +371,8 @@
}
TEST_F(TcpCubicBytesSenderTest, RetransmissionDelay) {
- const int64 kRttMs = 10;
- const int64 kDeviationMs = 3;
+ const int64_t kRttMs = 10;
+ const int64_t kDeviationMs = 3;
EXPECT_EQ(QuicTime::Delta::Zero(), sender_->RetransmissionDelay());
sender_->rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(kRttMs),
@@ -399,10 +399,10 @@
EXPECT_NEAR(kRttMs, sender_->rtt_stats_.smoothed_rtt().ToMilliseconds(), 1);
EXPECT_NEAR(expected_delay.ToMilliseconds(),
sender_->RetransmissionDelay().ToMilliseconds(), 1);
- EXPECT_EQ(
- static_cast<int64>(sender_->GetCongestionWindow() * kNumMicrosPerSecond /
- sender_->rtt_stats_.smoothed_rtt().ToMicroseconds()),
- sender_->BandwidthEstimate().ToBytesPerSecond());
+ EXPECT_EQ(static_cast<int64_t>(
+ sender_->GetCongestionWindow() * kNumMicrosPerSecond /
+ sender_->rtt_stats_.smoothed_rtt().ToMicroseconds()),
+ sender_->BandwidthEstimate().ToBytesPerSecond());
}
TEST_F(TcpCubicBytesSenderTest, TcpCubicResetEpochOnQuiescence) {
@@ -571,7 +571,7 @@
EXPECT_FALSE(sender_->InRecovery());
// Out of recovery now. Congestion window should not grow during RTT.
- for (uint64 i = 0; i < expected_send_window / kDefaultTCPMSS - 2; i += 2) {
+ for (uint64_t i = 0; i < expected_send_window / kDefaultTCPMSS - 2; i += 2) {
// Send our full send window.
SendAvailableSendWindow();
AckNPackets(2);
diff --git a/net/quic/congestion_control/tcp_cubic_sender.cc b/net/quic/congestion_control/tcp_cubic_sender.cc
index e36c4e1..256126f6 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender.cc
@@ -25,7 +25,7 @@
const QuicPacketCount kDefaultMinimumCongestionWindow = 2;
const QuicByteCount kMaxBurstBytes = 3 * kDefaultTCPMSS;
const float kRenoBeta = 0.7f; // Reno backoff factor.
-const uint32 kDefaultNumConnections = 2; // N-connection emulation.
+const uint32_t kDefaultNumConnections = 2; // N-connection emulation.
} // namespace
TcpCubicSender::TcpCubicSender(const QuicClock* clock,
diff --git a/net/quic/congestion_control/tcp_cubic_sender.h b/net/quic/congestion_control/tcp_cubic_sender.h
index 9969d40..30b3f2d 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.h
+++ b/net/quic/congestion_control/tcp_cubic_sender.h
@@ -7,8 +7,10 @@
#ifndef NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_
#define NET_QUIC_CONGESTION_CONTROL_TCP_CUBIC_SENDER_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/congestion_control/cubic.h"
#include "net/quic/congestion_control/hybrid_slow_start.h"
@@ -98,10 +100,10 @@
const bool reno_;
// Number of connections to simulate.
- uint32 num_connections_;
+ uint32_t num_connections_;
// ACK counter for the Reno implementation.
- uint64 congestion_window_count_;
+ uint64_t congestion_window_count_;
// Track the largest packet that has been sent.
QuicPacketNumber largest_sent_packet_number_;
diff --git a/net/quic/congestion_control/tcp_cubic_sender_test.cc b/net/quic/congestion_control/tcp_cubic_sender_test.cc
index 444851d..493933a 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_test.cc
@@ -27,8 +27,8 @@
// TODO(ianswett): A number of theses tests were written with the assumption of
// an initial CWND of 10. They have carefully calculated values which should be
// updated to be based on kInitialCongestionWindowInsecure.
-const uint32 kInitialCongestionWindowPackets = 10;
-const uint32 kDefaultWindowTCP =
+const uint32_t kInitialCongestionWindowPackets = 10;
+const uint32_t kDefaultWindowTCP =
kInitialCongestionWindowPackets * kDefaultTCPMSS;
const float kRenoBeta = 0.7f; // Reno backoff factor.
@@ -381,8 +381,8 @@
}
TEST_F(TcpCubicSenderTest, RetransmissionDelay) {
- const int64 kRttMs = 10;
- const int64 kDeviationMs = 3;
+ const int64_t kRttMs = 10;
+ const int64_t kDeviationMs = 3;
EXPECT_EQ(QuicTime::Delta::Zero(), sender_->RetransmissionDelay());
sender_->rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(kRttMs),
@@ -409,10 +409,10 @@
EXPECT_NEAR(kRttMs, sender_->rtt_stats_.smoothed_rtt().ToMilliseconds(), 1);
EXPECT_NEAR(expected_delay.ToMilliseconds(),
sender_->RetransmissionDelay().ToMilliseconds(), 1);
- EXPECT_EQ(
- static_cast<int64>(sender_->GetCongestionWindow() * kNumMicrosPerSecond /
- sender_->rtt_stats_.smoothed_rtt().ToMicroseconds()),
- sender_->BandwidthEstimate().ToBytesPerSecond());
+ EXPECT_EQ(static_cast<int64_t>(
+ sender_->GetCongestionWindow() * kNumMicrosPerSecond /
+ sender_->rtt_stats_.smoothed_rtt().ToMicroseconds()),
+ sender_->BandwidthEstimate().ToBytesPerSecond());
}
TEST_F(TcpCubicSenderTest, SlowStartMaxSendWindow) {
@@ -713,7 +713,7 @@
EXPECT_FALSE(sender_->InRecovery());
// Out of recovery now. Congestion window should not grow during RTT.
- for (uint64 i = 0; i < expected_send_window / kDefaultTCPMSS - 2; i += 2) {
+ for (uint64_t i = 0; i < expected_send_window / kDefaultTCPMSS - 2; i += 2) {
// Send our full send window.
SendAvailableSendWindow();
AckNPackets(2);
diff --git a/net/quic/congestion_control/tcp_loss_algorithm.h b/net/quic/congestion_control/tcp_loss_algorithm.h
index 13c9c92..35f04ce79 100644
--- a/net/quic/congestion_control/tcp_loss_algorithm.h
+++ b/net/quic/congestion_control/tcp_loss_algorithm.h
@@ -8,7 +8,7 @@
#include <algorithm>
#include <map>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/quic/congestion_control/loss_detection_interface.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
diff --git a/net/quic/congestion_control/tcp_loss_algorithm_test.cc b/net/quic/congestion_control/tcp_loss_algorithm_test.cc
index 4f98de7..72de527 100644
--- a/net/quic/congestion_control/tcp_loss_algorithm_test.cc
+++ b/net/quic/congestion_control/tcp_loss_algorithm_test.cc
@@ -20,7 +20,7 @@
namespace {
// Default packet length.
-const uint32 kDefaultLength = 1000;
+const uint32_t kDefaultLength = 1000;
class TcpLossAlgorithmTest : public ::testing::Test {
protected:
@@ -151,7 +151,7 @@
unacked_packets_.RemoveFromInFlight(kNumSentPackets);
// This simulates a single ack following multiple missing packets with FACK.
for (size_t i = 1; i < kNumSentPackets; ++i) {
- unacked_packets_.NackPacket(i, static_cast<uint16>(kNumSentPackets - i));
+ unacked_packets_.NackPacket(i, static_cast<uint16_t>(kNumSentPackets - i));
}
QuicPacketNumber lost[] = {1, 2};
VerifyLosses(kNumSentPackets, lost, arraysize(lost));
diff --git a/net/quic/congestion_control/time_loss_algorithm.h b/net/quic/congestion_control/time_loss_algorithm.h
index 16989e8..6c1359e 100644
--- a/net/quic/congestion_control/time_loss_algorithm.h
+++ b/net/quic/congestion_control/time_loss_algorithm.h
@@ -8,7 +8,7 @@
#include <algorithm>
#include <map>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/quic/congestion_control/loss_detection_interface.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
diff --git a/net/quic/congestion_control/time_loss_algorithm_test.cc b/net/quic/congestion_control/time_loss_algorithm_test.cc
index e5ddaee..7b6197ca6e 100644
--- a/net/quic/congestion_control/time_loss_algorithm_test.cc
+++ b/net/quic/congestion_control/time_loss_algorithm_test.cc
@@ -20,7 +20,7 @@
namespace {
// Default packet length.
-const uint32 kDefaultLength = 1000;
+const uint32_t kDefaultLength = 1000;
class TimeLossAlgorithmTest : public ::testing::Test {
protected:
@@ -65,7 +65,7 @@
SendDataPacket(i);
}
unacked_packets_.RemoveFromInFlight(2);
- for (uint16 i = 1; i < 500; ++i) {
+ for (uint16_t i = 1; i < 500; ++i) {
unacked_packets_.NackPacket(1, i);
VerifyLosses(2, nullptr, 0);
}
diff --git a/net/quic/crypto/aead_base_decrypter.h b/net/quic/crypto/aead_base_decrypter.h
index edb06d0..39cc555 100644
--- a/net/quic/crypto/aead_base_decrypter.h
+++ b/net/quic/crypto/aead_base_decrypter.h
@@ -5,7 +5,10 @@
#ifndef NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_
#define NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_
+#include <stddef.h>
+
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/quic/crypto/quic_decrypter.h"
#if defined(USE_OPENSSL)
diff --git a/net/quic/crypto/aead_base_decrypter_nss.cc b/net/quic/crypto/aead_base_decrypter_nss.cc
index 806abe252..9036681 100644
--- a/net/quic/crypto/aead_base_decrypter_nss.cc
+++ b/net/quic/crypto/aead_base_decrypter_nss.cc
@@ -55,7 +55,7 @@
return false;
}
- uint8 nonce[sizeof(nonce_prefix_) + sizeof(packet_number)];
+ uint8_t nonce[sizeof(nonce_prefix_) + sizeof(packet_number)];
const size_t nonce_size = nonce_prefix_size_ + sizeof(packet_number);
DCHECK_LE(nonce_size, sizeof(nonce));
memcpy(nonce, nonce_prefix_, nonce_prefix_size_);
@@ -99,7 +99,7 @@
unsigned int output_len;
if (PK11_Decrypt(aead_key.get(), aead_mechanism_, ¶m,
- reinterpret_cast<uint8*>(output), &output_len,
+ reinterpret_cast<uint8_t*>(output), &output_len,
max_output_length,
reinterpret_cast<const unsigned char*>(ciphertext.data()),
ciphertext.length()) != SECSuccess) {
diff --git a/net/quic/crypto/aead_base_decrypter_openssl.cc b/net/quic/crypto/aead_base_decrypter_openssl.cc
index b6d3d96..3a4e464 100644
--- a/net/quic/crypto/aead_base_decrypter_openssl.cc
+++ b/net/quic/crypto/aead_base_decrypter_openssl.cc
@@ -87,7 +87,7 @@
return false;
}
- uint8 nonce[sizeof(nonce_prefix_) + sizeof(packet_number)];
+ uint8_t nonce[sizeof(nonce_prefix_) + sizeof(packet_number)];
const size_t nonce_size = nonce_prefix_size_ + sizeof(packet_number);
memcpy(nonce, nonce_prefix_, nonce_prefix_size_);
memcpy(nonce + nonce_prefix_size_, &packet_number, sizeof(packet_number));
diff --git a/net/quic/crypto/aead_base_encrypter.h b/net/quic/crypto/aead_base_encrypter.h
index 25bef1d..74219d6 100644
--- a/net/quic/crypto/aead_base_encrypter.h
+++ b/net/quic/crypto/aead_base_encrypter.h
@@ -5,7 +5,10 @@
#ifndef NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_
#define NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_
+#include <stddef.h>
+
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/quic/crypto/quic_encrypter.h"
#if defined(USE_OPENSSL)
diff --git a/net/quic/crypto/aes_128_gcm_12_decrypter.h b/net/quic/crypto/aes_128_gcm_12_decrypter.h
index 3d81dba..d0d305a 100644
--- a/net/quic/crypto/aes_128_gcm_12_decrypter.h
+++ b/net/quic/crypto/aes_128_gcm_12_decrypter.h
@@ -5,6 +5,10 @@
#ifndef NET_QUIC_CRYPTO_AES_128_GCM_12_DECRYPTER_H_
#define NET_QUIC_CRYPTO_AES_128_GCM_12_DECRYPTER_H_
+#include <stddef.h>
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/quic/crypto/aead_base_decrypter.h"
namespace net {
@@ -35,7 +39,7 @@
#endif
const char* cipher_name() const override;
- uint32 cipher_id() const override;
+ uint32_t cipher_id() const override;
private:
DISALLOW_COPY_AND_ASSIGN(Aes128Gcm12Decrypter);
diff --git a/net/quic/crypto/aes_128_gcm_12_decrypter_nss.cc b/net/quic/crypto/aes_128_gcm_12_decrypter_nss.cc
index ba8a85c..abbc565 100644
--- a/net/quic/crypto/aes_128_gcm_12_decrypter_nss.cc
+++ b/net/quic/crypto/aes_128_gcm_12_decrypter_nss.cc
@@ -48,7 +48,7 @@
return "ECDHE-RSA-AES128-GCM-SHA256";
}
-uint32 Aes128Gcm12Decrypter::cipher_id() const {
+uint32_t Aes128Gcm12Decrypter::cipher_id() const {
// TODO(rtenneti): when Chromium requires NSS 3.15.2 or later, use
// TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 instead of 0xC02F.
// Or'ed with 0x03000000 to match OpenSSL/BoringSSL implementations.
diff --git a/net/quic/crypto/aes_128_gcm_12_decrypter_openssl.cc b/net/quic/crypto/aes_128_gcm_12_decrypter_openssl.cc
index 1e4056b..e0d500a 100644
--- a/net/quic/crypto/aes_128_gcm_12_decrypter_openssl.cc
+++ b/net/quic/crypto/aes_128_gcm_12_decrypter_openssl.cc
@@ -32,7 +32,7 @@
return TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256;
}
-uint32 Aes128Gcm12Decrypter::cipher_id() const {
+uint32_t Aes128Gcm12Decrypter::cipher_id() const {
// This OpenSSL macro has the value 0x0300C02F. The two most significant bytes
// 0x0300 are OpenSSL specific and are NOT part of the TLS CipherSuite value
// for TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256.
diff --git a/net/quic/crypto/aes_128_gcm_12_encrypter.h b/net/quic/crypto/aes_128_gcm_12_encrypter.h
index 2b432fb..f2f7b41 100644
--- a/net/quic/crypto/aes_128_gcm_12_encrypter.h
+++ b/net/quic/crypto/aes_128_gcm_12_encrypter.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_CRYPTO_AES_128_GCM_12_ENCRYPTER_H_
#define NET_QUIC_CRYPTO_AES_128_GCM_12_ENCRYPTER_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/crypto/aead_base_encrypter.h"
namespace net {
diff --git a/net/quic/crypto/cert_compressor.cc b/net/quic/crypto/cert_compressor.cc
index 362a58b..5851bd9 100644
--- a/net/quic/crypto/cert_compressor.cc
+++ b/net/quic/crypto/cert_compressor.cc
@@ -166,9 +166,9 @@
};
Type type;
- uint64 hash;
- uint64 set_hash;
- uint32 index;
+ uint64_t hash;
+ uint64_t set_hash;
+ uint32_t index;
};
// MatchCerts returns a vector of CertEntries describing how to most
@@ -183,7 +183,7 @@
entries.reserve(certs.size());
const bool cached_valid =
- client_cached_cert_hashes.size() % sizeof(uint64) == 0 &&
+ client_cached_cert_hashes.size() % sizeof(uint64_t) == 0 &&
!client_cached_cert_hashes.empty();
for (vector<string>::const_iterator i = certs.begin(); i != certs.end();
@@ -193,13 +193,13 @@
if (cached_valid) {
bool cached = false;
- uint64 hash = QuicUtils::FNV1a_64_Hash(i->data(), i->size());
+ uint64_t hash = QuicUtils::FNV1a_64_Hash(i->data(), i->size());
// This assumes that the machine is little-endian.
for (size_t j = 0; j < client_cached_cert_hashes.size();
- j += sizeof(uint64)) {
- uint64 cached_hash;
+ j += sizeof(uint64_t)) {
+ uint64_t cached_hash;
memcpy(&cached_hash, client_cached_cert_hashes.data() + j,
- sizeof(uint64));
+ sizeof(uint64_t));
if (hash != cached_hash) {
continue;
}
@@ -243,10 +243,10 @@
case CertEntry::COMPRESSED:
break;
case CertEntry::CACHED:
- entries_size += sizeof(uint64);
+ entries_size += sizeof(uint64_t);
break;
case CertEntry::COMMON:
- entries_size += sizeof(uint64) + sizeof(uint32);
+ entries_size += sizeof(uint64_t) + sizeof(uint32_t);
break;
}
}
@@ -258,23 +258,23 @@
// SerializeCertEntries serialises |entries| to |out|, which must have enough
// space to contain them.
-void SerializeCertEntries(uint8* out, const vector<CertEntry>& entries) {
+void SerializeCertEntries(uint8_t* out, const vector<CertEntry>& entries) {
for (vector<CertEntry>::const_iterator i = entries.begin();
i != entries.end(); ++i) {
- *out++ = static_cast<uint8>(i->type);
+ *out++ = static_cast<uint8_t>(i->type);
switch (i->type) {
case CertEntry::COMPRESSED:
break;
case CertEntry::CACHED:
memcpy(out, &i->hash, sizeof(i->hash));
- out += sizeof(uint64);
+ out += sizeof(uint64_t);
break;
case CertEntry::COMMON:
// Assumes a little-endian machine.
memcpy(out, &i->set_hash, sizeof(i->set_hash));
out += sizeof(i->set_hash);
- memcpy(out, &i->index, sizeof(uint32));
- out += sizeof(uint32);
+ memcpy(out, &i->index, sizeof(uint32_t));
+ out += sizeof(uint32_t);
break;
}
}
@@ -318,8 +318,8 @@
}
// HashCerts returns the FNV-1a hashes of |certs|.
-vector<uint64> HashCerts(const vector<string>& certs) {
- vector<uint64> ret;
+vector<uint64_t> HashCerts(const vector<string>& certs) {
+ vector<uint64_t> ret;
ret.reserve(certs.size());
for (vector<string>::const_iterator i = certs.begin(); i != certs.end();
@@ -340,7 +340,7 @@
vector<CertEntry>* out_entries,
vector<string>* out_certs) {
StringPiece in = *in_out;
- vector<uint64> cached_hashes;
+ vector<uint64_t> cached_hashes;
out_entries->clear();
out_certs->clear();
@@ -350,7 +350,7 @@
return false;
}
CertEntry entry;
- const uint8 type_byte = in[0];
+ const uint8_t type_byte = in[0];
in.remove_prefix(1);
if (type_byte == 0) {
@@ -364,11 +364,11 @@
out_certs->push_back(string());
break;
case CertEntry::CACHED: {
- if (in.size() < sizeof(uint64)) {
+ if (in.size() < sizeof(uint64_t)) {
return false;
}
- memcpy(&entry.hash, in.data(), sizeof(uint64));
- in.remove_prefix(sizeof(uint64));
+ memcpy(&entry.hash, in.data(), sizeof(uint64_t));
+ in.remove_prefix(sizeof(uint64_t));
if (cached_hashes.size() != cached_certs.size()) {
cached_hashes = HashCerts(cached_certs);
@@ -390,13 +390,13 @@
if (!common_sets) {
return false;
}
- if (in.size() < sizeof(uint64) + sizeof(uint32)) {
+ if (in.size() < sizeof(uint64_t) + sizeof(uint32_t)) {
return false;
}
- memcpy(&entry.set_hash, in.data(), sizeof(uint64));
- in.remove_prefix(sizeof(uint64));
- memcpy(&entry.index, in.data(), sizeof(uint32));
- in.remove_prefix(sizeof(uint32));
+ memcpy(&entry.set_hash, in.data(), sizeof(uint64_t));
+ in.remove_prefix(sizeof(uint64_t));
+ memcpy(&entry.index, in.data(), sizeof(uint32_t));
+ in.remove_prefix(sizeof(uint32_t));
StringPiece cert = common_sets->GetCert(entry.set_hash, entry.index);
if (cert.empty()) {
@@ -464,7 +464,7 @@
size_t uncompressed_size = 0;
for (size_t i = 0; i < entries.size(); i++) {
if (entries[i].type == CertEntry::COMPRESSED) {
- uncompressed_size += 4 /* uint32 length */ + certs[i].size();
+ uncompressed_size += 4 /* uint32_t length */ + certs[i].size();
}
}
@@ -483,8 +483,8 @@
string zlib_dict = ZlibDictForEntries(entries, certs);
- rv = deflateSetDictionary(&z, reinterpret_cast<const uint8*>(&zlib_dict[0]),
- zlib_dict.size());
+ rv = deflateSetDictionary(
+ &z, reinterpret_cast<const uint8_t*>(&zlib_dict[0]), zlib_dict.size());
DCHECK_EQ(Z_OK, rv);
if (rv != Z_OK) {
return "";
@@ -499,7 +499,7 @@
result.resize(entries_size + (uncompressed_size > 0 ? 4 : 0) +
compressed_size);
- uint8* j = reinterpret_cast<uint8*>(&result[0]);
+ uint8_t* j = reinterpret_cast<uint8_t*>(&result[0]);
SerializeCertEntries(j, entries);
j += entries_size;
@@ -507,9 +507,9 @@
return result;
}
- uint32 uncompressed_size_32 = uncompressed_size;
- memcpy(j, &uncompressed_size_32, sizeof(uint32));
- j += sizeof(uint32);
+ uint32_t uncompressed_size_32 = uncompressed_size;
+ memcpy(j, &uncompressed_size_32, sizeof(uint32_t));
+ j += sizeof(uint32_t);
int rv;
@@ -521,8 +521,8 @@
continue;
}
- uint32 length32 = certs[i].size();
- z.next_in = reinterpret_cast<uint8*>(&length32);
+ uint32_t length32 = certs[i].size();
+ z.next_in = reinterpret_cast<uint8_t*>(&length32);
z.avail_in = sizeof(length32);
rv = deflate(&z, Z_NO_FLUSH);
DCHECK_EQ(Z_OK, rv);
@@ -532,7 +532,7 @@
}
z.next_in =
- const_cast<uint8*>(reinterpret_cast<const uint8*>(certs[i].data()));
+ const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(certs[i].data()));
z.avail_in = certs[i].size();
rv = deflate(&z, Z_NO_FLUSH);
DCHECK_EQ(Z_OK, rv);
@@ -564,30 +564,31 @@
}
DCHECK_EQ(entries.size(), out_certs->size());
- scoped_ptr<uint8[]> uncompressed_data;
+ scoped_ptr<uint8_t[]> uncompressed_data;
StringPiece uncompressed;
if (!in.empty()) {
- if (in.size() < sizeof(uint32)) {
+ if (in.size() < sizeof(uint32_t)) {
return false;
}
- uint32 uncompressed_size;
+ uint32_t uncompressed_size;
memcpy(&uncompressed_size, in.data(), sizeof(uncompressed_size));
- in.remove_prefix(sizeof(uint32));
+ in.remove_prefix(sizeof(uint32_t));
if (uncompressed_size > 128 * 1024) {
return false;
}
- uncompressed_data.reset(new uint8[uncompressed_size]);
+ uncompressed_data.reset(new uint8_t[uncompressed_size]);
z_stream z;
ScopedZLib scoped_z(ScopedZLib::INFLATE);
memset(&z, 0, sizeof(z));
z.next_out = uncompressed_data.get();
z.avail_out = uncompressed_size;
- z.next_in = const_cast<uint8*>(reinterpret_cast<const uint8*>(in.data()));
+ z.next_in =
+ const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(in.data()));
z.avail_in = in.size();
if (Z_OK != inflateInit(&z)) {
@@ -598,7 +599,7 @@
int rv = inflate(&z, Z_FINISH);
if (rv == Z_NEED_DICT) {
string zlib_dict = ZlibDictForEntries(entries, *out_certs);
- const uint8* dict = reinterpret_cast<const uint8*>(zlib_dict.data());
+ const uint8_t* dict = reinterpret_cast<const uint8_t*>(zlib_dict.data());
if (Z_OK != inflateSetDictionary(&z, dict, zlib_dict.size())) {
return false;
}
@@ -616,12 +617,12 @@
for (size_t i = 0; i < entries.size(); i++) {
switch (entries[i].type) {
case CertEntry::COMPRESSED:
- if (uncompressed.size() < sizeof(uint32)) {
+ if (uncompressed.size() < sizeof(uint32_t)) {
return false;
}
- uint32 cert_len;
+ uint32_t cert_len;
memcpy(&cert_len, uncompressed.data(), sizeof(cert_len));
- uncompressed.remove_prefix(sizeof(uint32));
+ uncompressed.remove_prefix(sizeof(uint32_t));
if (uncompressed.size() < cert_len) {
return false;
}
diff --git a/net/quic/crypto/cert_compressor.h b/net/quic/crypto/cert_compressor.h
index d95c5bce..c700f7c 100644
--- a/net/quic/crypto/cert_compressor.h
+++ b/net/quic/crypto/cert_compressor.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/quic/crypto/common_cert_set.h"
diff --git a/net/quic/crypto/cert_compressor_test.cc b/net/quic/crypto/cert_compressor_test.cc
index 7e8a0f27..baefae5 100644
--- a/net/quic/crypto/cert_compressor_test.cc
+++ b/net/quic/crypto/cert_compressor_test.cc
@@ -46,7 +46,7 @@
TEST(CertCompressor, Common) {
vector<string> chain;
chain.push_back("testcert");
- static const uint64 set_hash = 42;
+ static const uint64_t set_hash = 42;
scoped_ptr<CommonCertSets> common_sets(
CryptoTestUtils::MockCommonCertSets(chain[0], set_hash, 1));
const string compressed = CertCompressor::CompressChain(
@@ -71,7 +71,7 @@
TEST(CertCompressor, Cached) {
vector<string> chain;
chain.push_back("testcert");
- uint64 hash = QuicUtils::FNV1a_64_Hash(chain[0].data(), chain[0].size());
+ uint64_t hash = QuicUtils::FNV1a_64_Hash(chain[0].data(), chain[0].size());
StringPiece hash_bytes(reinterpret_cast<char*>(&hash), sizeof(hash));
const string compressed =
CertCompressor::CompressChain(chain, StringPiece(), hash_bytes, nullptr);
diff --git a/net/quic/crypto/chacha20_poly1305_decrypter.h b/net/quic/crypto/chacha20_poly1305_decrypter.h
index 1d1a1cf..fad9bbb 100644
--- a/net/quic/crypto/chacha20_poly1305_decrypter.h
+++ b/net/quic/crypto/chacha20_poly1305_decrypter.h
@@ -5,6 +5,10 @@
#ifndef NET_QUIC_CRYPTO_CHACHA20_POLY1305_DECRYPTER_H_
#define NET_QUIC_CRYPTO_CHACHA20_POLY1305_DECRYPTER_H_
+#include <stddef.h>
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/quic/crypto/aead_base_decrypter.h"
namespace net {
@@ -36,7 +40,7 @@
#endif
const char* cipher_name() const override;
- uint32 cipher_id() const override;
+ uint32_t cipher_id() const override;
private:
DISALLOW_COPY_AND_ASSIGN(ChaCha20Poly1305Decrypter);
diff --git a/net/quic/crypto/chacha20_poly1305_decrypter_nss.cc b/net/quic/crypto/chacha20_poly1305_decrypter_nss.cc
index bbb06532..893f8a7 100644
--- a/net/quic/crypto/chacha20_poly1305_decrypter_nss.cc
+++ b/net/quic/crypto/chacha20_poly1305_decrypter_nss.cc
@@ -52,7 +52,7 @@
return "ECDHE-RSA-CHACHA20-POLY1305";
}
-uint32 ChaCha20Poly1305Decrypter::cipher_id() const {
+uint32_t ChaCha20Poly1305Decrypter::cipher_id() const {
// TODO(rtenneti): when Chromium requires NSS 3.15.2 or later, use
// TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 instead of 0xCC13.
// "OR" 0x03000000 to match OpenSSL/BoringSSL implementations.
diff --git a/net/quic/crypto/chacha20_poly1305_decrypter_openssl.cc b/net/quic/crypto/chacha20_poly1305_decrypter_openssl.cc
index 414274f..683f13b 100644
--- a/net/quic/crypto/chacha20_poly1305_decrypter_openssl.cc
+++ b/net/quic/crypto/chacha20_poly1305_decrypter_openssl.cc
@@ -34,7 +34,7 @@
return TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305_OLD;
}
-uint32 ChaCha20Poly1305Decrypter::cipher_id() const {
+uint32_t ChaCha20Poly1305Decrypter::cipher_id() const {
return TLS1_CK_ECDHE_RSA_CHACHA20_POLY1305_OLD;
}
diff --git a/net/quic/crypto/chacha20_poly1305_encrypter.h b/net/quic/crypto/chacha20_poly1305_encrypter.h
index 5c68c124..dfdfffe 100644
--- a/net/quic/crypto/chacha20_poly1305_encrypter.h
+++ b/net/quic/crypto/chacha20_poly1305_encrypter.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_CRYPTO_CHACHA20_POLY1305_ENCRYPTER_H_
#define NET_QUIC_CRYPTO_CHACHA20_POLY1305_ENCRYPTER_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/crypto/aead_base_encrypter.h"
namespace net {
diff --git a/net/quic/crypto/channel_id.h b/net/quic/crypto/channel_id.h
index bd335fb0..0ec1d4dd 100644
--- a/net/quic/crypto/channel_id.h
+++ b/net/quic/crypto/channel_id.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
diff --git a/net/quic/crypto/channel_id_chromium.cc b/net/quic/crypto/channel_id_chromium.cc
index da11663..ffcb67b 100644
--- a/net/quic/crypto/channel_id_chromium.cc
+++ b/net/quic/crypto/channel_id_chromium.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "base/macros.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "crypto/ec_private_key.h"
@@ -31,15 +32,15 @@
}
const size_t len1 = strlen(ChannelIDVerifier::kContextStr) + 1;
const size_t len2 = strlen(ChannelIDVerifier::kClientToServerStr) + 1;
- std::vector<uint8> data(len1 + len2 + signed_data.size());
+ std::vector<uint8_t> data(len1 + len2 + signed_data.size());
memcpy(&data[0], ChannelIDVerifier::kContextStr, len1);
memcpy(&data[len1], ChannelIDVerifier::kClientToServerStr, len2);
memcpy(&data[len1 + len2], signed_data.data(), signed_data.size());
- std::vector<uint8> der_signature;
+ std::vector<uint8_t> der_signature;
if (!sig_creator->Sign(&data[0], data.size(), &der_signature)) {
return false;
}
- std::vector<uint8> raw_signature;
+ std::vector<uint8_t> raw_signature;
if (!sig_creator->DecodeSignature(der_signature, &raw_signature)) {
return false;
}
diff --git a/net/quic/crypto/channel_id_chromium.h b/net/quic/crypto/channel_id_chromium.h
index 73c3cf1..7dfb9b5 100644
--- a/net/quic/crypto/channel_id_chromium.h
+++ b/net/quic/crypto/channel_id_chromium.h
@@ -7,6 +7,7 @@
#include <set>
+#include "base/macros.h"
#include "net/quic/crypto/channel_id.h"
namespace crypto {
diff --git a/net/quic/crypto/channel_id_openssl.cc b/net/quic/crypto/channel_id_openssl.cc
index 1ba0a883..4e576ae 100644
--- a/net/quic/crypto/channel_id_openssl.cc
+++ b/net/quic/crypto/channel_id_openssl.cc
@@ -44,9 +44,9 @@
sig.r = r.get();
sig.s = s.get();
- const uint8* key_bytes = reinterpret_cast<const uint8*>(key.data());
- const uint8* signature_bytes =
- reinterpret_cast<const uint8*>(signature.data());
+ const uint8_t* key_bytes = reinterpret_cast<const uint8_t*>(key.data());
+ const uint8_t* signature_bytes =
+ reinterpret_cast<const uint8_t*>(signature.data());
if (BN_bin2bn(key_bytes + 0, 32, x.get()) == nullptr ||
BN_bin2bn(key_bytes + 32, 32, y.get()) == nullptr ||
diff --git a/net/quic/crypto/common_cert_set.cc b/net/quic/crypto/common_cert_set.cc
index 3d05d1fc..b771fa00 100644
--- a/net/quic/crypto/common_cert_set.cc
+++ b/net/quic/crypto/common_cert_set.cc
@@ -4,8 +4,8 @@
#include "net/quic/crypto/common_cert_set.h"
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/singleton.h"
#include "net/quic/quic_utils.h"
@@ -32,7 +32,7 @@
// of each certificate.
const size_t* lens;
// hash contains the 64-bit, FNV-1a hash of this set.
- uint64 hash;
+ uint64_t hash;
};
const CertSet kSets[] = {
@@ -46,7 +46,7 @@
},
};
-const uint64 kSetHashes[] = {
+const uint64_t kSetHashes[] = {
common_cert_set_1::kHash, common_cert_set_2::kHash,
};
@@ -77,10 +77,10 @@
// CommonCertSets interface.
StringPiece GetCommonHashes() const override {
return StringPiece(reinterpret_cast<const char*>(kSetHashes),
- sizeof(uint64) * arraysize(kSetHashes));
+ sizeof(uint64_t) * arraysize(kSetHashes));
}
- StringPiece GetCert(uint64 hash, uint32 index) const override {
+ StringPiece GetCert(uint64_t hash, uint32_t index) const override {
for (size_t i = 0; i < arraysize(kSets); i++) {
if (kSets[i].hash == hash) {
if (index < kSets[i].num_certs) {
@@ -97,16 +97,16 @@
bool MatchCert(StringPiece cert,
StringPiece common_set_hashes,
- uint64* out_hash,
- uint32* out_index) const override {
- if (common_set_hashes.size() % sizeof(uint64) != 0) {
+ uint64_t* out_hash,
+ uint32_t* out_index) const override {
+ if (common_set_hashes.size() % sizeof(uint64_t) != 0) {
return false;
}
- for (size_t i = 0; i < common_set_hashes.size() / sizeof(uint64); i++) {
- uint64 hash;
- memcpy(&hash, common_set_hashes.data() + i * sizeof(uint64),
- sizeof(uint64));
+ for (size_t i = 0; i < common_set_hashes.size() / sizeof(uint64_t); i++) {
+ uint64_t hash;
+ memcpy(&hash, common_set_hashes.data() + i * sizeof(uint64_t),
+ sizeof(uint64_t));
for (size_t j = 0; j < arraysize(kSets); j++) {
if (kSets[j].hash != hash) {
diff --git a/net/quic/crypto/common_cert_set.h b/net/quic/crypto/common_cert_set.h
index a9e93045..b4fbfac0 100644
--- a/net/quic/crypto/common_cert_set.h
+++ b/net/quic/crypto/common_cert_set.h
@@ -5,7 +5,8 @@
#ifndef NET_QUIC_CRYPTO_COMMON_CERT_SET_H_
#define NET_QUIC_CRYPTO_COMMON_CERT_SET_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "base/compiler_specific.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -30,7 +31,7 @@
// GetCert returns a specific certificate (at index |index|) in the common
// set identified by |hash|. If no such certificate is known, an empty
// StringPiece is returned.
- virtual base::StringPiece GetCert(uint64 hash, uint32 index) const = 0;
+ virtual base::StringPiece GetCert(uint64_t hash, uint32_t index) const = 0;
// MatchCert tries to find |cert| in one of the common certificate sets
// identified by |common_set_hashes|. On success it puts the hash of the
@@ -38,8 +39,8 @@
// returns true. Otherwise it returns false.
virtual bool MatchCert(base::StringPiece cert,
base::StringPiece common_set_hashes,
- uint64* out_hash,
- uint32* out_index) const = 0;
+ uint64_t* out_hash,
+ uint32_t* out_index) const = 0;
};
} // namespace net
diff --git a/net/quic/crypto/common_cert_set_1.c b/net/quic/crypto/common_cert_set_1.c
index aa436e2e..8d41647 100644
--- a/net/quic/crypto/common_cert_set_1.c
+++ b/net/quic/crypto/common_cert_set_1.c
@@ -140,4 +140,4 @@
1770,
};
-static const uint64 kHash = UINT64_C(0xff715ce4e7e9267b);
+static const uint64_t kHash = UINT64_C(0xff715ce4e7e9267b);
diff --git a/net/quic/crypto/common_cert_set_2.c b/net/quic/crypto/common_cert_set_2.c
index 320fe61..09cb6c1 100644
--- a/net/quic/crypto/common_cert_set_2.c
+++ b/net/quic/crypto/common_cert_set_2.c
@@ -124,4 +124,4 @@
1770,
};
-static const uint64 kHash = UINT64_C(0xe81a92926081e801);
+static const uint64_t kHash = UINT64_C(0xe81a92926081e801);
diff --git a/net/quic/crypto/common_cert_set_test.cc b/net/quic/crypto/common_cert_set_test.cc
index 39d0d7a7..e98194ca 100644
--- a/net/quic/crypto/common_cert_set_test.cc
+++ b/net/quic/crypto/common_cert_set_test.cc
@@ -194,9 +194,9 @@
const CommonCertSets* sets(CommonCertSets::GetInstanceQUIC());
// Common Cert Set 1's hash.
- const uint64 in_hash = UINT64_C(0xff715ce4e7e9267b);
- uint64 hash;
- uint32 index;
+ const uint64_t in_hash = UINT64_C(0xff715ce4e7e9267b);
+ uint64_t hash;
+ uint32_t index;
ASSERT_TRUE(sets->MatchCert(
gia,
StringPiece(reinterpret_cast<const char*>(&in_hash), sizeof(in_hash)),
@@ -215,9 +215,9 @@
const CommonCertSets* sets(CommonCertSets::GetInstanceQUIC());
// Common Cert Set 2's hash.
- const uint64 in_hash = UINT64_C(0xe81a92926081e801);
- uint64 hash;
- uint32 index;
+ const uint64_t in_hash = UINT64_C(0xe81a92926081e801);
+ uint64_t hash;
+ uint32_t index;
ASSERT_TRUE(sets->MatchCert(
gia,
StringPiece(reinterpret_cast<const char*>(&in_hash), sizeof(in_hash)),
@@ -233,9 +233,9 @@
TEST(CommonCertSets, NonMatch) {
const CommonCertSets* sets(CommonCertSets::GetInstanceQUIC());
StringPiece not_a_cert("hello");
- const uint64 in_hash = UINT64_C(0xc9fef74053f99f39);
- uint64 hash;
- uint32 index;
+ const uint64_t in_hash = UINT64_C(0xc9fef74053f99f39);
+ uint64_t hash;
+ uint32_t index;
EXPECT_FALSE(sets->MatchCert(
not_a_cert,
StringPiece(reinterpret_cast<const char*>(&in_hash), sizeof(in_hash)),
diff --git a/net/quic/crypto/crypto_framer.cc b/net/quic/crypto/crypto_framer.cc
index 0b747962..3e818ab 100644
--- a/net/quic/crypto/crypto_framer.cc
+++ b/net/quic/crypto/crypto_framer.cc
@@ -16,9 +16,9 @@
namespace {
-const size_t kQuicTagSize = sizeof(uint32);
-const size_t kCryptoEndOffsetSize = sizeof(uint32);
-const size_t kNumEntriesSize = sizeof(uint16);
+const size_t kQuicTagSize = sizeof(uint32_t);
+const size_t kCryptoEndOffsetSize = sizeof(uint32_t);
+const size_t kNumEntriesSize = sizeof(uint16_t);
// OneShotVisitor is a framer visitor that records a single handshake message.
class OneShotVisitor : public CryptoFramerVisitorInterface {
@@ -109,7 +109,7 @@
DCHECK(false) << "Failed to write message tag.";
return nullptr;
}
- if (!writer.WriteUInt16(static_cast<uint16>(num_entries))) {
+ if (!writer.WriteUInt16(static_cast<uint16_t>(num_entries))) {
DCHECK(false) << "Failed to write size.";
return nullptr;
}
@@ -118,7 +118,7 @@
return nullptr;
}
- uint32 end_offset = 0;
+ uint32_t end_offset = 0;
// Tags and offsets
for (QuicTagValueMap::const_iterator it = message.tag_value_map().begin();
it != message.tag_value_map().end(); ++it) {
@@ -203,14 +203,14 @@
message_.set_tag(message_tag);
state_ = STATE_READING_NUM_ENTRIES;
case STATE_READING_NUM_ENTRIES:
- if (reader.BytesRemaining() < kNumEntriesSize + sizeof(uint16)) {
+ if (reader.BytesRemaining() < kNumEntriesSize + sizeof(uint16_t)) {
break;
}
reader.ReadUInt16(&num_entries_);
if (num_entries_ > kMaxEntries) {
return QUIC_CRYPTO_TOO_MANY_ENTRIES;
}
- uint16 padding;
+ uint16_t padding;
reader.ReadUInt16(&padding);
tags_and_lengths_.reserve(num_entries_);
@@ -222,7 +222,7 @@
break;
}
- uint32 last_end_offset = 0;
+ uint32_t last_end_offset = 0;
for (unsigned i = 0; i < num_entries_; ++i) {
QuicTag tag;
reader.ReadUInt32(&tag);
@@ -233,7 +233,7 @@
return QUIC_CRYPTO_TAGS_OUT_OF_ORDER;
}
- uint32 end_offset;
+ uint32_t end_offset;
reader.ReadUInt32(&end_offset);
if (end_offset < last_end_offset) {
@@ -268,7 +268,7 @@
// static
bool CryptoFramer::WritePadTag(QuicDataWriter* writer,
size_t pad_length,
- uint32* end_offset) {
+ uint32_t* end_offset) {
if (!writer->WriteUInt32(kPAD)) {
DCHECK(false) << "Failed to write tag.";
return false;
diff --git a/net/quic/crypto/crypto_framer.h b/net/quic/crypto/crypto_framer.h
index 64137a2..420c151 100644
--- a/net/quic/crypto/crypto_framer.h
+++ b/net/quic/crypto/crypto_framer.h
@@ -5,10 +5,12 @@
#ifndef NET_QUIC_CRYPTO_CRYPTO_FRAMER_H_
#define NET_QUIC_CRYPTO_CRYPTO_FRAMER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <utility>
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -79,7 +81,7 @@
static bool WritePadTag(QuicDataWriter* writer,
size_t pad_length,
- uint32* end_offset);
+ uint32_t* end_offset);
// Represents the current state of the parsing state machine.
enum CryptoFramerState {
@@ -100,7 +102,7 @@
// The message currently being parsed.
CryptoHandshakeMessage message_;
// Number of entires in the message currently being parsed.
- uint16 num_entries_;
+ uint16_t num_entries_;
// tags_and_lengths_ contains the tags that are currently being parsed and
// their lengths.
std::vector<std::pair<QuicTag, size_t>> tags_and_lengths_;
diff --git a/net/quic/crypto/crypto_framer_test.cc b/net/quic/crypto/crypto_framer_test.cc
index 25af325..f60380f 100644
--- a/net/quic/crypto/crypto_framer_test.cc
+++ b/net/quic/crypto/crypto_framer_test.cc
@@ -159,7 +159,7 @@
TEST(CryptoFramerTest, ConstructHandshakeMessageTooManyEntries) {
CryptoHandshakeMessage message;
message.set_tag(0xFFAA7733);
- for (uint32 key = 1; key <= kMaxEntries + 1; ++key) {
+ for (uint32_t key = 1; key <= kMaxEntries + 1; ++key) {
message.SetStringPiece(key, "abcdef");
}
diff --git a/net/quic/crypto/crypto_handshake.h b/net/quic/crypto/crypto_handshake.h
index 7cacb67..71792bac 100644
--- a/net/quic/crypto/crypto_handshake.h
+++ b/net/quic/crypto/crypto_handshake.h
@@ -5,9 +5,12 @@
#ifndef NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_
#define NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/quic/quic_protocol.h"
@@ -83,7 +86,8 @@
MAX_FAILURE_REASON = 22,
};
-// These errors will be packed into an uint32 and we don't want to set the most
+// These errors will be packed into an uint32_t and we don't want to set the
+// most
// significant bit, which may be misinterpreted as the sign bit.
static_assert(MAX_FAILURE_REASON <= 32, "failure reason out of sync");
diff --git a/net/quic/crypto/crypto_handshake_message.cc b/net/quic/crypto/crypto_handshake_message.cc
index 7e57d5c..b81b4629 100644
--- a/net/quic/crypto/crypto_handshake_message.cc
+++ b/net/quic/crypto/crypto_handshake_message.cc
@@ -165,19 +165,19 @@
}
QuicErrorCode CryptoHandshakeMessage::GetUint32(QuicTag tag,
- uint32* out) const {
- return GetPOD(tag, out, sizeof(uint32));
+ uint32_t* out) const {
+ return GetPOD(tag, out, sizeof(uint32_t));
}
QuicErrorCode CryptoHandshakeMessage::GetUint64(QuicTag tag,
- uint64* out) const {
- return GetPOD(tag, out, sizeof(uint64));
+ uint64_t* out) const {
+ return GetPOD(tag, out, sizeof(uint64_t));
}
size_t CryptoHandshakeMessage::size() const {
- size_t ret = sizeof(QuicTag) + sizeof(uint16) /* number of entries */ +
- sizeof(uint16) /* padding */;
- ret += (sizeof(QuicTag) + sizeof(uint32) /* end offset */) *
+ size_t ret = sizeof(QuicTag) + sizeof(uint16_t) /* number of entries */ +
+ sizeof(uint16_t) /* padding */;
+ ret += (sizeof(QuicTag) + sizeof(uint32_t) /* end offset */) *
tag_value_map_.size();
for (QuicTagValueMap::const_iterator i = tag_value_map_.begin();
i != tag_value_map_.end(); ++i) {
@@ -240,9 +240,9 @@
case kMSPC:
case kSRBF:
case kSWND:
- // uint32 value
+ // uint32_t value
if (it->second.size() == 4) {
- uint32 value;
+ uint32_t value;
memcpy(&value, it->second.data(), sizeof(value));
ret += base::UintToString(value);
done = true;
@@ -268,10 +268,10 @@
}
break;
case kRREJ:
- // uint32 lists
- if (it->second.size() % sizeof(uint32) == 0) {
- for (size_t j = 0; j < it->second.size(); j += sizeof(uint32)) {
- uint32 value;
+ // uint32_t lists
+ if (it->second.size() % sizeof(uint32_t) == 0) {
+ for (size_t j = 0; j < it->second.size(); j += sizeof(uint32_t)) {
+ uint32_t value;
memcpy(&value, it->second.data() + j, sizeof(value));
if (j > 0) {
ret += ",";
diff --git a/net/quic/crypto/crypto_handshake_message.h b/net/quic/crypto/crypto_handshake_message.h
index 02af063..a3778cb7 100644
--- a/net/quic/crypto/crypto_handshake_message.h
+++ b/net/quic/crypto/crypto_handshake_message.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_MESSAGE_H_
#define NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_MESSAGE_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
@@ -88,10 +91,10 @@
QuicErrorCode GetNthValue24(QuicTag tag,
unsigned index,
base::StringPiece* out) const;
- QuicErrorCode GetUint32(QuicTag tag, uint32* out) const;
- QuicErrorCode GetUint64(QuicTag tag, uint64* out) const;
+ QuicErrorCode GetUint32(QuicTag tag, uint32_t* out) const;
+ QuicErrorCode GetUint64(QuicTag tag, uint64_t* out) const;
- // size returns 4 (message tag) + 2 (uint16, number of entries) +
+ // size returns 4 (message tag) + 2 (uint16_t, number of entries) +
// (4 (tag) + 4 (end offset))*tag_value_map_.size() + ∑ value sizes.
size_t size() const;
diff --git a/net/quic/crypto/crypto_handshake_message_test.cc b/net/quic/crypto/crypto_handshake_message_test.cc
index c53f895..1bda50f 100644
--- a/net/quic/crypto/crypto_handshake_message_test.cc
+++ b/net/quic/crypto/crypto_handshake_message_test.cc
@@ -21,7 +21,7 @@
TEST(CryptoHandshakeMessageTest, DebugStringWithUintVector) {
CryptoHandshakeMessage message;
message.set_tag(kREJ);
- std::vector<uint32> reasons = {
+ std::vector<uint32_t> reasons = {
SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE,
CLIENT_NONCE_NOT_UNIQUE_FAILURE};
message.SetVector(kRREJ, reasons);
diff --git a/net/quic/crypto/crypto_protocol.h b/net/quic/crypto/crypto_protocol.h
index b4017ed..2eff18f 100644
--- a/net/quic/crypto/crypto_protocol.h
+++ b/net/quic/crypto/crypto_protocol.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_CRYPTO_CRYPTO_PROTOCOL_H_
#define NET_QUIC_CRYPTO_CRYPTO_PROTOCOL_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include "net/base/net_export.h"
@@ -14,7 +17,7 @@
// representation of the name of the tag. For example
// the client hello tag (CHLO) will be written as the
// following 4 bytes: 'C' 'H' 'L' 'O'. Since it is
-// stored in memory as a little endian uint32, we need
+// stored in memory as a little endian uint32_t, we need
// to reverse the order of the bytes.
//
// We use a macro to ensure that no static initialisers are created. Use the
diff --git a/net/quic/crypto/crypto_secret_boxer.h b/net/quic/crypto/crypto_secret_boxer.h
index 38b8fb3..266b34a 100644
--- a/net/quic/crypto/crypto_secret_boxer.h
+++ b/net/quic/crypto/crypto_secret_boxer.h
@@ -5,8 +5,11 @@
#ifndef NET_QUIC_CRYPTO_CRYPTO_SECRET_BOXER_H_
#define NET_QUIC_CRYPTO_CRYPTO_SECRET_BOXER_H_
+#include <stddef.h>
+
#include <string>
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
diff --git a/net/quic/crypto/crypto_secret_boxer_test.cc b/net/quic/crypto/crypto_secret_boxer_test.cc
index 79c3f81..185e0a70 100644
--- a/net/quic/crypto/crypto_secret_boxer_test.cc
+++ b/net/quic/crypto/crypto_secret_boxer_test.cc
@@ -17,7 +17,7 @@
TEST(CryptoSecretBoxerTest, BoxAndUnbox) {
StringPiece message("hello world");
const size_t key_size = CryptoSecretBoxer::GetKeySize();
- scoped_ptr<uint8[]> key(new uint8[key_size]);
+ scoped_ptr<uint8_t[]> key(new uint8_t[key_size]);
memset(key.get(), 0x11, key_size);
CryptoSecretBoxer boxer;
diff --git a/net/quic/crypto/crypto_server_config_protobuf.h b/net/quic/crypto/crypto_server_config_protobuf.h
index 5a98c2c..9e1f9d3 100644
--- a/net/quic/crypto/crypto_server_config_protobuf.h
+++ b/net/quic/crypto/crypto_server_config_protobuf.h
@@ -5,10 +5,14 @@
#ifndef NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_
#define NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/stl_util.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -59,15 +63,15 @@
bool has_primary_time() const { return primary_time_ > 0; }
- int64 primary_time() const { return primary_time_; }
+ int64_t primary_time() const { return primary_time_; }
- void set_primary_time(int64 primary_time) { primary_time_ = primary_time; }
+ void set_primary_time(int64_t primary_time) { primary_time_ = primary_time; }
bool has_priority() const { return priority_ > 0; }
- uint64 priority() const { return priority_; }
+ uint64_t priority() const { return priority_; }
- void set_priority(int64 priority) { priority_ = priority; }
+ void set_priority(int64_t priority) { priority_ = priority; }
bool has_source_address_token_secret_override() const {
return !source_address_token_secret_override_.empty();
@@ -91,12 +95,12 @@
// primary_time_ contains a UNIX epoch seconds value that indicates when this
// config should become primary.
- int64 primary_time_;
+ int64_t primary_time_;
// Relative priority of this config vs other configs with the same
// primary time. For use as a secondary sort key when selecting the
// primary config.
- uint64 priority_;
+ uint64_t priority_;
// Optional override to the secret used to box/unbox source address
// tokens when talking to clients that select this server config.
diff --git a/net/quic/crypto/crypto_server_test.cc b/net/quic/crypto/crypto_server_test.cc
index be0409c..b1ea7f09 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -5,7 +5,6 @@
#include <ostream>
#include <vector>
-#include "base/basictypes.h"
#include "base/strings/string_number_conversions.h"
#include "crypto/secure_hash.h"
#include "net/quic/crypto/cert_compressor.h"
@@ -324,9 +323,9 @@
void CheckRejectReasons(
const HandshakeFailureReason* expected_handshake_failures,
size_t expected_count) {
- const uint32* reject_reasons;
+ const uint32_t* reject_reasons;
size_t num_reject_reasons;
- static_assert(sizeof(QuicTag) == sizeof(uint32), "header_out_of_sync");
+ static_assert(sizeof(QuicTag) == sizeof(uint32_t), "header_out_of_sync");
QuicErrorCode error_code =
out_.GetTaglist(kRREJ, &reject_reasons, &num_reject_reasons);
ASSERT_EQ(QUIC_NO_ERROR, error_code);
@@ -385,7 +384,7 @@
}
std::ostringstream xlct_stream;
- uint64 xlct =
+ uint64_t xlct =
QuicUtils::FNV1a_64_Hash(certs->at(0).c_str(), certs->at(0).length());
return "#" + base::HexEncode(reinterpret_cast<char*>(&xlct), sizeof(xlct));
}
@@ -403,7 +402,7 @@
QuicCryptoNegotiatedParameters params_;
QuicCryptoProof crypto_proof_;
CryptoHandshakeMessage out_;
- uint8 orbit_[kOrbitSize];
+ uint8_t orbit_[kOrbitSize];
bool use_stateless_rejects_;
// These strings contain hex escaped values from the server suitable for using
@@ -1012,7 +1011,7 @@
scoped_ptr<crypto::SecureHash> hash(
crypto::SecureHash::Create(crypto::SecureHash::SHA256));
hash->Update(serialized.data(), serialized.length());
- uint8 digest[16];
+ uint8_t digest[16];
hash->Finish(digest, sizeof(digest));
ASSERT_EQ(scid.size(), sizeof(digest));
@@ -1107,9 +1106,9 @@
config_options_.orbit = kOrbit;
strike_register_client_ = new DelayedVerifyStrikeRegisterClient(
10000, // strike_register_max_entries
- static_cast<uint32>(clock_.WallNow().ToUNIXSeconds()),
+ static_cast<uint32_t>(clock_.WallNow().ToUNIXSeconds()),
60, // strike_register_window_secs
- reinterpret_cast<const uint8*>(kOrbit.c_str()),
+ reinterpret_cast<const uint8_t*>(kOrbit.c_str()),
StrikeRegister::NO_STARTUP_PERIOD_NEEDED);
config_.SetStrikeRegisterClient(strike_register_client_);
CryptoServerTest::SetUp();
diff --git a/net/quic/crypto/crypto_utils.cc b/net/quic/crypto/crypto_utils.cc
index ae8c3194..0c6a4a742 100644
--- a/net/quic/crypto/crypto_utils.cc
+++ b/net/quic/crypto/crypto_utils.cc
@@ -30,7 +30,7 @@
nonce->reserve(kNonceSize);
nonce->resize(kNonceSize);
- uint32 gmt_unix_time = static_cast<uint32>(now.ToUNIXSeconds());
+ uint32_t gmt_unix_time = static_cast<uint32_t>(now.ToUNIXSeconds());
// The time in the nonce must be encoded in big-endian because the
// strike-register depends on the nonces being ordered by time.
(*nonce)[0] = static_cast<char>(gmt_unix_time >> 24);
@@ -140,11 +140,11 @@
}
}
// Create HKDF info input: null-terminated label + length-prefixed context
- if (context.length() >= numeric_limits<uint32>::max()) {
+ if (context.length() >= numeric_limits<uint32_t>::max()) {
LOG(ERROR) << "Context value longer than 2^32";
return false;
}
- uint32 context_length = static_cast<uint32>(context.length());
+ uint32_t context_length = static_cast<uint32_t>(context.length());
string info = label.as_string();
info.push_back('\0');
info.append(reinterpret_cast<char*>(&context_length), sizeof(context_length));
@@ -157,7 +157,7 @@
}
// static
-uint64 CryptoUtils::ComputeLeafCertHash(const std::string& cert) {
+uint64_t CryptoUtils::ComputeLeafCertHash(const std::string& cert) {
return QuicUtils::FNV1a_64_Hash(cert.data(), cert.size());
}
diff --git a/net/quic/crypto/crypto_utils.h b/net/quic/crypto/crypto_utils.h
index f9f85bb..b4e40e9 100644
--- a/net/quic/crypto/crypto_utils.h
+++ b/net/quic/crypto/crypto_utils.h
@@ -7,8 +7,12 @@
#ifndef NET_QUIC_CRYPTO_CRYPTO_UTILS_H_
#define NET_QUIC_CRYPTO_CRYPTO_UTILS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/quic/crypto/crypto_handshake.h"
@@ -73,7 +77,7 @@
// Computes the FNV-1a hash of the provided DER-encoded cert for use in the
// XLCT tag.
- static uint64 ComputeLeafCertHash(const std::string& cert);
+ static uint64_t ComputeLeafCertHash(const std::string& cert);
// Validates that |server_hello| is actually an SHLO message and that it is
// not part of a downgrade attack.
diff --git a/net/quic/crypto/curve25519_key_exchange.cc b/net/quic/crypto/curve25519_key_exchange.cc
index b5cc5bf..cf97add 100644
--- a/net/quic/crypto/curve25519_key_exchange.cc
+++ b/net/quic/crypto/curve25519_key_exchange.cc
@@ -4,7 +4,6 @@
#include "net/quic/crypto/curve25519_key_exchange.h"
-#include "base/basictypes.h"
#include "base/logging.h"
#include "crypto/curve25519.h"
#include "net/quic/crypto/quic_random.h"
@@ -43,7 +42,7 @@
// static
string Curve25519KeyExchange::NewPrivateKey(QuicRandom* rand) {
- uint8 private_key[crypto::curve25519::kScalarBytes];
+ uint8_t private_key[crypto::curve25519::kScalarBytes];
rand->RandBytes(private_key, sizeof(private_key));
// This makes |private_key| a valid scalar, as specified on
@@ -66,10 +65,10 @@
return false;
}
- uint8 result[crypto::curve25519::kBytes];
+ uint8_t result[crypto::curve25519::kBytes];
if (!crypto::curve25519::ScalarMult(
private_key_,
- reinterpret_cast<const uint8*>(peer_public_value.data()), result)) {
+ reinterpret_cast<const uint8_t*>(peer_public_value.data()), result)) {
return false;
}
out_result->assign(reinterpret_cast<char*>(result), sizeof(result));
diff --git a/net/quic/crypto/curve25519_key_exchange.h b/net/quic/crypto/curve25519_key_exchange.h
index cdb6d1a..1637bbb 100644
--- a/net/quic/crypto/curve25519_key_exchange.h
+++ b/net/quic/crypto/curve25519_key_exchange.h
@@ -5,6 +5,8 @@
#ifndef NET_QUIC_CRYPTO_CURVE25519_KEY_EXCHANGE_H_
#define NET_QUIC_CRYPTO_CURVE25519_KEY_EXCHANGE_H_
+#include <stdint.h>
+
#include <string>
#include "base/compiler_specific.h"
@@ -40,8 +42,8 @@
private:
Curve25519KeyExchange();
- uint8 private_key_[32];
- uint8 public_key_[32];
+ uint8_t private_key_[32];
+ uint8_t public_key_[32];
};
} // namespace net
diff --git a/net/quic/crypto/local_strike_register_client.cc b/net/quic/crypto/local_strike_register_client.cc
index 22fd879..1d009a9 100644
--- a/net/quic/crypto/local_strike_register_client.cc
+++ b/net/quic/crypto/local_strike_register_client.cc
@@ -13,9 +13,9 @@
LocalStrikeRegisterClient::LocalStrikeRegisterClient(
unsigned max_entries,
- uint32 current_time_external,
- uint32 window_secs,
- const uint8 orbit[8],
+ uint32_t current_time_external,
+ uint32_t window_secs,
+ const uint8_t orbit[8],
StrikeRegister::StartupType startup)
: strike_register_(max_entries,
current_time_external,
@@ -41,8 +41,8 @@
} else {
base::AutoLock lock(m_);
nonce_error =
- strike_register_.Insert(reinterpret_cast<const uint8*>(nonce.data()),
- static_cast<uint32>(now.ToUNIXSeconds()));
+ strike_register_.Insert(reinterpret_cast<const uint8_t*>(nonce.data()),
+ static_cast<uint32_t>(now.ToUNIXSeconds()));
}
// m_ must not be held when the ResultCallback runs.
diff --git a/net/quic/crypto/local_strike_register_client.h b/net/quic/crypto/local_strike_register_client.h
index 5f576e99..8e10497 100644
--- a/net/quic/crypto/local_strike_register_client.h
+++ b/net/quic/crypto/local_strike_register_client.h
@@ -5,7 +5,9 @@
#ifndef NET_QUIC_CRYPTO_LOCAL_STRIKE_REGISTER_CLIENT_H_
#define NET_QUIC_CRYPTO_LOCAL_STRIKE_REGISTER_CLIENT_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "base/synchronization/lock.h"
#include "net/base/net_export.h"
@@ -21,9 +23,9 @@
: public StrikeRegisterClient {
public:
LocalStrikeRegisterClient(unsigned max_entries,
- uint32 current_time_external,
- uint32 window_secs,
- const uint8 orbit[8],
+ uint32_t current_time_external,
+ uint32_t window_secs,
+ const uint8_t orbit[8],
StrikeRegister::StartupType startup);
bool IsKnownOrbit(base::StringPiece orbit) const override;
diff --git a/net/quic/crypto/local_strike_register_client_test.cc b/net/quic/crypto/local_strike_register_client_test.cc
index 5d8fc5a..74bf095f 100644
--- a/net/quic/crypto/local_strike_register_client_test.cc
+++ b/net/quic/crypto/local_strike_register_client_test.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "base/sys_byteorder.h"
@@ -50,10 +51,10 @@
DISALLOW_COPY_AND_ASSIGN(RecordResultCallback);
};
-const uint8 kOrbit[] = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0";
-const uint32 kCurrentTimeExternalSecs = 12345678;
+const uint8_t kOrbit[] = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0";
+const uint32_t kCurrentTimeExternalSecs = 12345678;
size_t kMaxEntries = 100;
-uint32 kWindowSecs = 60;
+uint32_t kWindowSecs = 60;
class LocalStrikeRegisterClientTest : public ::testing::Test {
protected:
@@ -81,7 +82,7 @@
TEST_F(LocalStrikeRegisterClientTest, IncorrectNonceLength) {
string valid_nonce;
- uint32 norder = htonl(kCurrentTimeExternalSecs);
+ uint32_t norder = htonl(kCurrentTimeExternalSecs);
valid_nonce.assign(reinterpret_cast<const char*>(&norder), sizeof(norder));
valid_nonce.append(string(reinterpret_cast<const char*>(kOrbit), kOrbitSize));
valid_nonce.append(string(20, '\x17')); // 20 'random' bytes.
diff --git a/net/quic/crypto/null_decrypter.cc b/net/quic/crypto/null_decrypter.cc
index e04fc30..67709c3 100644
--- a/net/quic/crypto/null_decrypter.cc
+++ b/net/quic/crypto/null_decrypter.cc
@@ -63,13 +63,13 @@
return "NULL";
}
-uint32 NullDecrypter::cipher_id() const {
+uint32_t NullDecrypter::cipher_id() const {
return 0;
}
bool NullDecrypter::ReadHash(QuicDataReader* reader, uint128* hash) {
- uint64 lo;
- uint32 hi;
+ uint64_t lo;
+ uint32_t hi;
if (!reader->ReadUInt64(&lo) || !reader->ReadUInt32(&hi)) {
return false;
}
diff --git a/net/quic/crypto/null_decrypter.h b/net/quic/crypto/null_decrypter.h
index ac501e6..64a6a19 100644
--- a/net/quic/crypto/null_decrypter.h
+++ b/net/quic/crypto/null_decrypter.h
@@ -5,7 +5,11 @@
#ifndef NET_QUIC_CRYPTO_NULL_DECRYPTER_H_
#define NET_QUIC_CRYPTO_NULL_DECRYPTER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/crypto/quic_decrypter.h"
@@ -34,7 +38,7 @@
base::StringPiece GetNoncePrefix() const override;
const char* cipher_name() const override;
- uint32 cipher_id() const override;
+ uint32_t cipher_id() const override;
private:
bool ReadHash(QuicDataReader* reader, uint128* hash);
diff --git a/net/quic/crypto/null_encrypter.h b/net/quic/crypto/null_encrypter.h
index f9a54a0..c07495e 100644
--- a/net/quic/crypto/null_encrypter.h
+++ b/net/quic/crypto/null_encrypter.h
@@ -5,7 +5,10 @@
#ifndef NET_QUIC_CRYPTO_NULL_ENCRYPTER_H_
#define NET_QUIC_CRYPTO_NULL_ENCRYPTER_H_
+#include <stddef.h>
+
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/crypto/quic_encrypter.h"
diff --git a/net/quic/crypto/p256_key_exchange.h b/net/quic/crypto/p256_key_exchange.h
index 9e22a33..e6855aa 100644
--- a/net/quic/crypto/p256_key_exchange.h
+++ b/net/quic/crypto/p256_key_exchange.h
@@ -5,8 +5,11 @@
#ifndef NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_
#define NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_
+#include <stdint.h>
+
#include <string>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -59,18 +62,18 @@
#if defined(USE_OPENSSL)
// P256KeyExchange takes ownership of |private_key|, and expects
// |public_key| consists of |kUncompressedP256PointBytes| bytes.
- P256KeyExchange(EC_KEY* private_key, const uint8* public_key);
+ P256KeyExchange(EC_KEY* private_key, const uint8_t* public_key);
crypto::ScopedEC_KEY private_key_;
#else
// P256KeyExchange takes ownership of |key_pair|, and expects
// |public_key| consists of |kUncompressedP256PointBytes| bytes.
- P256KeyExchange(crypto::ECPrivateKey* key_pair, const uint8* public_key);
+ P256KeyExchange(crypto::ECPrivateKey* key_pair, const uint8_t* public_key);
scoped_ptr<crypto::ECPrivateKey> key_pair_;
#endif
// The public key stored as an uncompressed P-256 point.
- uint8 public_key_[kUncompressedP256PointBytes];
+ uint8_t public_key_[kUncompressedP256PointBytes];
DISALLOW_COPY_AND_ASSIGN(P256KeyExchange);
};
diff --git a/net/quic/crypto/p256_key_exchange_nss.cc b/net/quic/crypto/p256_key_exchange_nss.cc
index 2568e54..576825f9 100644
--- a/net/quic/crypto/p256_key_exchange_nss.cc
+++ b/net/quic/crypto/p256_key_exchange_nss.cc
@@ -22,15 +22,15 @@
// use the same approach.
const char kExportPassword[] = "";
-// Convert StringPiece to vector of uint8.
-static vector<uint8> StringPieceToVector(StringPiece piece) {
- return vector<uint8>(piece.data(), piece.data() + piece.length());
+// Convert StringPiece to vector of uint8_t.
+static vector<uint8_t> StringPieceToVector(StringPiece piece) {
+ return vector<uint8_t>(piece.data(), piece.data() + piece.length());
}
} // namespace
P256KeyExchange::P256KeyExchange(crypto::ECPrivateKey* key_pair,
- const uint8* public_key)
+ const uint8_t* public_key)
: key_pair_(key_pair) {
memcpy(public_key_, public_key, sizeof(public_key_));
}
@@ -44,7 +44,7 @@
return nullptr;
}
- const uint8* data = reinterpret_cast<const uint8*>(key.data());
+ const uint8_t* data = reinterpret_cast<const uint8_t*>(key.data());
size_t size =
static_cast<size_t>(data[0]) | (static_cast<size_t>(data[1]) << 8);
key.remove_prefix(2);
@@ -113,7 +113,7 @@
return string();
}
- vector<uint8> private_key;
+ vector<uint8_t> private_key;
if (!key_pair->ExportEncryptedPrivateKey(kExportPassword, 1 /* iteration */,
&private_key)) {
DVLOG(1) << "Can't export private key.";
@@ -123,14 +123,14 @@
// NSS lacks the ability to import an ECC private key without
// also importing the public key, so it is necessary to also
// store the public key.
- vector<uint8> public_key;
+ vector<uint8_t> public_key;
if (!key_pair->ExportPublicKey(&public_key)) {
DVLOG(1) << "Can't export public key.";
return string();
}
// TODO(thaidn): determine how large encrypted private key can be
- uint16 private_key_size = base::checked_cast<uint16>(private_key.size());
+ uint16_t private_key_size = base::checked_cast<uint16_t>(private_key.size());
const size_t result_size =
sizeof(private_key_size) + private_key_size + public_key.size();
vector<char> result(result_size);
@@ -176,7 +176,7 @@
peer_public_key.u.ec.publicValue.type = siBuffer;
peer_public_key.u.ec.publicValue.data =
- reinterpret_cast<uint8*>(const_cast<char*>(peer_public_value.data()));
+ reinterpret_cast<uint8_t*>(const_cast<char*>(peer_public_value.data()));
peer_public_key.u.ec.publicValue.len = peer_public_value.size();
// The NSS function performing ECDH key exchange is PK11_PubDeriveWithKDF.
diff --git a/net/quic/crypto/p256_key_exchange_openssl.cc b/net/quic/crypto/p256_key_exchange_openssl.cc
index f5ca063..7a9707e 100644
--- a/net/quic/crypto/p256_key_exchange_openssl.cc
+++ b/net/quic/crypto/p256_key_exchange_openssl.cc
@@ -15,7 +15,7 @@
namespace net {
-P256KeyExchange::P256KeyExchange(EC_KEY* private_key, const uint8* public_key)
+P256KeyExchange::P256KeyExchange(EC_KEY* private_key, const uint8_t* public_key)
: private_key_(private_key) {
memcpy(public_key_, public_key, sizeof(public_key_));
}
@@ -29,7 +29,7 @@
return nullptr;
}
- const uint8* keyp = reinterpret_cast<const uint8*>(key.data());
+ const uint8_t* keyp = reinterpret_cast<const uint8_t*>(key.data());
crypto::ScopedEC_KEY private_key(
d2i_ECPrivateKey(nullptr, &keyp, key.size()));
if (!private_key.get() || !EC_KEY_check_key(private_key.get())) {
@@ -37,7 +37,7 @@
return nullptr;
}
- uint8 public_key[kUncompressedP256PointBytes];
+ uint8_t public_key[kUncompressedP256PointBytes];
if (EC_POINT_point2oct(EC_KEY_get0_group(private_key.get()),
EC_KEY_get0_public_key(private_key.get()),
POINT_CONVERSION_UNCOMPRESSED, public_key,
@@ -62,8 +62,8 @@
DVLOG(1) << "Can't convert private key to string";
return string();
}
- scoped_ptr<uint8[]> private_key(new uint8[key_len]);
- uint8* keyp = private_key.get();
+ scoped_ptr<uint8_t[]> private_key(new uint8_t[key_len]);
+ uint8_t* keyp = private_key.get();
if (!i2d_ECPrivateKey(key.get(), &keyp)) {
DVLOG(1) << "Can't convert private key to string.";
return string();
@@ -89,14 +89,14 @@
if (!point ||
!EC_POINT_oct2point(/* also test if point is on curve */
EC_KEY_get0_group(private_key_.get()), point.get(),
- reinterpret_cast<const uint8*>(
+ reinterpret_cast<const uint8_t*>(
peer_public_value.data()),
peer_public_value.size(), nullptr)) {
DVLOG(1) << "Can't convert peer public value to curve point.";
return false;
}
- uint8 result[kP256FieldBytes];
+ uint8_t result[kP256FieldBytes];
if (ECDH_compute_key(result, sizeof(result), point.get(), private_key_.get(),
nullptr) != sizeof(result)) {
DVLOG(1) << "Can't compute ECDH shared key.";
diff --git a/net/quic/crypto/proof_source_chromium.h b/net/quic/crypto/proof_source_chromium.h
index fae666a..cfed05f4 100644
--- a/net/quic/crypto/proof_source_chromium.h
+++ b/net/quic/crypto/proof_source_chromium.h
@@ -8,9 +8,9 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
+#include "base/macros.h"
#include "crypto/rsa_private_key.h"
#include "net/base/net_export.h"
#include "net/cert/x509_certificate.h"
diff --git a/net/quic/crypto/proof_source_chromium_openssl.cc b/net/quic/crypto/proof_source_chromium_openssl.cc
index 1e18d7a..ec0bdea9d 100644
--- a/net/quic/crypto/proof_source_chromium_openssl.cc
+++ b/net/quic/crypto/proof_source_chromium_openssl.cc
@@ -93,12 +93,14 @@
private_key_->key()) ||
!EVP_PKEY_CTX_set_rsa_padding(pkey_ctx, RSA_PKCS1_PSS_PADDING) ||
!EVP_PKEY_CTX_set_rsa_pss_saltlen(pkey_ctx, -1) ||
- !EVP_DigestSignUpdate(sign_context.get(), reinterpret_cast<const uint8*>(
- kProofSignatureLabel),
- sizeof(kProofSignatureLabel)) ||
- !EVP_DigestSignUpdate(sign_context.get(), reinterpret_cast<const uint8*>(
- server_config.data()),
- server_config.size())) {
+ !EVP_DigestSignUpdate(
+ sign_context.get(),
+ reinterpret_cast<const uint8_t*>(kProofSignatureLabel),
+ sizeof(kProofSignatureLabel)) ||
+ !EVP_DigestSignUpdate(
+ sign_context.get(),
+ reinterpret_cast<const uint8_t*>(server_config.data()),
+ server_config.size())) {
return false;
}
diff --git a/net/quic/crypto/proof_verifier_chromium.cc b/net/quic/crypto/proof_verifier_chromium.cc
index e247b597..03951d9 100644
--- a/net/quic/crypto/proof_verifier_chromium.cc
+++ b/net/quic/crypto/proof_verifier_chromium.cc
@@ -9,6 +9,7 @@
#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
@@ -326,8 +327,8 @@
bool ok = verifier.VerifyInitRSAPSS(
hash_alg, mask_hash_alg, hash_len,
- reinterpret_cast<const uint8*>(signature.data()), signature.size(),
- reinterpret_cast<const uint8*>(spki.data()), spki.size());
+ reinterpret_cast<const uint8_t*>(signature.data()), signature.size(),
+ reinterpret_cast<const uint8_t*>(spki.data()), spki.size());
if (!ok) {
DLOG(WARNING) << "VerifyInitRSAPSS failed";
return false;
@@ -345,14 +346,15 @@
// component, the OID ecdsa-with-SHA224, ecdsa-with-SHA256, ecdsa-with-
// SHA384, or ecdsa-with-SHA512.
// See also RFC 5480, Appendix A.
- static const uint8 kECDSAWithSHA256AlgorithmID[] = {
+ static const uint8_t kECDSAWithSHA256AlgorithmID[] = {
0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02,
};
if (!verifier.VerifyInit(
kECDSAWithSHA256AlgorithmID, sizeof(kECDSAWithSHA256AlgorithmID),
- reinterpret_cast<const uint8*>(signature.data()), signature.size(),
- reinterpret_cast<const uint8*>(spki.data()), spki.size())) {
+ reinterpret_cast<const uint8_t*>(signature.data()),
+ signature.size(), reinterpret_cast<const uint8_t*>(spki.data()),
+ spki.size())) {
DLOG(WARNING) << "VerifyInit failed";
return false;
}
@@ -361,9 +363,9 @@
return false;
}
- verifier.VerifyUpdate(reinterpret_cast<const uint8*>(kProofSignatureLabel),
+ verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(kProofSignatureLabel),
sizeof(kProofSignatureLabel));
- verifier.VerifyUpdate(reinterpret_cast<const uint8*>(signed_data.data()),
+ verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(signed_data.data()),
signed_data.size());
if (!verifier.VerifyFinal()) {
diff --git a/net/quic/crypto/proof_verifier_chromium.h b/net/quic/crypto/proof_verifier_chromium.h
index 508cfb05..7b642e7 100644
--- a/net/quic/crypto/proof_verifier_chromium.h
+++ b/net/quic/crypto/proof_verifier_chromium.h
@@ -9,8 +9,8 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/cert/cert_verify_result.h"
diff --git a/net/quic/crypto/properties_based_quic_server_info.h b/net/quic/crypto/properties_based_quic_server_info.h
index a47d515d..c7189ab4 100644
--- a/net/quic/crypto/properties_based_quic_server_info.h
+++ b/net/quic/crypto/properties_based_quic_server_info.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
diff --git a/net/quic/crypto/quic_crypto_client_config.cc b/net/quic/crypto/quic_crypto_client_config.cc
index f79e05a1..fbc52ea 100644
--- a/net/quic/crypto/quic_crypto_client_config.cc
+++ b/net/quic/crypto/quic_crypto_client_config.cc
@@ -83,7 +83,7 @@
return false;
}
- uint64 expiry_seconds;
+ uint64_t expiry_seconds;
if (scfg->GetUint64(kEXPY, &expiry_seconds) != QUIC_NO_ERROR) {
RecordInchoateClientHelloReason(SERVER_CONFIG_INVALID_EXPIRY);
return false;
@@ -159,7 +159,7 @@
return SERVER_CONFIG_INVALID;
}
- uint64 expiry_seconds;
+ uint64_t expiry_seconds;
if (new_scfg->GetUint64(kEXPY, &expiry_seconds) != QUIC_NO_ERROR) {
*error_details = "SCFG missing EXPY";
return SERVER_CONFIG_INVALID_EXPIRY;
@@ -296,7 +296,7 @@
return server_config_valid_;
}
-uint64 QuicCryptoClientConfig::CachedState::generation_counter() const {
+uint64_t QuicCryptoClientConfig::CachedState::generation_counter() const {
return generation_counter_;
}
@@ -451,7 +451,7 @@
// process the server's compressed certificate chain.
out_params->cached_certs = certs;
if (!certs.empty()) {
- vector<uint64> hashes;
+ vector<uint64_t> hashes;
hashes.reserve(certs.size());
for (vector<string>::const_iterator i = certs.begin(); i != certs.end();
++i) {
diff --git a/net/quic/crypto/quic_crypto_client_config.h b/net/quic/crypto/quic_crypto_client_config.h
index 6a2085f..ef65d20 100644
--- a/net/quic/crypto/quic_crypto_client_config.h
+++ b/net/quic/crypto/quic_crypto_client_config.h
@@ -5,11 +5,14 @@
#ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_
#define NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_
+#include <stdint.h>
+
#include <map>
#include <queue>
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -107,7 +110,7 @@
const std::string& cert_sct() const;
const std::string& signature() const;
bool proof_valid() const;
- uint64 generation_counter() const;
+ uint64_t generation_counter() const;
const ProofVerifyDetails* proof_verify_details() const;
void set_source_address_token(base::StringPiece token);
@@ -171,7 +174,7 @@
// Generation counter associated with the |server_config_|, |certs_| and
// |server_config_sig_| combination. It is incremented whenever we set
// server_config_valid_ to false.
- uint64 generation_counter_;
+ uint64_t generation_counter_;
scoped_ptr<ProofVerifyDetails> proof_verify_details_;
diff --git a/net/quic/crypto/quic_crypto_client_config_test.cc b/net/quic/crypto/quic_crypto_client_config_test.cc
index b11f504..2e6866cc 100644
--- a/net/quic/crypto/quic_crypto_client_config_test.cc
+++ b/net/quic/crypto/quic_crypto_client_config_test.cc
@@ -192,7 +192,7 @@
QuicCryptoClientConfig::CachedState state;
CryptoHandshakeMessage scfg;
scfg.set_tag(kSCFG);
- uint64 future = 1;
+ uint64_t future = 1;
scfg.SetValue(kEXPY, future);
scfg.SetStringPiece(kSCID, "12345678");
string details;
diff --git a/net/quic/crypto/quic_crypto_server_config.cc b/net/quic/crypto/quic_crypto_server_config.cc
index dfdf486..bcab8fc 100644
--- a/net/quic/crypto/quic_crypto_server_config.cc
+++ b/net/quic/crypto/quic_crypto_server_config.cc
@@ -5,8 +5,10 @@
#include "net/quic/crypto/quic_crypto_server_config.h"
#include <stdlib.h>
+
#include <algorithm>
+#include "base/macros.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "crypto/hkdf.h"
@@ -228,7 +230,7 @@
server_nonce_entropy->RandBytes(server_nonce_orbit_,
sizeof(server_nonce_orbit_));
const size_t key_size = server_nonce_boxer_.GetKeySize();
- scoped_ptr<uint8[]> key_bytes(new uint8[key_size]);
+ scoped_ptr<uint8_t[]> key_bytes(new uint8_t[key_size]);
server_nonce_entropy->RandBytes(key_bytes.get(), key_size);
server_nonce_boxer_.SetKey(
@@ -294,7 +296,7 @@
const QuicWallTime now = clock->WallNow();
const QuicWallTime expiry = now.Add(QuicTime::Delta::FromSeconds(
60 * 60 * 24 * 180 /* 180 days, ~six months */));
- const uint64 expiry_seconds = expiry.ToUNIXSeconds();
+ const uint64_t expiry_seconds = expiry.ToUNIXSeconds();
msg.SetValue(kEXPY, expiry_seconds);
} else {
msg.SetValue(kEXPY, options.expiry_time.ToUNIXSeconds());
@@ -492,7 +494,7 @@
StringPiece requested_scid;
client_hello.GetStringPiece(kSCID, &requested_scid);
- uint8 primary_orbit[kOrbitSize];
+ uint8_t primary_orbit[kOrbitSize];
scoped_refptr<Config> requested_config;
scoped_refptr<Config> primary_config;
{
@@ -962,7 +964,7 @@
void QuicCryptoServerConfig::EvaluateClientHello(
const IPAddressNumber& server_ip,
QuicVersion version,
- const uint8* primary_orbit,
+ const uint8_t* primary_orbit,
scoped_refptr<Config> requested_config,
scoped_refptr<Config> primary_config,
QuicCryptoProof* crypto_proof,
@@ -1142,7 +1144,7 @@
if (strike_register_client_.get() == nullptr) {
strike_register_client_.reset(new LocalStrikeRegisterClient(
strike_register_max_entries_,
- static_cast<uint32>(info->now.ToUNIXSeconds()),
+ static_cast<uint32_t>(info->now.ToUNIXSeconds()),
strike_register_window_secs_, primary_orbit,
strike_register_no_startup_period_
? StrikeRegister::NO_STARTUP_PERIOD_NEEDED
@@ -1496,37 +1498,37 @@
}
void QuicCryptoServerConfig::set_strike_register_max_entries(
- uint32 max_entries) {
+ uint32_t max_entries) {
base::AutoLock locker(strike_register_client_lock_);
DCHECK(!strike_register_client_.get());
strike_register_max_entries_ = max_entries;
}
void QuicCryptoServerConfig::set_strike_register_window_secs(
- uint32 window_secs) {
+ uint32_t window_secs) {
base::AutoLock locker(strike_register_client_lock_);
DCHECK(!strike_register_client_.get());
strike_register_window_secs_ = window_secs;
}
void QuicCryptoServerConfig::set_source_address_token_future_secs(
- uint32 future_secs) {
+ uint32_t future_secs) {
source_address_token_future_secs_ = future_secs;
}
void QuicCryptoServerConfig::set_source_address_token_lifetime_secs(
- uint32 lifetime_secs) {
+ uint32_t lifetime_secs) {
source_address_token_lifetime_secs_ = lifetime_secs;
}
void QuicCryptoServerConfig::set_server_nonce_strike_register_max_entries(
- uint32 max_entries) {
+ uint32_t max_entries) {
DCHECK(!server_nonce_strike_register_.get());
server_nonce_strike_register_max_entries_ = max_entries;
}
void QuicCryptoServerConfig::set_server_nonce_strike_register_window_secs(
- uint32 window_secs) {
+ uint32_t window_secs) {
DCHECK(!server_nonce_strike_register_.get());
server_nonce_strike_register_window_secs_ = window_secs;
}
@@ -1669,14 +1671,14 @@
string QuicCryptoServerConfig::NewServerNonce(QuicRandom* rand,
QuicWallTime now) const {
- const uint32 timestamp = static_cast<uint32>(now.ToUNIXSeconds());
+ const uint32_t timestamp = static_cast<uint32_t>(now.ToUNIXSeconds());
- uint8 server_nonce[kServerNoncePlaintextSize];
+ uint8_t server_nonce[kServerNoncePlaintextSize];
static_assert(sizeof(server_nonce) > sizeof(timestamp), "nonce too small");
- server_nonce[0] = static_cast<uint8>(timestamp >> 24);
- server_nonce[1] = static_cast<uint8>(timestamp >> 16);
- server_nonce[2] = static_cast<uint8>(timestamp >> 8);
- server_nonce[3] = static_cast<uint8>(timestamp);
+ server_nonce[0] = static_cast<uint8_t>(timestamp >> 24);
+ server_nonce[1] = static_cast<uint8_t>(timestamp >> 16);
+ server_nonce[2] = static_cast<uint8_t>(timestamp >> 8);
+ server_nonce[3] = static_cast<uint8_t>(timestamp);
rand->RandBytes(&server_nonce[sizeof(timestamp)],
sizeof(server_nonce) - sizeof(timestamp));
@@ -1695,8 +1697,8 @@
}
// plaintext contains:
- // uint32 timestamp
- // uint8[20] random bytes
+ // uint32_t timestamp
+ // uint8_t[20] random bytes
if (plaintext.size() != kServerNoncePlaintextSize) {
// This should never happen because the value decrypted correctly.
@@ -1704,7 +1706,7 @@
return SERVER_NONCE_INVALID_FAILURE;
}
- uint8 server_nonce[32];
+ uint8_t server_nonce[32];
memcpy(server_nonce, plaintext.data(), 4);
memcpy(server_nonce + 4, server_nonce_orbit_, sizeof(server_nonce_orbit_));
memcpy(server_nonce + 4 + sizeof(server_nonce_orbit_), plaintext.data() + 4,
@@ -1718,12 +1720,12 @@
if (server_nonce_strike_register_.get() == nullptr) {
server_nonce_strike_register_.reset(new StrikeRegister(
server_nonce_strike_register_max_entries_,
- static_cast<uint32>(now.ToUNIXSeconds()),
+ static_cast<uint32_t>(now.ToUNIXSeconds()),
server_nonce_strike_register_window_secs_, server_nonce_orbit_,
StrikeRegister::NO_STARTUP_PERIOD_NEEDED));
}
nonce_error = server_nonce_strike_register_->Insert(
- server_nonce, static_cast<uint32>(now.ToUNIXSeconds()));
+ server_nonce, static_cast<uint32_t>(now.ToUNIXSeconds()));
}
switch (nonce_error) {
@@ -1752,7 +1754,7 @@
return false;
}
- uint64 hash_from_client;
+ uint64_t hash_from_client;
if (client_hello.GetUint64(kXLCT, &hash_from_client) != QUIC_NO_ERROR) {
return false;
}
diff --git a/net/quic/crypto/quic_crypto_server_config.h b/net/quic/crypto/quic_crypto_server_config.h
index 68aa3b53..0aba62e2 100644
--- a/net/quic/crypto/quic_crypto_server_config.h
+++ b/net/quic/crypto/quic_crypto_server_config.h
@@ -5,10 +5,14 @@
#ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_
#define NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
@@ -57,8 +61,8 @@
SourceAddressTokens source_address_tokens;
// Errors from EvaluateClientHello.
- std::vector<uint32> reject_reasons;
- static_assert(sizeof(QuicTag) == sizeof(uint32), "header out of sync");
+ std::vector<uint32_t> reject_reasons;
+ static_assert(sizeof(QuicTag) == sizeof(uint32_t), "header out of sync");
};
namespace test {
@@ -312,23 +316,23 @@
// set_strike_register_max_entries sets the maximum number of entries that
// the internal strike register will hold. If the strike register fills up
// then the oldest entries (by the client's clock) will be dropped.
- void set_strike_register_max_entries(uint32 max_entries);
+ void set_strike_register_max_entries(uint32_t max_entries);
// set_strike_register_window_secs sets the number of seconds around the
// current time that the strike register will attempt to be authoritative
// for. Setting a larger value allows for greater client clock-skew, but
// means that the quiescent startup period must be longer.
- void set_strike_register_window_secs(uint32 window_secs);
+ void set_strike_register_window_secs(uint32_t window_secs);
// set_source_address_token_future_secs sets the number of seconds into the
// future that source-address tokens will be accepted from. Since
// source-address tokens are authenticated, this should only happen if
// another, valid server has clock-skew.
- void set_source_address_token_future_secs(uint32 future_secs);
+ void set_source_address_token_future_secs(uint32_t future_secs);
// set_source_address_token_lifetime_secs sets the number of seconds that a
// source-address token will be valid for.
- void set_source_address_token_lifetime_secs(uint32 lifetime_secs);
+ void set_source_address_token_lifetime_secs(uint32_t lifetime_secs);
// set_server_nonce_strike_register_max_entries sets the number of entries in
// the server-nonce strike-register. This is used to record that server nonce
@@ -336,14 +340,14 @@
// which are depending on server nonces may fail to handshake because their
// nonce has expired in the amount of time it took to go from the server to
// the client and back.
- void set_server_nonce_strike_register_max_entries(uint32 max_entries);
+ void set_server_nonce_strike_register_max_entries(uint32_t max_entries);
// set_server_nonce_strike_register_window_secs sets the number of seconds
// around the current time that the server-nonce strike-register will accept
// nonces from. Setting a larger value allows for clients to delay follow-up
// client hellos for longer and still use server nonces as proofs of
// uniqueness.
- void set_server_nonce_strike_register_window_secs(uint32 window_secs);
+ void set_server_nonce_strike_register_window_secs(uint32_t window_secs);
// set_enable_serving_sct enables or disables serving signed cert timestamp
// (RFC6962) in server hello.
@@ -400,7 +404,7 @@
// Secondary sort key for use when selecting primary configs and
// there are multiple configs with the same primary time.
// Smaller numbers mean higher priority.
- uint64 priority;
+ uint64_t priority;
// source_address_token_boxer_ is used to protect the
// source-address tokens that are given to clients.
@@ -442,7 +446,7 @@
void EvaluateClientHello(
const IPAddressNumber& server_ip,
QuicVersion version,
- const uint8* primary_orbit,
+ const uint8_t* primary_orbit,
scoped_refptr<Config> requested_config,
scoped_refptr<Config> primary_config,
QuicCryptoProof* crypto_proof,
@@ -585,7 +589,7 @@
// server_nonce_orbit_ contains the random, per-server orbit values that this
// server will use to generate server nonces (the moral equivalent of a SYN
// cookies).
- uint8 server_nonce_orbit_[8];
+ uint8_t server_nonce_orbit_[8];
mutable base::Lock server_nonce_strike_register_lock_;
// server_nonce_strike_register_ contains a data structure that keeps track of
@@ -604,12 +608,12 @@
// These fields store configuration values. See the comments for their
// respective setter functions.
bool strike_register_no_startup_period_;
- uint32 strike_register_max_entries_;
- uint32 strike_register_window_secs_;
- uint32 source_address_token_future_secs_;
- uint32 source_address_token_lifetime_secs_;
- uint32 server_nonce_strike_register_max_entries_;
- uint32 server_nonce_strike_register_window_secs_;
+ uint32_t strike_register_max_entries_;
+ uint32_t strike_register_window_secs_;
+ uint32_t source_address_token_future_secs_;
+ uint32_t source_address_token_lifetime_secs_;
+ uint32_t server_nonce_strike_register_max_entries_;
+ uint32_t server_nonce_strike_register_window_secs_;
// Enable serving SCT or not.
bool enable_serving_sct_;
diff --git a/net/quic/crypto/quic_crypto_server_config_test.cc b/net/quic/crypto/quic_crypto_server_config_test.cc
index f02a132..cbb07e6 100644
--- a/net/quic/crypto/quic_crypto_server_config_test.cc
+++ b/net/quic/crypto/quic_crypto_server_config_test.cc
@@ -430,7 +430,7 @@
StringPiece message("hello world");
const size_t key_size = CryptoSecretBoxer::GetKeySize();
- scoped_ptr<uint8[]> key(new uint8[key_size]);
+ scoped_ptr<uint8_t[]> key(new uint8_t[key_size]);
memset(key.get(), 0x11, key_size);
CryptoSecretBoxer boxer;
diff --git a/net/quic/crypto/quic_decrypter.h b/net/quic/crypto/quic_decrypter.h
index 21ff8b3..4363e709 100644
--- a/net/quic/crypto/quic_decrypter.h
+++ b/net/quic/crypto/quic_decrypter.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_CRYPTO_QUIC_DECRYPTER_H_
#define NET_QUIC_CRYPTO_QUIC_DECRYPTER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include "net/base/net_export.h"
#include "net/quic/quic_protocol.h"
@@ -58,7 +61,7 @@
virtual const char* cipher_name() const = 0;
// The ID of the cipher. Return 0x03000000 ORed with the 'cryptographic suite
// selector'.
- virtual uint32 cipher_id() const = 0;
+ virtual uint32_t cipher_id() const = 0;
// For use by unit tests only.
virtual base::StringPiece GetKey() const = 0;
diff --git a/net/quic/crypto/quic_encrypter.h b/net/quic/crypto/quic_encrypter.h
index bc127782..7270174 100644
--- a/net/quic/crypto/quic_encrypter.h
+++ b/net/quic/crypto/quic_encrypter.h
@@ -5,6 +5,8 @@
#ifndef NET_QUIC_CRYPTO_QUIC_ENCRYPTER_H_
#define NET_QUIC_CRYPTO_QUIC_ENCRYPTER_H_
+#include <stddef.h>
+
#include "net/base/net_export.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/crypto/quic_random.cc b/net/quic/crypto/quic_random.cc
index 5670e34..ad130a08 100644
--- a/net/quic/crypto/quic_random.cc
+++ b/net/quic/crypto/quic_random.cc
@@ -5,6 +5,7 @@
#include "net/quic/crypto/quic_random.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/singleton.h"
#include "crypto/random.h"
@@ -18,7 +19,7 @@
// QuicRandom implementation
void RandBytes(void* data, size_t len) override;
- uint64 RandUint64() override;
+ uint64_t RandUint64() override;
void Reseed(const void* additional_entropy, size_t entropy_len) override;
private:
@@ -37,8 +38,8 @@
crypto::RandBytes(data, len);
}
-uint64 DefaultRandom::RandUint64() {
- uint64 value;
+uint64_t DefaultRandom::RandUint64() {
+ uint64_t value;
RandBytes(&value, sizeof(value));
return value;
}
diff --git a/net/quic/crypto/quic_random.h b/net/quic/crypto/quic_random.h
index ac69b85..e723241b 100644
--- a/net/quic/crypto/quic_random.h
+++ b/net/quic/crypto/quic_random.h
@@ -6,8 +6,8 @@
#define NET_QUIC_CRYPTO_QUIC_RANDOM_H_
#include <stddef.h>
+#include <stdint.h>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
namespace net {
@@ -25,7 +25,7 @@
virtual void RandBytes(void* data, size_t len) = 0;
// Returns a random number in the range [0, kuint64max].
- virtual uint64 RandUint64() = 0;
+ virtual uint64_t RandUint64() = 0;
// Reseeds the random number generator with additional entropy input.
// NOTE: the constructor of a QuicRandom object is responsible for seeding
diff --git a/net/quic/crypto/quic_random_test.cc b/net/quic/crypto/quic_random_test.cc
index a762625..431a221 100644
--- a/net/quic/crypto/quic_random_test.cc
+++ b/net/quic/crypto/quic_random_test.cc
@@ -23,8 +23,8 @@
TEST(QuicRandomTest, RandUint64) {
QuicRandom* rng = QuicRandom::GetInstance();
- uint64 value1 = rng->RandUint64();
- uint64 value2 = rng->RandUint64();
+ uint64_t value1 = rng->RandUint64();
+ uint64_t value2 = rng->RandUint64();
EXPECT_NE(value1, value2);
}
diff --git a/net/quic/crypto/quic_server_info.cc b/net/quic/crypto/quic_server_info.cc
index 6c6fff9..2627fb48 100644
--- a/net/quic/crypto/quic_server_info.cc
+++ b/net/quic/crypto/quic_server_info.cc
@@ -89,13 +89,13 @@
}
// Read certs.
- uint32 num_certs;
+ uint32_t num_certs;
if (!iter.ReadUInt32(&num_certs)) {
DVLOG(1) << "Malformed num_certs";
return false;
}
- for (uint32 i = 0; i < num_certs; i++) {
+ for (uint32_t i = 0; i < num_certs; i++) {
string cert;
if (!iter.ReadString(&cert)) {
DVLOG(1) << "Malformed cert";
@@ -120,7 +120,7 @@
!p.WriteString(state_.server_config) ||
!p.WriteString(state_.source_address_token) ||
!p.WriteString(state_.server_config_sig) ||
- state_.certs.size() > std::numeric_limits<uint32>::max() ||
+ state_.certs.size() > std::numeric_limits<uint32_t>::max() ||
!p.WriteUInt32(state_.certs.size())) {
return string();
}
diff --git a/net/quic/crypto/quic_server_info.h b/net/quic/crypto/quic_server_info.h
index 8b9acde..be152408 100644
--- a/net/quic/crypto/quic_server_info.h
+++ b/net/quic/crypto/quic_server_info.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
diff --git a/net/quic/crypto/scoped_evp_aead_ctx.h b/net/quic/crypto/scoped_evp_aead_ctx.h
index f0f04c1..d8067fc 100644
--- a/net/quic/crypto/scoped_evp_aead_ctx.h
+++ b/net/quic/crypto/scoped_evp_aead_ctx.h
@@ -7,7 +7,7 @@
#include <openssl/evp.h>
-#include "base/basictypes.h"
+#include "base/macros.h"
namespace net {
diff --git a/net/quic/crypto/strike_register.cc b/net/quic/crypto/strike_register.cc
index 2b995a48..9cea0f11 100644
--- a/net/quic/crypto/strike_register.cc
+++ b/net/quic/crypto/strike_register.cc
@@ -17,9 +17,9 @@
namespace {
-uint32 GetInitialHorizon(uint32 current_time_internal,
- uint32 window_secs,
- StrikeRegister::StartupType startup) {
+uint32_t GetInitialHorizon(uint32_t current_time_internal,
+ uint32_t window_secs,
+ StrikeRegister::StartupType startup) {
if (startup == StrikeRegister::DENY_REQUESTS_AT_STARTUP) {
// The horizon is initially set |window_secs| into the future because, if
// we just crashed, then we may have accepted nonces in the span
@@ -36,50 +36,50 @@
} // namespace
// static
-const uint32 StrikeRegister::kExternalNodeSize = 24;
+const uint32_t StrikeRegister::kExternalNodeSize = 24;
// static
-const uint32 StrikeRegister::kNil = (1u << 31) | 1;
+const uint32_t StrikeRegister::kNil = (1u << 31) | 1;
// static
-const uint32 StrikeRegister::kExternalFlag = 1 << 23;
+const uint32_t StrikeRegister::kExternalFlag = 1 << 23;
// InternalNode represents a non-leaf node in the critbit tree. See the comment
// in the .h file for details.
class StrikeRegister::InternalNode {
public:
- void SetChild(unsigned direction, uint32 child) {
+ void SetChild(unsigned direction, uint32_t child) {
data_[direction] = (data_[direction] & 0xff) | (child << 8);
}
- void SetCritByte(uint8 critbyte) {
+ void SetCritByte(uint8_t critbyte) {
data_[0] = (data_[0] & 0xffffff00) | critbyte;
}
- void SetOtherBits(uint8 otherbits) {
+ void SetOtherBits(uint8_t otherbits) {
data_[1] = (data_[1] & 0xffffff00) | otherbits;
}
- void SetNextPtr(uint32 next) { data_[0] = next; }
+ void SetNextPtr(uint32_t next) { data_[0] = next; }
- uint32 next() const { return data_[0]; }
+ uint32_t next() const { return data_[0]; }
- uint32 child(unsigned n) const { return data_[n] >> 8; }
+ uint32_t child(unsigned n) const { return data_[n] >> 8; }
- uint8 critbyte() const { return static_cast<uint8>(data_[0]); }
+ uint8_t critbyte() const { return static_cast<uint8_t>(data_[0]); }
- uint8 otherbits() const { return static_cast<uint8>(data_[1]); }
+ uint8_t otherbits() const { return static_cast<uint8_t>(data_[1]); }
// These bytes are organised thus:
// <24 bits> left child
// <8 bits> crit-byte
// <24 bits> right child
// <8 bits> other-bits
- uint32 data_[2];
+ uint32_t data_[2];
};
// kCreationTimeFromInternalEpoch contains the number of seconds between the
// start of the internal epoch and the creation time. This allows us
// to consider times that are before the creation time.
-static const uint32 kCreationTimeFromInternalEpoch = 63115200; // 2 years.
+static const uint32_t kCreationTimeFromInternalEpoch = 63115200; // 2 years.
void StrikeRegister::ValidateStrikeRegisterConfig(unsigned max_entries) {
// We only have 23 bits of index available.
@@ -89,9 +89,9 @@
}
StrikeRegister::StrikeRegister(unsigned max_entries,
- uint32 current_time,
- uint32 window_secs,
- const uint8 orbit[8],
+ uint32_t current_time,
+ uint32_t window_secs,
+ const uint8_t orbit[8],
StartupType startup)
: max_entries_(max_entries),
window_secs_(window_secs),
@@ -105,7 +105,7 @@
ValidateStrikeRegisterConfig(max_entries);
internal_nodes_ = new InternalNode[max_entries];
- external_nodes_.reset(new uint8[kExternalNodeSize * max_entries]);
+ external_nodes_.reset(new uint8_t[kExternalNodeSize * max_entries]);
Reset();
}
@@ -133,31 +133,31 @@
internal_node_head_ = kNil;
}
-InsertStatus StrikeRegister::Insert(const uint8 nonce[32],
- uint32 current_time_external) {
+InsertStatus StrikeRegister::Insert(const uint8_t nonce[32],
+ uint32_t current_time_external) {
// Make space for the insertion if the strike register is full.
while (external_node_free_head_ == kNil || internal_node_free_head_ == kNil) {
DropOldestNode();
}
- const uint32 current_time = ExternalTimeToInternal(current_time_external);
+ const uint32_t current_time = ExternalTimeToInternal(current_time_external);
// Check to see if the orbit is correct.
if (memcmp(nonce + sizeof(current_time), orbit_, sizeof(orbit_))) {
return NONCE_INVALID_ORBIT_FAILURE;
}
- const uint32 nonce_time = ExternalTimeToInternal(TimeFromBytes(nonce));
+ const uint32_t nonce_time = ExternalTimeToInternal(TimeFromBytes(nonce));
// Check that the timestamp is in the valid range.
- pair<uint32, uint32> valid_range =
+ pair<uint32_t, uint32_t> valid_range =
StrikeRegister::GetValidRange(current_time);
if (nonce_time < valid_range.first || nonce_time > valid_range.second) {
return NONCE_INVALID_TIME_FAILURE;
}
// We strip the orbit out of the nonce.
- uint8 value[24];
+ uint8_t value[24];
memcpy(value, nonce, sizeof(nonce_time));
memcpy(value + sizeof(nonce_time),
nonce + sizeof(nonce_time) + sizeof(orbit_),
@@ -166,25 +166,25 @@
// Find the best match to |value| in the crit-bit tree. The best match is
// simply the value which /could/ match |value|, if any does, so we still
// need a memcmp to check.
- uint32 best_match_index = BestMatch(value);
+ uint32_t best_match_index = BestMatch(value);
if (best_match_index == kNil) {
// Empty tree. Just insert the new value at the root.
- uint32 index = GetFreeExternalNode();
+ uint32_t index = GetFreeExternalNode();
memcpy(external_node(index), value, sizeof(value));
internal_node_head_ = (index | kExternalFlag) << 8;
DCHECK_LE(horizon_, nonce_time);
return NONCE_OK;
}
- const uint8* best_match = external_node(best_match_index);
+ const uint8_t* best_match = external_node(best_match_index);
if (memcmp(best_match, value, sizeof(value)) == 0) {
// We found the value in the tree.
return NONCE_NOT_UNIQUE_FAILURE;
}
// We are going to insert a new entry into the tree, so get the nodes now.
- uint32 internal_node_index = GetFreeInternalNode();
- uint32 external_node_index = GetFreeExternalNode();
+ uint32_t internal_node_index = GetFreeInternalNode();
+ uint32_t external_node_index = GetFreeExternalNode();
// If we just evicted the best match, then we have to try and match again.
// We know that we didn't just empty the tree because we require that
@@ -196,8 +196,8 @@
}
// Now we need to find the first bit where we differ from |best_match|.
- uint8 differing_byte;
- uint8 new_other_bits;
+ uint8_t differing_byte;
+ uint8_t new_other_bits;
for (differing_byte = 0; differing_byte < arraysize(value);
differing_byte++) {
new_other_bits = value[differing_byte] ^ best_match[differing_byte];
@@ -235,13 +235,13 @@
inode->SetCritByte(differing_byte);
inode->SetOtherBits(new_other_bits);
- // |where_index| is a pointer to the uint32 which needs to be updated in
+ // |where_index| is a pointer to the uint32_t which needs to be updated in
// order to insert the new internal node into the tree. The internal nodes
// store the child indexes in the top 24-bits of a 32-bit word and, to keep
// the code simple, we define that |internal_node_head_| is organised the
// same way.
DCHECK_EQ(internal_node_head_ & 0xff, 0u);
- uint32* where_index = &internal_node_head_;
+ uint32_t* where_index = &internal_node_head_;
while (((*where_index >> 8) & kExternalFlag) == 0) {
InternalNode* node = &internal_nodes_[*where_index >> 8];
if (node->critbyte() > differing_byte) {
@@ -256,7 +256,7 @@
CHECK(false);
}
- uint8 c = value[node->critbyte()];
+ uint8_t c = value[node->critbyte()];
const int direction =
(1 + static_cast<unsigned>(node->otherbits() | c)) >> 8;
where_index = &node->data_[direction];
@@ -269,14 +269,14 @@
return NONCE_OK;
}
-const uint8* StrikeRegister::orbit() const {
+const uint8_t* StrikeRegister::orbit() const {
return orbit_;
}
-uint32 StrikeRegister::GetCurrentValidWindowSecs(
- uint32 current_time_external) const {
- uint32 current_time = ExternalTimeToInternal(current_time_external);
- pair<uint32, uint32> valid_range =
+uint32_t StrikeRegister::GetCurrentValidWindowSecs(
+ uint32_t current_time_external) const {
+ uint32_t current_time = ExternalTimeToInternal(current_time_external);
+ pair<uint32_t, uint32_t> valid_range =
StrikeRegister::GetValidRange(current_time);
if (valid_range.second >= valid_range.first) {
return valid_range.second - current_time + 1;
@@ -286,24 +286,24 @@
}
void StrikeRegister::Validate() {
- set<uint32> free_internal_nodes;
- for (uint32 i = internal_node_free_head_; i != kNil;
+ set<uint32_t> free_internal_nodes;
+ for (uint32_t i = internal_node_free_head_; i != kNil;
i = internal_nodes_[i].next()) {
CHECK_LT(i, max_entries_);
CHECK_EQ(free_internal_nodes.count(i), 0u);
free_internal_nodes.insert(i);
}
- set<uint32> free_external_nodes;
- for (uint32 i = external_node_free_head_; i != kNil;
+ set<uint32_t> free_external_nodes;
+ for (uint32_t i = external_node_free_head_; i != kNil;
i = external_node_next_ptr(i)) {
CHECK_LT(i, max_entries_);
CHECK_EQ(free_external_nodes.count(i), 0u);
free_external_nodes.insert(i);
}
- set<uint32> used_external_nodes;
- set<uint32> used_internal_nodes;
+ set<uint32_t> used_external_nodes;
+ set<uint32_t> used_internal_nodes;
if (internal_node_head_ != kNil &&
((internal_node_head_ >> 8) & kExternalFlag) == 0) {
@@ -315,19 +315,19 @@
}
// static
-uint32 StrikeRegister::TimeFromBytes(const uint8 d[4]) {
- return static_cast<uint32>(d[0]) << 24 | static_cast<uint32>(d[1]) << 16 |
- static_cast<uint32>(d[2]) << 8 | static_cast<uint32>(d[3]);
+uint32_t StrikeRegister::TimeFromBytes(const uint8_t d[4]) {
+ return static_cast<uint32_t>(d[0]) << 24 | static_cast<uint32_t>(d[1]) << 16 |
+ static_cast<uint32_t>(d[2]) << 8 | static_cast<uint32_t>(d[3]);
}
-pair<uint32, uint32> StrikeRegister::GetValidRange(
- uint32 current_time_internal) const {
+pair<uint32_t, uint32_t> StrikeRegister::GetValidRange(
+ uint32_t current_time_internal) const {
if (current_time_internal < horizon_) {
// Empty valid range.
- return std::make_pair(std::numeric_limits<uint32>::max(), 0);
+ return std::make_pair(std::numeric_limits<uint32_t>::max(), 0);
}
- uint32 lower_bound;
+ uint32_t lower_bound;
if (current_time_internal >= window_secs_) {
lower_bound = std::max(horizon_, current_time_internal - window_secs_);
} else {
@@ -340,25 +340,26 @@
// allows the strike server to degrade optimally in cases where the
// insert rate exceeds |max_entries_ / (2 * window_secs_)| entries
// per second.
- uint32 upper_bound = current_time_internal +
- std::min(current_time_internal - horizon_, window_secs_);
+ uint32_t upper_bound =
+ current_time_internal +
+ std::min(current_time_internal - horizon_, window_secs_);
return std::make_pair(lower_bound, upper_bound);
}
-uint32 StrikeRegister::ExternalTimeToInternal(uint32 external_time) const {
+uint32_t StrikeRegister::ExternalTimeToInternal(uint32_t external_time) const {
return external_time - internal_epoch_;
}
-uint32 StrikeRegister::BestMatch(const uint8 v[24]) const {
+uint32_t StrikeRegister::BestMatch(const uint8_t v[24]) const {
if (internal_node_head_ == kNil) {
return kNil;
}
- uint32 next = internal_node_head_ >> 8;
+ uint32_t next = internal_node_head_ >> 8;
while ((next & kExternalFlag) == 0) {
InternalNode* node = &internal_nodes_[next];
- uint8 b = v[node->critbyte()];
+ uint8_t b = v[node->critbyte()];
unsigned direction =
(1 + static_cast<unsigned>(node->otherbits() | b)) >> 8;
next = node->child(direction);
@@ -367,23 +368,23 @@
return next & ~kExternalFlag;
}
-uint32& StrikeRegister::external_node_next_ptr(unsigned i) {
- return *reinterpret_cast<uint32*>(&external_nodes_[i * kExternalNodeSize]);
+uint32_t& StrikeRegister::external_node_next_ptr(unsigned i) {
+ return *reinterpret_cast<uint32_t*>(&external_nodes_[i * kExternalNodeSize]);
}
-uint8* StrikeRegister::external_node(unsigned i) {
+uint8_t* StrikeRegister::external_node(unsigned i) {
return &external_nodes_[i * kExternalNodeSize];
}
-uint32 StrikeRegister::GetFreeExternalNode() {
- uint32 index = external_node_free_head_;
+uint32_t StrikeRegister::GetFreeExternalNode() {
+ uint32_t index = external_node_free_head_;
DCHECK(index != kNil);
external_node_free_head_ = external_node_next_ptr(index);
return index;
}
-uint32 StrikeRegister::GetFreeInternalNode() {
- uint32 index = internal_node_free_head_;
+uint32_t StrikeRegister::GetFreeInternalNode() {
+ uint32_t index = internal_node_free_head_;
DCHECK(index != kNil);
internal_node_free_head_ = internal_nodes_[index].next();
return index;
@@ -399,8 +400,8 @@
// to do that we keep pointers to the parent (wherep) and grandparent
// (whereq) when walking down the tree.
- uint32 p = internal_node_head_ >> 8, *wherep = &internal_node_head_,
- *whereq = nullptr;
+ uint32_t p = internal_node_head_ >> 8, *wherep = &internal_node_head_,
+ *whereq = nullptr;
while ((p & kExternalFlag) == 0) {
whereq = wherep;
InternalNode* inode = &internal_nodes_[p];
@@ -410,9 +411,9 @@
p = (*wherep) >> 8;
}
- const uint32 ext_index = p & ~kExternalFlag;
- const uint8* ext_node = external_node(ext_index);
- uint32 new_horizon = ExternalTimeToInternal(TimeFromBytes(ext_node)) + 1;
+ const uint32_t ext_index = p & ~kExternalFlag;
+ const uint8_t* ext_node = external_node(ext_index);
+ uint32_t new_horizon = ExternalTimeToInternal(TimeFromBytes(ext_node)) + 1;
DCHECK_LE(horizon_, new_horizon);
horizon_ = new_horizon;
@@ -425,29 +426,29 @@
// |wherep| points to the left child pointer in the parent so we can add
// one and dereference to get the right child.
- const uint32 other_child = wherep[1];
+ const uint32_t other_child = wherep[1];
FreeInternalNode((*whereq) >> 8);
*whereq = (*whereq & 0xff) | (other_child & 0xffffff00);
FreeExternalNode(ext_index);
}
-void StrikeRegister::FreeExternalNode(uint32 index) {
+void StrikeRegister::FreeExternalNode(uint32_t index) {
external_node_next_ptr(index) = external_node_free_head_;
external_node_free_head_ = index;
}
-void StrikeRegister::FreeInternalNode(uint32 index) {
+void StrikeRegister::FreeInternalNode(uint32_t index) {
internal_nodes_[index].SetNextPtr(internal_node_free_head_);
internal_node_free_head_ = index;
}
-void StrikeRegister::ValidateTree(uint32 internal_node,
+void StrikeRegister::ValidateTree(uint32_t internal_node,
int last_bit,
const vector<pair<unsigned, bool>>& bits,
- const set<uint32>& free_internal_nodes,
- const set<uint32>& free_external_nodes,
- set<uint32>* used_internal_nodes,
- set<uint32>* used_external_nodes) {
+ const set<uint32_t>& free_internal_nodes,
+ const set<uint32_t>& free_external_nodes,
+ set<uint32_t>* used_internal_nodes,
+ set<uint32_t>* used_external_nodes) {
CHECK_LT(internal_node, max_entries_);
const InternalNode* i = &internal_nodes_[internal_node];
unsigned bit = 0;
@@ -489,21 +490,21 @@
for (unsigned child = 0; child < 2; child++) {
if (i->child(child) & kExternalFlag) {
- uint32 ext = i->child(child) & ~kExternalFlag;
+ uint32_t ext = i->child(child) & ~kExternalFlag;
CHECK_EQ(free_external_nodes.count(ext), 0u);
CHECK_EQ(used_external_nodes->count(ext), 0u);
used_external_nodes->insert(ext);
- const uint8* bytes = external_node(ext);
+ const uint8_t* bytes = external_node(ext);
for (const pair<unsigned, bool>& pair : bits) {
unsigned byte = pair.first / 8;
DCHECK_LE(byte, 0xffu);
unsigned bit_new = pair.first % 8;
- static const uint8 kMasks[8] = {0x80, 0x40, 0x20, 0x10,
- 0x08, 0x04, 0x02, 0x01};
+ static const uint8_t kMasks[8] = {0x80, 0x40, 0x20, 0x10,
+ 0x08, 0x04, 0x02, 0x01};
CHECK_EQ((bytes[byte] & kMasks[bit_new]) != 0, pair.second);
}
} else {
- uint32 inter = i->child(child);
+ uint32_t inter = i->child(child);
vector<pair<unsigned, bool>> new_bits(bits);
new_bits.push_back(pair<unsigned, bool>(bit, child != 0));
CHECK_EQ(free_internal_nodes.count(inter), 0u);
diff --git a/net/quic/crypto/strike_register.h b/net/quic/crypto/strike_register.h
index cbd0b8e..fd3f5a7 100644
--- a/net/quic/crypto/strike_register.h
+++ b/net/quic/crypto/strike_register.h
@@ -5,11 +5,13 @@
#ifndef NET_QUIC_CRYPTO_STRIKE_REGISTER_H_
#define NET_QUIC_CRYPTO_STRIKE_REGISTER_H_
+#include <stdint.h>
+
#include <set>
#include <utility>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
@@ -89,17 +91,17 @@
};
// An external node takes 24 bytes as we don't record the orbit.
- static const uint32 kExternalNodeSize;
+ static const uint32_t kExternalNodeSize;
// We address the nodes by their index in the array. This means that 0 is a
// valid index. Therefore this is our invalid index. It also has a one bit
// in the LSB position because we tend to store indexes shifted up 8 bits
// and this distinguishes kNil from (kExternalFlag | 0) << 8.
- static const uint32 kNil;
+ static const uint32_t kNil;
// Our pointers from internal nodes can either point to an internal or
// external node. We flag the 24th bit to mark a pointer as external.
- static const uint32 kExternalFlag;
+ static const uint32_t kExternalFlag;
// Allows early validation before a strike register is created.
static void ValidateStrikeRegisterConfig(unsigned max_entries);
@@ -113,9 +115,9 @@
// (Note that this code is independent of the actual units of time used, but
// you should use seconds.)
StrikeRegister(unsigned max_entries,
- uint32 current_time_external,
- uint32 window_secs,
- const uint8 orbit[8],
+ uint32_t current_time_external,
+ uint32_t window_secs,
+ const uint8_t orbit[8],
StartupType startup);
~StrikeRegister();
@@ -137,14 +139,14 @@
// 20 bytes of random data
//
// Otherwise, it inserts |nonce| into the observed set and returns NONCE_OK.
- InsertStatus Insert(const uint8 nonce[32], uint32 current_time);
+ InsertStatus Insert(const uint8_t nonce[32], uint32_t current_time);
// orbit returns a pointer to the 8-byte orbit value for this
// strike-register.
- const uint8* orbit() const;
+ const uint8_t* orbit() const;
// Time window for which the strike register has complete information.
- uint32 GetCurrentValidWindowSecs(uint32 current_time_external) const;
+ uint32_t GetCurrentValidWindowSecs(uint32_t current_time_external) const;
// This is a debugging aid which checks the tree for sanity.
void Validate();
@@ -152,65 +154,66 @@
private:
class InternalNode;
- // TimeFromBytes returns a big-endian uint32 from |d|.
- static uint32 TimeFromBytes(const uint8 d[4]);
+ // TimeFromBytes returns a big-endian uint32_t from |d|.
+ static uint32_t TimeFromBytes(const uint8_t d[4]);
// Range of internal times for which the strike register has
// complete information. A nonce is within the valid range of the
// strike register if:
// valid_range.first <= nonce_time_internal <= valid_range.second
- std::pair<uint32, uint32> GetValidRange(uint32 current_time_internal) const;
+ std::pair<uint32_t, uint32_t> GetValidRange(
+ uint32_t current_time_internal) const;
// ExternalTimeToInternal converts an external time value into an internal
// time value using |internal_epoch_|.
- uint32 ExternalTimeToInternal(uint32 external_time) const;
+ uint32_t ExternalTimeToInternal(uint32_t external_time) const;
// BestMatch returns either kNil, or an external node index which could
// possibly match |v|.
- uint32 BestMatch(const uint8 v[24]) const;
+ uint32_t BestMatch(const uint8_t v[24]) const;
// external_node_next_ptr returns the 'next' pointer embedded in external
// node |i|. This is used to thread a free list through the external nodes.
- uint32& external_node_next_ptr(unsigned i);
+ uint32_t& external_node_next_ptr(unsigned i);
- uint8* external_node(unsigned i);
+ uint8_t* external_node(unsigned i);
- uint32 GetFreeExternalNode();
+ uint32_t GetFreeExternalNode();
- uint32 GetFreeInternalNode();
+ uint32_t GetFreeInternalNode();
// DropOldestNode removes the oldest node in the tree and updates |horizon_|
// accordingly.
void DropOldestNode();
- void FreeExternalNode(uint32 index);
+ void FreeExternalNode(uint32_t index);
- void FreeInternalNode(uint32 index);
+ void FreeInternalNode(uint32_t index);
- void ValidateTree(uint32 internal_node,
+ void ValidateTree(uint32_t internal_node,
int last_bit,
const std::vector<std::pair<unsigned, bool>>& bits,
- const std::set<uint32>& free_internal_nodes,
- const std::set<uint32>& free_external_nodes,
- std::set<uint32>* used_internal_nodes,
- std::set<uint32>* used_external_nodes);
+ const std::set<uint32_t>& free_internal_nodes,
+ const std::set<uint32_t>& free_external_nodes,
+ std::set<uint32_t>* used_internal_nodes,
+ std::set<uint32_t>* used_external_nodes);
- const uint32 max_entries_;
- const uint32 window_secs_;
+ const uint32_t max_entries_;
+ const uint32_t window_secs_;
// internal_epoch_ contains the external time value of the start of internal
// time.
- const uint32 internal_epoch_;
- uint8 orbit_[8];
+ const uint32_t internal_epoch_;
+ uint8_t orbit_[8];
// The strike register will reject nonces with internal times < |horizon_| .
- uint32 horizon_;
+ uint32_t horizon_;
- uint32 internal_node_free_head_;
- uint32 external_node_free_head_;
- uint32 internal_node_head_;
+ uint32_t internal_node_free_head_;
+ uint32_t external_node_free_head_;
+ uint32_t internal_node_head_;
// internal_nodes_ can't be a scoped_ptr because the type isn't defined in
// this header.
InternalNode* internal_nodes_;
- scoped_ptr<uint8[]> external_nodes_;
+ scoped_ptr<uint8_t[]> external_nodes_;
DISALLOW_COPY_AND_ASSIGN(StrikeRegister);
};
diff --git a/net/quic/crypto/strike_register_client.h b/net/quic/crypto/strike_register_client.h
index 6a9dbd8..2bbf5b6 100644
--- a/net/quic/crypto/strike_register_client.h
+++ b/net/quic/crypto/strike_register_client.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/quic/crypto/strike_register.h"
diff --git a/net/quic/crypto/strike_register_test.cc b/net/quic/crypto/strike_register_test.cc
index 4f5aef8..2fca33fc 100644
--- a/net/quic/crypto/strike_register_test.cc
+++ b/net/quic/crypto/strike_register_test.cc
@@ -7,7 +7,6 @@
#include <set>
#include <string>
-#include "base/basictypes.h"
#include "base/rand_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -20,11 +19,11 @@
using std::set;
using std::string;
-const uint8 kOrbit[8] = {1, 2, 3, 4, 5, 6, 7, 8};
+const uint8_t kOrbit[8] = {1, 2, 3, 4, 5, 6, 7, 8};
// StrikeRegisterTests don't look at the random bytes so this function can
// simply set the random bytes to 0.
-void SetNonce(uint8 nonce[32], unsigned time, const uint8 orbit[8]) {
+void SetNonce(uint8_t nonce[32], unsigned time, const uint8_t orbit[8]) {
nonce[0] = time >> 24;
nonce[1] = time >> 16;
nonce[2] = time >> 8;
@@ -38,7 +37,7 @@
StrikeRegister set(10 /* max size */, 1000 /* current time */,
100 /* window secs */, kOrbit,
StrikeRegister::DENY_REQUESTS_AT_STARTUP);
- uint8 nonce[32];
+ uint8_t nonce[32];
SetNonce(nonce, 999, kOrbit);
EXPECT_EQ(NONCE_INVALID_TIME_FAILURE, set.Insert(nonce, 1000));
SetNonce(nonce, 1000, kOrbit);
@@ -58,7 +57,7 @@
StrikeRegister set(10 /* max size */, 1000 /* current time */,
100 /* window secs */, kOrbit,
StrikeRegister::NO_STARTUP_PERIOD_NEEDED);
- uint8 nonce[32];
+ uint8_t nonce[32];
SetNonce(nonce, 1000, kOrbit);
EXPECT_EQ(NONCE_OK, set.Insert(nonce, 1000));
EXPECT_EQ(NONCE_NOT_UNIQUE_FAILURE, set.Insert(nonce, 1000));
@@ -75,7 +74,7 @@
StrikeRegister set(10 /* max size */, 1000 /* current time */,
100 /* window secs */, kOrbit,
StrikeRegister::DENY_REQUESTS_AT_STARTUP);
- uint8 nonce[32];
+ uint8_t nonce[32];
SetNonce(nonce, 1101, kOrbit);
EXPECT_EQ(NONCE_INVALID_TIME_FAILURE, set.Insert(nonce, 1000));
SetNonce(nonce, 999, kOrbit);
@@ -87,8 +86,8 @@
StrikeRegister set(10 /* max size */, 1000 /* current time */,
100 /* window secs */, kOrbit,
StrikeRegister::DENY_REQUESTS_AT_STARTUP);
- uint8 nonce[32];
- static const uint8 kBadOrbit[8] = {0, 0, 0, 0, 1, 1, 1, 1};
+ uint8_t nonce[32];
+ static const uint8_t kBadOrbit[8] = {0, 0, 0, 0, 1, 1, 1, 1};
SetNonce(nonce, 1101, kBadOrbit);
EXPECT_EQ(NONCE_INVALID_ORBIT_FAILURE, set.Insert(nonce, 1100));
}
@@ -97,7 +96,7 @@
StrikeRegister set(10 /* max size */, 1000 /* current time */,
100 /* window secs */, kOrbit,
StrikeRegister::DENY_REQUESTS_AT_STARTUP);
- uint8 nonce[32];
+ uint8_t nonce[32];
SetNonce(nonce, 1101, kOrbit);
EXPECT_EQ(NONCE_OK, set.Insert(nonce, 1101));
}
@@ -107,7 +106,7 @@
StrikeRegister set(10 /* max size */, 1000 /* current time */,
100 /* window secs */, kOrbit,
StrikeRegister::DENY_REQUESTS_AT_STARTUP);
- uint8 nonce[32];
+ uint8_t nonce[32];
SetNonce(nonce, 1101, kOrbit);
EXPECT_EQ(NONCE_OK, set.Insert(nonce, 1101));
EXPECT_EQ(NONCE_NOT_UNIQUE_FAILURE, set.Insert(nonce, 1101));
@@ -121,7 +120,7 @@
for (size_t type_idx = 0; type_idx < arraysize(startup_types); ++type_idx) {
StrikeRegister set(5 /* max size */, 500 /* current time */,
100 /* window secs */, kOrbit, startup_types[type_idx]);
- uint8 nonce[6][32];
+ uint8_t nonce[6][32];
for (unsigned i = 0; i < 5; i++) {
SetNonce(nonce[i], 1101 + i, kOrbit);
nonce[i][31] = i;
@@ -170,7 +169,7 @@
500 /* window secs */, kOrbit,
StrikeRegister::DENY_REQUESTS_AT_STARTUP);
- uint8 nonce[32];
+ uint8_t nonce[32];
SetNonce(nonce, 1101, kOrbit);
for (unsigned i = 0; i < 100000; i++) {
SetNonce(nonce, 1101 + i / 500, kOrbit);
@@ -190,9 +189,9 @@
class SlowStrikeRegister {
public:
SlowStrikeRegister(unsigned max_entries,
- uint32 current_time,
- uint32 window_secs,
- const uint8 orbit[8])
+ uint32_t current_time,
+ uint32_t window_secs,
+ const uint8_t orbit[8])
: max_entries_(max_entries),
window_secs_(window_secs),
creation_time_(current_time),
@@ -200,20 +199,20 @@
memcpy(orbit_, orbit, sizeof(orbit_));
}
- InsertStatus Insert(const uint8 nonce_bytes[32],
- const uint32 nonce_time_external,
- const uint32 current_time_external) {
+ InsertStatus Insert(const uint8_t nonce_bytes[32],
+ const uint32_t nonce_time_external,
+ const uint32_t current_time_external) {
if (nonces_.size() == max_entries_) {
DropOldestEntry();
}
- const uint32 current_time = ExternalTimeToInternal(current_time_external);
+ const uint32_t current_time = ExternalTimeToInternal(current_time_external);
// Check to see if the orbit is correct.
if (memcmp(nonce_bytes + 4, orbit_, sizeof(orbit_))) {
return NONCE_INVALID_ORBIT_FAILURE;
}
- const uint32 nonce_time =
+ const uint32_t nonce_time =
ExternalTimeToInternal(TimeFromBytes(nonce_bytes));
EXPECT_EQ(ExternalTimeToInternal(nonce_time_external), nonce_time);
// We have dropped one or more nonces with a time value of |horizon_ - 1|,
@@ -230,10 +229,10 @@
return NONCE_INVALID_TIME_FAILURE;
}
- pair<uint32, string> nonce = std::make_pair(
+ pair<uint32_t, string> nonce = std::make_pair(
nonce_time, string(reinterpret_cast<const char*>(nonce_bytes), 32));
- set<pair<uint32, string>>::const_iterator it = nonces_.find(nonce);
+ set<pair<uint32_t, string>>::const_iterator it = nonces_.find(nonce);
if (it != nonces_.end()) {
return NONCE_NOT_UNIQUE_FAILURE;
}
@@ -242,8 +241,9 @@
return NONCE_OK;
}
- uint32 GetCurrentValidWindowSecs(const uint32 current_time_external) const {
- const uint32 current_time = ExternalTimeToInternal(current_time_external);
+ uint32_t GetCurrentValidWindowSecs(
+ const uint32_t current_time_external) const {
+ const uint32_t current_time = ExternalTimeToInternal(current_time_external);
if (horizon_ > current_time) {
return 0;
}
@@ -251,15 +251,16 @@
}
private:
- // TimeFromBytes returns a big-endian uint32 from |d|.
- static uint32 TimeFromBytes(const uint8 d[4]) {
- return static_cast<uint32>(d[0]) << 24 | static_cast<uint32>(d[1]) << 16 |
- static_cast<uint32>(d[2]) << 8 | static_cast<uint32>(d[3]);
+ // TimeFromBytes returns a big-endian uint32_t from |d|.
+ static uint32_t TimeFromBytes(const uint8_t d[4]) {
+ return static_cast<uint32_t>(d[0]) << 24 |
+ static_cast<uint32_t>(d[1]) << 16 |
+ static_cast<uint32_t>(d[2]) << 8 | static_cast<uint32_t>(d[3]);
}
- uint32 ExternalTimeToInternal(uint32 external_time) const {
- static const uint32 kCreationTimeFromInternalEpoch = 63115200.0;
- uint32 internal_epoch = 0;
+ uint32_t ExternalTimeToInternal(uint32_t external_time) const {
+ static const uint32_t kCreationTimeFromInternalEpoch = 63115200.0;
+ uint32_t internal_epoch = 0;
if (creation_time_ > kCreationTimeFromInternalEpoch) {
internal_epoch = creation_time_ - kCreationTimeFromInternalEpoch;
}
@@ -268,18 +269,18 @@
}
void DropOldestEntry() {
- set<pair<uint32, string>>::iterator oldest = nonces_.begin();
+ set<pair<uint32_t, string>>::iterator oldest = nonces_.begin();
horizon_ = oldest->first + 1;
nonces_.erase(oldest);
}
const unsigned max_entries_;
const unsigned window_secs_;
- const uint32 creation_time_;
- uint8 orbit_[8];
- uint32 horizon_;
+ const uint32_t creation_time_;
+ uint8_t orbit_[8];
+ uint32_t horizon_;
- set<pair<uint32, string>> nonces_;
+ set<pair<uint32_t, string>> nonces_;
};
class StrikeRegisterStressTest : public ::testing::Test {};
@@ -289,23 +290,23 @@
srand(42);
unsigned max_entries = 64;
- uint32 current_time = 10000, window = 200;
+ uint32_t current_time = 10000, window = 200;
scoped_ptr<StrikeRegister> s1(
new StrikeRegister(max_entries, current_time, window, kOrbit,
StrikeRegister::DENY_REQUESTS_AT_STARTUP));
scoped_ptr<SlowStrikeRegister> s2(
new SlowStrikeRegister(max_entries, current_time, window, kOrbit));
- uint64 i;
- const uint64 kMaxIterations = 10000;
+ uint64_t i;
+ const uint64_t kMaxIterations = 10000;
for (i = 0; i < kMaxIterations; i++) {
- const uint32 time = current_time + i;
+ const uint32_t time = current_time + i;
- uint8 nonce[32];
+ uint8_t nonce[32];
SetNonce(nonce, time, kOrbit);
// There are 2048 possible nonce values:
- const uint32 v = rand() % 2048;
+ const uint32_t v = rand() % 2048;
nonce[30] = v >> 8;
nonce[31] = v;
@@ -340,18 +341,18 @@
// Fixed seed gives reproducibility for this test.
srand(42);
unsigned max_entries = 64;
- uint32 current_time = 10000, window = 200;
+ uint32_t current_time = 10000, window = 200;
scoped_ptr<StrikeRegister> s1(
new StrikeRegister(max_entries, current_time, window, kOrbit,
StrikeRegister::DENY_REQUESTS_AT_STARTUP));
scoped_ptr<SlowStrikeRegister> s2(
new SlowStrikeRegister(max_entries, current_time, window, kOrbit));
- uint64 i;
+ uint64_t i;
// When making changes it's worth removing the limit on this test and running
// it for a while. For the initial development an opt binary was left running
// for 10 minutes.
- const uint64 kMaxIterations = 10000;
+ const uint64_t kMaxIterations = 10000;
for (i = 0; i < kMaxIterations; i++) {
if (rand() % 1000 == 0) {
// 0.1% chance of resetting the sets.
@@ -364,18 +365,18 @@
new SlowStrikeRegister(max_entries, current_time, window, kOrbit));
}
- int32 time_delta = rand() % (window * 4);
+ int32_t time_delta = rand() % (window * 4);
time_delta -= window * 2;
- const uint32 time = current_time + time_delta;
+ const uint32_t time = current_time + time_delta;
if (time_delta < 0 && time > current_time) {
continue; // overflow
}
- uint8 nonce[32];
+ uint8_t nonce[32];
SetNonce(nonce, time, kOrbit);
// There are 2048 possible nonce values:
- const uint32 v = rand() % 2048;
+ const uint32_t v = rand() % 2048;
nonce[30] = v >> 8;
nonce[31] = v;
diff --git a/net/quic/interval_set.h b/net/quic/interval_set.h
index eae4fd7e..e7e4b6d2 100644
--- a/net/quic/interval_set.h
+++ b/net/quic/interval_set.h
@@ -53,6 +53,7 @@
#define NET_QUIC_INTERVAL_SET_H_
#include <stddef.h>
+
#include <algorithm>
#include <set>
#include <string>
diff --git a/net/quic/interval_set_test.cc b/net/quic/interval_set_test.cc
index e3c351f8..d09c8170 100644
--- a/net/quic/interval_set_test.cc
+++ b/net/quic/interval_set_test.cc
@@ -417,8 +417,8 @@
#if 0
TEST_F(IntervalSetTest,
IntervalSetIntersectionTheirsBeforeMineInt64Singletons) {
- IntervalSet<int64> mine({{10, 15}});
- IntervalSet<int64> theirs({{-20, -5}});
+ IntervalSet<int64_t> mine({{10, 15}});
+ IntervalSet<int64_t> theirs({{-20, -5}});
EXPECT_FALSE(mine.Intersects(theirs));
EXPECT_FALSE(theirs.Intersects(mine));
mine.Intersection(theirs);
@@ -439,8 +439,8 @@
}
TEST_F(IntervalSetTest, IntervalSetIntersectionTheirsBetweenMine) {
- IntervalSet<int64> mine({{0, 5}, {40, 50}});
- IntervalSet<int64> theirs({{10, 15}});
+ IntervalSet<int64_t> mine({{0, 5}, {40, 50}});
+ IntervalSet<int64_t> theirs({{10, 15}});
EXPECT_FALSE(mine.Intersects(theirs));
EXPECT_FALSE(theirs.Intersects(mine));
mine.Intersection(theirs);
@@ -489,18 +489,18 @@
result1.Intersection(y1);
EXPECT_TRUE(result1.Empty()) << result1;
- const IntervalSet<int16> x2({{0, 10}, {20, 30}, {40, 90}});
- const IntervalSet<int16> y2(
+ const IntervalSet<int16_t> x2({{0, 10}, {20, 30}, {40, 90}});
+ const IntervalSet<int16_t> y2(
{{-50, -40}, {-2, 0}, {10, 20}, {32, 40}, {90, 95}});
- IntervalSet<int16> result2 = x2;
+ IntervalSet<int16_t> result2 = x2;
result2.Intersection(y2);
EXPECT_TRUE(result2.Empty()) << result2;
- const IntervalSet<int64> x3({{-1, 5}, {5, 10}});
- const IntervalSet<int64> y3({{-10, -1}, {10, 95}});
+ const IntervalSet<int64_t> x3({{-1, 5}, {5, 10}});
+ const IntervalSet<int64_t> y3({{-10, -1}, {10, 95}});
- IntervalSet<int64> result3 = x3;
+ IntervalSet<int64_t> result3 = x3;
result3.Intersection(y3);
EXPECT_TRUE(result3.Empty()) << result3;
}
@@ -515,21 +515,21 @@
result1.Intersection(y1);
EXPECT_EQ(result1, expected_result1);
- const IntervalSet<int16> x2({{0, 10}, {20, 30}, {40, 90}});
- const IntervalSet<int16> y2(
+ const IntervalSet<int16_t> x2({{0, 10}, {20, 30}, {40, 90}});
+ const IntervalSet<int16_t> y2(
{{-50, -40}, {-2, 2}, {9, 21}, {32, 41}, {85, 95}});
- const IntervalSet<int16> expected_result2(
+ const IntervalSet<int16_t> expected_result2(
{{0, 2}, {9, 10}, {20, 21}, {40, 41}, {85, 90}});
- IntervalSet<int16> result2 = x2;
+ IntervalSet<int16_t> result2 = x2;
result2.Intersection(y2);
EXPECT_EQ(result2, expected_result2);
- const IntervalSet<int64> x3({{-1, 5}, {5, 10}});
- const IntervalSet<int64> y3({{-10, 3}, {4, 95}});
- const IntervalSet<int64> expected_result3({{-1, 3}, {4, 10}});
+ const IntervalSet<int64_t> x3({{-1, 5}, {5, 10}});
+ const IntervalSet<int64_t> y3({{-10, 3}, {4, 95}});
+ const IntervalSet<int64_t> expected_result3({{-1, 3}, {4, 10}});
- IntervalSet<int64> result3 = x3;
+ IntervalSet<int64_t> result3 = x3;
result3.Intersection(y3);
EXPECT_EQ(result3, expected_result3);
}
diff --git a/net/quic/interval_test.cc b/net/quic/interval_test.cc
index 0157124e..ec2fd22 100644
--- a/net/quic/interval_test.cc
+++ b/net/quic/interval_test.cc
@@ -14,7 +14,6 @@
#include <string>
#include <utility>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "net/test/gtest_util.h"
@@ -34,12 +33,12 @@
// i1.IntersectWith(i2) and vice versa. The intersection should change i1 iff
// changes_i1 is true, and the same for changes_i2. The resulting
// intersection should be result.
- void TestIntersect(const Interval<int64>& i1,
- const Interval<int64>& i2,
+ void TestIntersect(const Interval<int64_t>& i1,
+ const Interval<int64_t>& i2,
bool changes_i1,
bool changes_i2,
- const Interval<int64>& result) {
- Interval<int64> i;
+ const Interval<int64_t>& result) {
+ Interval<int64_t> i;
i.CopyFrom(i1);
EXPECT_TRUE(i.IntersectWith(i2) == changes_i1 && i.Equals(result));
i.CopyFrom(i2);
@@ -48,14 +47,14 @@
};
TEST_F(IntervalTest, ConstructorsCopyAndClear) {
- Interval<int32> empty;
+ Interval<int32_t> empty;
EXPECT_TRUE(empty.Empty());
- Interval<int32> d2(0, 100);
+ Interval<int32_t> d2(0, 100);
EXPECT_EQ(0, d2.min());
EXPECT_EQ(100, d2.max());
- EXPECT_EQ(Interval<int32>(0, 100), d2);
- EXPECT_NE(Interval<int32>(0, 99), d2);
+ EXPECT_EQ(Interval<int32_t>(0, 100), d2);
+ EXPECT_NE(Interval<int32_t>(0, 99), d2);
empty.CopyFrom(d2);
EXPECT_EQ(0, d2.min());
@@ -65,7 +64,7 @@
EXPECT_TRUE(d2.Equals(empty));
EXPECT_EQ(d2, empty);
- Interval<int32> max_less_than_min(40, 20);
+ Interval<int32_t> max_less_than_min(40, 20);
EXPECT_TRUE(max_less_than_min.Empty());
EXPECT_EQ(40, max_less_than_min.min());
EXPECT_EQ(20, max_less_than_min.max());
@@ -76,7 +75,7 @@
}
TEST_F(IntervalTest, GettersSetters) {
- Interval<int32> d1(100, 200);
+ Interval<int32_t> d1(100, 200);
// SetMin:
d1.SetMin(30);
@@ -95,7 +94,7 @@
EXPECT_EQ(220, d1.max());
// SpanningUnion:
- Interval<int32> d2;
+ Interval<int32_t> d2;
EXPECT_TRUE(!d1.SpanningUnion(d2));
EXPECT_EQ(30, d1.min());
EXPECT_EQ(220, d1.max());
@@ -139,16 +138,16 @@
}
TEST_F(IntervalTest, CoveringOps) {
- const Interval<int64> empty;
- const Interval<int64> d(100, 200);
- const Interval<int64> d1(0, 50);
- const Interval<int64> d2(50, 110);
- const Interval<int64> d3(110, 180);
- const Interval<int64> d4(180, 220);
- const Interval<int64> d5(220, 300);
- const Interval<int64> d6(100, 150);
- const Interval<int64> d7(150, 200);
- const Interval<int64> d8(0, 300);
+ const Interval<int64_t> empty;
+ const Interval<int64_t> d(100, 200);
+ const Interval<int64_t> d1(0, 50);
+ const Interval<int64_t> d2(50, 110);
+ const Interval<int64_t> d3(110, 180);
+ const Interval<int64_t> d4(180, 220);
+ const Interval<int64_t> d5(220, 300);
+ const Interval<int64_t> d6(100, 150);
+ const Interval<int64_t> d7(150, 200);
+ const Interval<int64_t> d8(0, 300);
// Intersection:
EXPECT_TRUE(d.Intersects(d));
@@ -162,16 +161,16 @@
EXPECT_TRUE(d.Intersects(d7) && d7.Intersects(d));
EXPECT_TRUE(d.Intersects(d8) && d8.Intersects(d));
- Interval<int64> i;
+ Interval<int64_t> i;
EXPECT_TRUE(d.Intersects(d, &i) && d.Equals(i));
EXPECT_TRUE(!empty.Intersects(d, NULL) && !d.Intersects(empty, NULL));
EXPECT_TRUE(!d.Intersects(d1, NULL) && !d1.Intersects(d, NULL));
- EXPECT_TRUE(d.Intersects(d2, &i) && i.Equals(Interval<int64>(100, 110)));
- EXPECT_TRUE(d2.Intersects(d, &i) && i.Equals(Interval<int64>(100, 110)));
+ EXPECT_TRUE(d.Intersects(d2, &i) && i.Equals(Interval<int64_t>(100, 110)));
+ EXPECT_TRUE(d2.Intersects(d, &i) && i.Equals(Interval<int64_t>(100, 110)));
EXPECT_TRUE(d.Intersects(d3, &i) && i.Equals(d3));
EXPECT_TRUE(d3.Intersects(d, &i) && i.Equals(d3));
- EXPECT_TRUE(d.Intersects(d4, &i) && i.Equals(Interval<int64>(180, 200)));
- EXPECT_TRUE(d4.Intersects(d, &i) && i.Equals(Interval<int64>(180, 200)));
+ EXPECT_TRUE(d.Intersects(d4, &i) && i.Equals(Interval<int64_t>(180, 200)));
+ EXPECT_TRUE(d4.Intersects(d, &i) && i.Equals(Interval<int64_t>(180, 200)));
EXPECT_TRUE(!d.Intersects(d5, NULL) && !d5.Intersects(d, NULL));
EXPECT_TRUE(d.Intersects(d6, &i) && i.Equals(d6));
EXPECT_TRUE(d6.Intersects(d, &i) && i.Equals(d6));
@@ -185,7 +184,7 @@
TestIntersect(empty, d, false, true, empty);
TestIntersect(d, d1, true, true, empty);
TestIntersect(d1, d2, true, true, empty);
- TestIntersect(d, d2, true, true, Interval<int64>(100, 110));
+ TestIntersect(d, d2, true, true, Interval<int64_t>(100, 110));
TestIntersect(d8, d, true, false, d);
TestIntersect(d8, d1, true, false, d1);
TestIntersect(d8, d5, true, false, d5);
@@ -209,7 +208,7 @@
EXPECT_TRUE(!d.Contains(201));
// Difference:
- vector<Interval<int64>*> diff;
+ vector<Interval<int64_t>*> diff;
EXPECT_TRUE(!d.Difference(empty, &diff));
EXPECT_EQ(1u, diff.size());
@@ -225,8 +224,8 @@
EXPECT_EQ(200u, diff[0]->max());
STLDeleteElements(&diff);
- Interval<int64> lo;
- Interval<int64> hi;
+ Interval<int64_t> lo;
+ Interval<int64_t> hi;
EXPECT_TRUE(d.Difference(d2, &lo, &hi));
EXPECT_TRUE(lo.Empty());
diff --git a/net/quic/iovector.h b/net/quic/iovector.h
index ae9230a..0ea57bb0 100644
--- a/net/quic/iovector.h
+++ b/net/quic/iovector.h
@@ -6,10 +6,10 @@
#define NET_QUIC_IOVECTOR_H_
#include <stddef.h>
+
#include <algorithm>
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/base/iovec.h"
#include "net/base/net_export.h"
diff --git a/net/quic/network_connection.h b/net/quic/network_connection.h
index e4fde10..089fe34 100644
--- a/net/quic/network_connection.h
+++ b/net/quic/network_connection.h
@@ -5,7 +5,7 @@
#ifndef NET_QUIC_NETWORK_CONNECTION_H_
#define NET_QUIC_NETWORK_CONNECTION_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/base/network_change_notifier.h"
diff --git a/net/quic/p2p/quic_p2p_crypto_stream.h b/net/quic/p2p/quic_p2p_crypto_stream.h
index 82ff785..185a8f8 100644
--- a/net/quic/p2p/quic_p2p_crypto_stream.h
+++ b/net/quic/p2p/quic_p2p_crypto_stream.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_P2P_QUIC_P2P_CRYPTO_STREAM_H_
#define NET_QUIC_P2P_QUIC_P2P_CRYPTO_STREAM_H_
+#include "base/macros.h"
#include "net/quic/p2p/quic_p2p_crypto_config.h"
#include "net/quic/quic_crypto_stream.h"
diff --git a/net/quic/p2p/quic_p2p_session.h b/net/quic/p2p/quic_p2p_session.h
index 9f8d9472..697f6006 100644
--- a/net/quic/p2p/quic_p2p_session.h
+++ b/net/quic/p2p/quic_p2p_session.h
@@ -5,7 +5,7 @@
#ifndef NET_QUIC_P2P_QUIC_P2P_SESSION_H_
#define NET_QUIC_P2P_QUIC_P2P_SESSION_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/quic/p2p/quic_p2p_stream.h"
diff --git a/net/quic/p2p/quic_p2p_session_test.cc b/net/quic/p2p/quic_p2p_session_test.cc
index c70961d..3c029ea 100644
--- a/net/quic/p2p/quic_p2p_session_test.cc
+++ b/net/quic/p2p/quic_p2p_session_test.cc
@@ -6,6 +6,7 @@
#include "base/callback_helpers.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
@@ -102,11 +103,11 @@
return buf_len;
}
- int SetReceiveBufferSize(int32 size) override {
+ int SetReceiveBufferSize(int32_t size) override {
NOTIMPLEMENTED();
return ERR_NOT_IMPLEMENTED;
}
- int SetSendBufferSize(int32 size) override {
+ int SetSendBufferSize(int32_t size) override {
NOTIMPLEMENTED();
return ERR_NOT_IMPLEMENTED;
}
diff --git a/net/quic/p2p/quic_p2p_stream.h b/net/quic/p2p/quic_p2p_stream.h
index aea66f3..a2747e8 100644
--- a/net/quic/p2p/quic_p2p_stream.h
+++ b/net/quic/p2p/quic_p2p_stream.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_P2P_QUIC_P2P_STREAM_H_
#define NET_QUIC_P2P_QUIC_P2P_STREAM_H_
+#include "base/macros.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
#include "net/quic/reliable_quic_stream.h"
diff --git a/net/quic/port_suggester.cc b/net/quic/port_suggester.cc
index b556a24..569a0fd 100644
--- a/net/quic/port_suggester.cc
+++ b/net/quic/port_suggester.cc
@@ -9,7 +9,7 @@
namespace net {
-PortSuggester::PortSuggester(const HostPortPair& server, uint64 seed)
+PortSuggester::PortSuggester(const HostPortPair& server, uint64_t seed)
: call_count_(0), previous_suggestion_(-1) {
unsigned char hash_bytes[base::kSHA1Length];
base::SHA1HashBytes(
diff --git a/net/quic/port_suggester.h b/net/quic/port_suggester.h
index 0074f7c..458ddfa 100644
--- a/net/quic/port_suggester.h
+++ b/net/quic/port_suggester.h
@@ -5,7 +5,9 @@
#ifndef NET_QUIC_PORT_SUGGESTER_H_
#define NET_QUIC_PORT_SUGGESTER_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/sha1.h"
#include "net/base/net_export.h"
@@ -23,13 +25,13 @@
class NET_EXPORT_PRIVATE PortSuggester
: public base::RefCounted<PortSuggester> {
public:
- PortSuggester(const HostPortPair& server, uint64 seed);
+ PortSuggester(const HostPortPair& server, uint64_t seed);
// Generate a pseudo-random int in the inclusive range from |min| to |max|.
// Will (probably) return different numbers when called repeatedly.
int SuggestPort(int min, int max);
- uint32 call_count() const { return call_count_; }
+ uint32_t call_count() const { return call_count_; }
int previous_suggestion() const;
private:
@@ -38,8 +40,8 @@
virtual ~PortSuggester() {}
// We maintain the first 8 bytes of a hash as our seed_ state.
- uint64 seed_;
- uint32 call_count_; // Number of suggestions made.
+ uint64_t seed_;
+ uint32_t call_count_; // Number of suggestions made.
int previous_suggestion_;
DISALLOW_COPY_AND_ASSIGN(PortSuggester);
diff --git a/net/quic/port_suggester_unittest.cc b/net/quic/port_suggester_unittest.cc
index 093719a..d62f024 100644
--- a/net/quic/port_suggester_unittest.cc
+++ b/net/quic/port_suggester_unittest.cc
@@ -6,7 +6,6 @@
#include <set>
-#include "base/basictypes.h"
#include "net/base/host_port_pair.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -20,7 +19,7 @@
min_ephemeral_port_(1025),
max_ephemeral_port_(65535) {}
- uint64 entropy_;
+ uint64_t entropy_;
int min_ephemeral_port_;
int max_ephemeral_port_;
};
@@ -43,7 +42,7 @@
scoped_refptr<PortSuggester> port_suggester =
new PortSuggester(HostPortPair("www.example.com", 443), entropy_);
std::set<int> ports;
- const uint32 port_range = 20;
+ const uint32_t port_range = 20;
const int insertion_limit = 200; // We should be done by then.
for (int i = 0; i < insertion_limit; ++i) {
ports.insert(port_suggester->SuggestPort(
diff --git a/net/quic/quic_ack_listener_interface.h b/net/quic/quic_ack_listener_interface.h
index ceb369e..c2bd6fe 100644
--- a/net/quic/quic_ack_listener_interface.h
+++ b/net/quic/quic_ack_listener_interface.h
@@ -5,7 +5,6 @@
#ifndef NET_QUIC_QUIC_ACK_LISTENER_INTERFACE_H_
#define NET_QUIC_QUIC_ACK_LISTENER_INTERFACE_H_
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
diff --git a/net/quic/quic_alarm.h b/net/quic/quic_alarm.h
index 5df4fe0..48cd5ef 100644
--- a/net/quic/quic_alarm.h
+++ b/net/quic/quic_alarm.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_QUIC_ALARM_H_
#define NET_QUIC_QUIC_ALARM_H_
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/quic/quic_time.h"
diff --git a/net/quic/quic_bandwidth.cc b/net/quic/quic_bandwidth.cc
index 911eb6c..b7fe66d 100644
--- a/net/quic/quic_bandwidth.cc
+++ b/net/quic/quic_bandwidth.cc
@@ -13,7 +13,7 @@
namespace net {
// Highest number that QuicBandwidth can hold.
-const int64 kQuicInfiniteBandwidth = INT64_C(0x7fffffffffffffff);
+const int64_t kQuicInfiniteBandwidth = INT64_C(0x7fffffffffffffff);
// static
QuicBandwidth QuicBandwidth::Zero() {
@@ -21,24 +21,24 @@
}
// static
-QuicBandwidth QuicBandwidth::FromBitsPerSecond(int64 bits_per_second) {
+QuicBandwidth QuicBandwidth::FromBitsPerSecond(int64_t bits_per_second) {
return QuicBandwidth(bits_per_second);
}
// static
-QuicBandwidth QuicBandwidth::FromKBitsPerSecond(int64 k_bits_per_second) {
+QuicBandwidth QuicBandwidth::FromKBitsPerSecond(int64_t k_bits_per_second) {
DCHECK(k_bits_per_second < kQuicInfiniteBandwidth / 1000);
return QuicBandwidth(k_bits_per_second * 1000);
}
// static
-QuicBandwidth QuicBandwidth::FromBytesPerSecond(int64 bytes_per_second) {
+QuicBandwidth QuicBandwidth::FromBytesPerSecond(int64_t bytes_per_second) {
DCHECK(bytes_per_second < kQuicInfiniteBandwidth / 8);
return QuicBandwidth(bytes_per_second * 8);
}
// static
-QuicBandwidth QuicBandwidth::FromKBytesPerSecond(int64 k_bytes_per_second) {
+QuicBandwidth QuicBandwidth::FromKBytesPerSecond(int64_t k_bytes_per_second) {
DCHECK(k_bytes_per_second < kQuicInfiniteBandwidth / 8000);
return QuicBandwidth(k_bytes_per_second * 8000);
}
@@ -46,31 +46,31 @@
// static
QuicBandwidth QuicBandwidth::FromBytesAndTimeDelta(QuicByteCount bytes,
QuicTime::Delta delta) {
- DCHECK_LT(bytes, static_cast<uint64>(kQuicInfiniteBandwidth /
- (8 * kNumMicrosPerSecond)));
- int64 bytes_per_second =
+ DCHECK_LT(bytes, static_cast<uint64_t>(kQuicInfiniteBandwidth /
+ (8 * kNumMicrosPerSecond)));
+ int64_t bytes_per_second =
(bytes * kNumMicrosPerSecond) / delta.ToMicroseconds();
return QuicBandwidth(bytes_per_second * 8);
}
-QuicBandwidth::QuicBandwidth(int64 bits_per_second)
+QuicBandwidth::QuicBandwidth(int64_t bits_per_second)
: bits_per_second_(bits_per_second) {
DCHECK_GE(bits_per_second, 0);
}
-int64 QuicBandwidth::ToBitsPerSecond() const {
+int64_t QuicBandwidth::ToBitsPerSecond() const {
return bits_per_second_;
}
-int64 QuicBandwidth::ToKBitsPerSecond() const {
+int64_t QuicBandwidth::ToKBitsPerSecond() const {
return bits_per_second_ / 1000;
}
-int64 QuicBandwidth::ToBytesPerSecond() const {
+int64_t QuicBandwidth::ToBytesPerSecond() const {
return bits_per_second_ / 8;
}
-int64 QuicBandwidth::ToKBytesPerSecond() const {
+int64_t QuicBandwidth::ToKBytesPerSecond() const {
return bits_per_second_ / 8000;
}
@@ -80,7 +80,7 @@
kNumMicrosPerSecond;
}
-int64 QuicBandwidth::ToKBytesPerPeriod(QuicTime::Delta time_period) const {
+int64_t QuicBandwidth::ToKBytesPerPeriod(QuicTime::Delta time_period) const {
return ToKBytesPerSecond() * time_period.ToMicroseconds() /
kNumMicrosPerSecond;
}
@@ -98,7 +98,7 @@
}
QuicBandwidth QuicBandwidth::Scale(float scale_factor) const {
- return QuicBandwidth(static_cast<int64>(bits_per_second_ * scale_factor));
+ return QuicBandwidth(static_cast<int64_t>(bits_per_second_ * scale_factor));
}
QuicTime::Delta QuicBandwidth::TransferTime(QuicByteCount bytes) const {
diff --git a/net/quic/quic_bandwidth.h b/net/quic/quic_bandwidth.h
index ca4fdf1..8c092be 100644
--- a/net/quic/quic_bandwidth.h
+++ b/net/quic/quic_bandwidth.h
@@ -7,14 +7,15 @@
#ifndef NET_QUIC_QUIC_BANDWIDTH_H_
#define NET_QUIC_QUIC_BANDWIDTH_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "base/compiler_specific.h"
#include "net/quic/quic_time.h"
namespace net {
-typedef uint64 QuicByteCount;
-typedef uint64 QuicPacketCount;
+typedef uint64_t QuicByteCount;
+typedef uint64_t QuicPacketCount;
class NET_EXPORT_PRIVATE QuicBandwidth {
public:
@@ -22,32 +23,32 @@
static QuicBandwidth Zero();
// Create a new QuicBandwidth holding the bits per second.
- static QuicBandwidth FromBitsPerSecond(int64 bits_per_second);
+ static QuicBandwidth FromBitsPerSecond(int64_t bits_per_second);
// Create a new QuicBandwidth holding the kilo bits per second.
- static QuicBandwidth FromKBitsPerSecond(int64 k_bits_per_second);
+ static QuicBandwidth FromKBitsPerSecond(int64_t k_bits_per_second);
// Create a new QuicBandwidth holding the bytes per second.
- static QuicBandwidth FromBytesPerSecond(int64 bytes_per_second);
+ static QuicBandwidth FromBytesPerSecond(int64_t bytes_per_second);
// Create a new QuicBandwidth holding the kilo bytes per second.
- static QuicBandwidth FromKBytesPerSecond(int64 k_bytes_per_second);
+ static QuicBandwidth FromKBytesPerSecond(int64_t k_bytes_per_second);
// Create a new QuicBandwidth based on the bytes per the elapsed delta.
static QuicBandwidth FromBytesAndTimeDelta(QuicByteCount bytes,
QuicTime::Delta delta);
- int64 ToBitsPerSecond() const;
+ int64_t ToBitsPerSecond() const;
- int64 ToKBitsPerSecond() const;
+ int64_t ToKBitsPerSecond() const;
- int64 ToBytesPerSecond() const;
+ int64_t ToBytesPerSecond() const;
- int64 ToKBytesPerSecond() const;
+ int64_t ToKBytesPerSecond() const;
QuicByteCount ToBytesPerPeriod(QuicTime::Delta time_period) const;
- int64 ToKBytesPerPeriod(QuicTime::Delta time_period) const;
+ int64_t ToKBytesPerPeriod(QuicTime::Delta time_period) const;
bool IsZero() const;
@@ -60,8 +61,8 @@
QuicTime::Delta TransferTime(QuicByteCount bytes) const;
private:
- explicit QuicBandwidth(int64 bits_per_second);
- int64 bits_per_second_;
+ explicit QuicBandwidth(int64_t bits_per_second);
+ int64_t bits_per_second_;
};
// Non-member relational operators for QuicBandwidth.
diff --git a/net/quic/quic_blocked_writer_interface.h b/net/quic/quic_blocked_writer_interface.h
index 1c3a6fe..78a270a 100644
--- a/net/quic/quic_blocked_writer_interface.h
+++ b/net/quic/quic_blocked_writer_interface.h
@@ -9,6 +9,8 @@
#ifndef NET_QUIC_QUIC_BLOCKED_WRITER_INTERFACE_H_
#define NET_QUIC_QUIC_BLOCKED_WRITER_INTERFACE_H_
+#include <stddef.h>
+
#include "net/base/net_export.h"
namespace net {
diff --git a/net/quic/quic_chromium_client_session.cc b/net/quic/quic_chromium_client_session.cc
index edc6e8e..18aabbc3 100644
--- a/net/quic/quic_chromium_client_session.cc
+++ b/net/quic/quic_chromium_client_session.cc
@@ -470,7 +470,7 @@
// Report the TLS cipher suite that most closely resembles the crypto
// parameters of the QUIC connection.
QuicTag aead = crypto_stream_->crypto_negotiated_params().aead;
- uint16 cipher_suite;
+ uint16_t cipher_suite;
int security_bits;
switch (aead) {
case kAESG:
diff --git a/net/quic/quic_chromium_client_session.h b/net/quic/quic_chromium_client_session.h
index 174d436..296a52c 100644
--- a/net/quic/quic_chromium_client_session.h
+++ b/net/quic/quic_chromium_client_session.h
@@ -10,10 +10,12 @@
#ifndef NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_
#define NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_
+#include <stddef.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "net/base/completion_callback.h"
diff --git a/net/quic/quic_chromium_client_session_test.cc b/net/quic/quic_chromium_client_session_test.cc
index ec7cb69..113e998 100644
--- a/net/quic/quic_chromium_client_session_test.cc
+++ b/net/quic/quic_chromium_client_session_test.cc
@@ -42,7 +42,7 @@
namespace {
const char kServerHostname[] = "test.example.com";
-const uint16 kServerPort = 443;
+const uint16_t kServerPort = 443;
class QuicChromiumClientSessionTest
: public ::testing::TestWithParam<QuicVersion> {
@@ -228,9 +228,9 @@
}
TEST_P(QuicChromiumClientSessionTest, ConnectionNotPooledWithDifferentPin) {
- uint8 primary_pin = 1;
- uint8 backup_pin = 2;
- uint8 bad_pin = 3;
+ uint8_t primary_pin = 1;
+ uint8_t backup_pin = 2;
+ uint8_t bad_pin = 3;
AddPin(&transport_security_state_, "mail.example.org", primary_pin,
backup_pin);
@@ -252,8 +252,8 @@
}
TEST_P(QuicChromiumClientSessionTest, ConnectionPooledWithMatchingPin) {
- uint8 primary_pin = 1;
- uint8 backup_pin = 2;
+ uint8_t primary_pin = 1;
+ uint8_t backup_pin = 2;
AddPin(&transport_security_state_, "mail.example.org", primary_pin,
backup_pin);
diff --git a/net/quic/quic_client_session_base.h b/net/quic/quic_client_session_base.h
index 1940dc82..8acfd4f 100644
--- a/net/quic/quic_client_session_base.h
+++ b/net/quic/quic_client_session_base.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_
#define NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_
+#include "base/macros.h"
#include "net/quic/quic_crypto_client_stream.h"
#include "net/quic/quic_spdy_session.h"
diff --git a/net/quic/quic_clock.h b/net/quic/quic_clock.h
index 4e96d4c..4700edd 100644
--- a/net/quic/quic_clock.h
+++ b/net/quic/quic_clock.h
@@ -5,7 +5,7 @@
#ifndef NET_QUIC_QUIC_CLOCK_H_
#define NET_QUIC_QUIC_CLOCK_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/quic_time.h"
diff --git a/net/quic/quic_clock_test.cc b/net/quic/quic_clock_test.cc
index 6ee45408..b680061 100644
--- a/net/quic/quic_clock_test.cc
+++ b/net/quic/quic_clock_test.cc
@@ -29,8 +29,8 @@
// If end > start, then we can check now is between start and end.
if (end > start) {
- EXPECT_LE(static_cast<uint64>(start.ToTimeT()), now.ToUNIXSeconds());
- EXPECT_LE(now.ToUNIXSeconds(), static_cast<uint64>(end.ToTimeT()));
+ EXPECT_LE(static_cast<uint64_t>(start.ToTimeT()), now.ToUNIXSeconds());
+ EXPECT_LE(now.ToUNIXSeconds(), static_cast<uint64_t>(end.ToTimeT()));
}
}
diff --git a/net/quic/quic_config.cc b/net/quic/quic_config.cc
index 292e6d9..51e0a9a 100644
--- a/net/quic/quic_config.cc
+++ b/net/quic/quic_config.cc
@@ -22,8 +22,8 @@
QuicErrorCode ReadUint32(const CryptoHandshakeMessage& msg,
QuicTag tag,
QuicConfigPresence presence,
- uint32 default_value,
- uint32* out,
+ uint32_t default_value,
+ uint32_t* out,
string* error_details) {
DCHECK(error_details != nullptr);
QuicErrorCode error = msg.GetUint32(tag, out);
@@ -62,13 +62,13 @@
negotiated_value_(0) {}
QuicNegotiableUint32::~QuicNegotiableUint32() {}
-void QuicNegotiableUint32::set(uint32 max, uint32 default_value) {
+void QuicNegotiableUint32::set(uint32_t max, uint32_t default_value) {
DCHECK_LE(default_value, max);
max_value_ = max;
default_value_ = default_value;
}
-uint32 QuicNegotiableUint32::GetUint32() const {
+uint32_t QuicNegotiableUint32::GetUint32() const {
if (negotiated()) {
return negotiated_value_;
}
@@ -90,7 +90,7 @@
string* error_details) {
DCHECK(!negotiated());
DCHECK(error_details != nullptr);
- uint32 value;
+ uint32_t value;
QuicErrorCode error = ReadUint32(peer_hello, tag_, presence_, default_value_,
&value, error_details);
if (error != QUIC_NO_ERROR) {
@@ -202,13 +202,13 @@
return has_send_value_;
}
-uint32 QuicFixedUint32::GetSendValue() const {
+uint32_t QuicFixedUint32::GetSendValue() const {
LOG_IF(DFATAL, !has_send_value_) << "No send value to get for tag:"
<< QuicUtils::TagToString(tag_);
return send_value_;
}
-void QuicFixedUint32::SetSendValue(uint32 value) {
+void QuicFixedUint32::SetSendValue(uint32_t value) {
has_send_value_ = true;
send_value_ = value;
}
@@ -217,13 +217,13 @@
return has_receive_value_;
}
-uint32 QuicFixedUint32::GetReceivedValue() const {
+uint32_t QuicFixedUint32::GetReceivedValue() const {
LOG_IF(DFATAL, !has_receive_value_) << "No receive value to get for tag:"
<< QuicUtils::TagToString(tag_);
return receive_value_;
}
-void QuicFixedUint32::SetReceivedValue(uint32 value) {
+void QuicFixedUint32::SetReceivedValue(uint32_t value) {
has_receive_value_ = true;
receive_value_ = value;
}
@@ -399,8 +399,8 @@
QuicTime::Delta max_idle_connection_state_lifetime,
QuicTime::Delta default_idle_conection_state_lifetime) {
idle_connection_state_lifetime_seconds_.set(
- static_cast<uint32>(max_idle_connection_state_lifetime.ToSeconds()),
- static_cast<uint32>(default_idle_conection_state_lifetime.ToSeconds()));
+ static_cast<uint32_t>(max_idle_connection_state_lifetime.ToSeconds()),
+ static_cast<uint32_t>(default_idle_conection_state_lifetime.ToSeconds()));
}
QuicTime::Delta QuicConfig::IdleConnectionStateLifetime() const {
@@ -422,7 +422,7 @@
max_streams_per_connection_.set(max_streams, default_streams);
}
-uint32 QuicConfig::MaxStreamsPerConnection() const {
+uint32_t QuicConfig::MaxStreamsPerConnection() const {
return max_streams_per_connection_.GetUint32();
}
@@ -430,7 +430,7 @@
return bytes_for_connection_id_.HasSendValue();
}
-void QuicConfig::SetBytesForConnectionIdToSend(uint32 bytes) {
+void QuicConfig::SetBytesForConnectionIdToSend(uint32_t bytes) {
bytes_for_connection_id_.SetSendValue(bytes);
}
@@ -438,11 +438,11 @@
return bytes_for_connection_id_.HasReceivedValue();
}
-uint32 QuicConfig::ReceivedBytesForConnectionId() const {
+uint32_t QuicConfig::ReceivedBytesForConnectionId() const {
return bytes_for_connection_id_.GetReceivedValue();
}
-void QuicConfig::SetInitialRoundTripTimeUsToSend(uint32 rtt) {
+void QuicConfig::SetInitialRoundTripTimeUsToSend(uint32_t rtt) {
initial_round_trip_time_us_.SetSendValue(rtt);
}
@@ -450,7 +450,7 @@
return initial_round_trip_time_us_.HasReceivedValue();
}
-uint32 QuicConfig::ReceivedInitialRoundTripTimeUs() const {
+uint32_t QuicConfig::ReceivedInitialRoundTripTimeUs() const {
return initial_round_trip_time_us_.GetReceivedValue();
}
@@ -458,11 +458,12 @@
return initial_round_trip_time_us_.HasSendValue();
}
-uint32 QuicConfig::GetInitialRoundTripTimeUsToSend() const {
+uint32_t QuicConfig::GetInitialRoundTripTimeUsToSend() const {
return initial_round_trip_time_us_.GetSendValue();
}
-void QuicConfig::SetInitialStreamFlowControlWindowToSend(uint32 window_bytes) {
+void QuicConfig::SetInitialStreamFlowControlWindowToSend(
+ uint32_t window_bytes) {
if (window_bytes < kMinimumFlowControlSendWindow) {
LOG(DFATAL) << "Initial stream flow control receive window ("
<< window_bytes << ") cannot be set lower than default ("
@@ -472,7 +473,7 @@
initial_stream_flow_control_window_bytes_.SetSendValue(window_bytes);
}
-uint32 QuicConfig::GetInitialStreamFlowControlWindowToSend() const {
+uint32_t QuicConfig::GetInitialStreamFlowControlWindowToSend() const {
return initial_stream_flow_control_window_bytes_.GetSendValue();
}
@@ -480,11 +481,12 @@
return initial_stream_flow_control_window_bytes_.HasReceivedValue();
}
-uint32 QuicConfig::ReceivedInitialStreamFlowControlWindowBytes() const {
+uint32_t QuicConfig::ReceivedInitialStreamFlowControlWindowBytes() const {
return initial_stream_flow_control_window_bytes_.GetReceivedValue();
}
-void QuicConfig::SetInitialSessionFlowControlWindowToSend(uint32 window_bytes) {
+void QuicConfig::SetInitialSessionFlowControlWindowToSend(
+ uint32_t window_bytes) {
if (window_bytes < kMinimumFlowControlSendWindow) {
LOG(DFATAL) << "Initial session flow control receive window ("
<< window_bytes << ") cannot be set lower than default ("
@@ -494,7 +496,7 @@
initial_session_flow_control_window_bytes_.SetSendValue(window_bytes);
}
-uint32 QuicConfig::GetInitialSessionFlowControlWindowToSend() const {
+uint32_t QuicConfig::GetInitialSessionFlowControlWindowToSend() const {
return initial_session_flow_control_window_bytes_.GetSendValue();
}
@@ -502,11 +504,11 @@
return initial_session_flow_control_window_bytes_.HasReceivedValue();
}
-uint32 QuicConfig::ReceivedInitialSessionFlowControlWindowBytes() const {
+uint32_t QuicConfig::ReceivedInitialSessionFlowControlWindowBytes() const {
return initial_session_flow_control_window_bytes_.GetReceivedValue();
}
-void QuicConfig::SetSocketReceiveBufferToSend(uint32 tcp_receive_window) {
+void QuicConfig::SetSocketReceiveBufferToSend(uint32_t tcp_receive_window) {
socket_receive_buffer_.SetSendValue(tcp_receive_window);
}
@@ -514,7 +516,7 @@
return socket_receive_buffer_.HasReceivedValue();
}
-uint32 QuicConfig::ReceivedSocketReceiveBuffer() const {
+uint32_t QuicConfig::ReceivedSocketReceiveBuffer() const {
return socket_receive_buffer_.GetReceivedValue();
}
diff --git a/net/quic/quic_config.h b/net/quic/quic_config.h
index 037aa7d..3609f2d 100644
--- a/net/quic/quic_config.h
+++ b/net/quic/quic_config.h
@@ -5,9 +5,11 @@
#ifndef NET_QUIC_QUIC_CONFIG_H_
#define NET_QUIC_QUIC_CONFIG_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
@@ -82,11 +84,11 @@
// also the default values to be assumed if PRESENCE_OPTIONAL and the *HLO msg
// doesn't contain a value corresponding to |name_|. |max| is serialised via
// ToHandshakeMessage call if |negotiated_| is false.
- void set(uint32 max, uint32 default_value);
+ void set(uint32_t max, uint32_t default_value);
// Returns the value negotiated if |negotiated_| is true, otherwise returns
// default_value_ (used to set default values before negotiation finishes).
- uint32 GetUint32() const;
+ uint32_t GetUint32() const;
// Serialises |name_| and value to |out|. If |negotiated_| is true then
// |negotiated_value_| is serialised, otherwise |max_value_| is serialised.
@@ -101,9 +103,9 @@
std::string* error_details) override;
private:
- uint32 max_value_;
- uint32 default_value_;
- uint32 negotiated_value_;
+ uint32_t max_value_;
+ uint32_t default_value_;
+ uint32_t negotiated_value_;
};
class NET_EXPORT_PRIVATE QuicNegotiableTag : public QuicNegotiableValue {
@@ -142,7 +144,7 @@
QuicTag default_value_;
};
-// Stores uint32 from CHLO or SHLO messages that are not negotiated.
+// Stores uint32_t from CHLO or SHLO messages that are not negotiated.
class NET_EXPORT_PRIVATE QuicFixedUint32 : public QuicConfigValue {
public:
QuicFixedUint32(QuicTag name, QuicConfigPresence presence);
@@ -150,15 +152,15 @@
bool HasSendValue() const;
- uint32 GetSendValue() const;
+ uint32_t GetSendValue() const;
- void SetSendValue(uint32 value);
+ void SetSendValue(uint32_t value);
bool HasReceivedValue() const;
- uint32 GetReceivedValue() const;
+ uint32_t GetReceivedValue() const;
- void SetReceivedValue(uint32 value);
+ void SetReceivedValue(uint32_t value);
// If has_send_value is true, serialises |tag_| and |send_value_| to |out|.
void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
@@ -169,9 +171,9 @@
std::string* error_details) override;
private:
- uint32 send_value_;
+ uint32_t send_value_;
bool has_send_value_;
- uint32 receive_value_;
+ uint32_t receive_value_;
bool has_receive_value_;
};
@@ -251,7 +253,7 @@
void SetMaxStreamsPerConnection(size_t max_streams, size_t default_streams);
- uint32 MaxStreamsPerConnection() const;
+ uint32_t MaxStreamsPerConnection() const;
void set_max_time_before_crypto_handshake(
QuicTime::Delta max_time_before_crypto_handshake) {
@@ -283,47 +285,47 @@
bool HasSetBytesForConnectionIdToSend() const;
// Sets the peer's connection id length, in bytes.
- void SetBytesForConnectionIdToSend(uint32 bytes);
+ void SetBytesForConnectionIdToSend(uint32_t bytes);
bool HasReceivedBytesForConnectionId() const;
- uint32 ReceivedBytesForConnectionId() const;
+ uint32_t ReceivedBytesForConnectionId() const;
// Sets an estimated initial round trip time in us.
- void SetInitialRoundTripTimeUsToSend(uint32 rtt_us);
+ void SetInitialRoundTripTimeUsToSend(uint32_t rtt_us);
bool HasReceivedInitialRoundTripTimeUs() const;
- uint32 ReceivedInitialRoundTripTimeUs() const;
+ uint32_t ReceivedInitialRoundTripTimeUs() const;
bool HasInitialRoundTripTimeUsToSend() const;
- uint32 GetInitialRoundTripTimeUsToSend() const;
+ uint32_t GetInitialRoundTripTimeUsToSend() const;
// Sets an initial stream flow control window size to transmit to the peer.
- void SetInitialStreamFlowControlWindowToSend(uint32 window_bytes);
+ void SetInitialStreamFlowControlWindowToSend(uint32_t window_bytes);
- uint32 GetInitialStreamFlowControlWindowToSend() const;
+ uint32_t GetInitialStreamFlowControlWindowToSend() const;
bool HasReceivedInitialStreamFlowControlWindowBytes() const;
- uint32 ReceivedInitialStreamFlowControlWindowBytes() const;
+ uint32_t ReceivedInitialStreamFlowControlWindowBytes() const;
// Sets an initial session flow control window size to transmit to the peer.
- void SetInitialSessionFlowControlWindowToSend(uint32 window_bytes);
+ void SetInitialSessionFlowControlWindowToSend(uint32_t window_bytes);
- uint32 GetInitialSessionFlowControlWindowToSend() const;
+ uint32_t GetInitialSessionFlowControlWindowToSend() const;
bool HasReceivedInitialSessionFlowControlWindowBytes() const;
- uint32 ReceivedInitialSessionFlowControlWindowBytes() const;
+ uint32_t ReceivedInitialSessionFlowControlWindowBytes() const;
// Sets socket receive buffer to transmit to the peer.
- void SetSocketReceiveBufferToSend(uint32 window_bytes);
+ void SetSocketReceiveBufferToSend(uint32_t window_bytes);
bool HasReceivedSocketReceiveBuffer() const;
- uint32 ReceivedSocketReceiveBuffer() const;
+ uint32_t ReceivedSocketReceiveBuffer() const;
bool negotiated() const;
diff --git a/net/quic/quic_config_test.cc b/net/quic/quic_config_test.cc
index 2581c57..ec1c6aa 100644
--- a/net/quic/quic_config_test.cc
+++ b/net/quic/quic_config_test.cc
@@ -38,7 +38,7 @@
CryptoHandshakeMessage msg;
config_.ToHandshakeMessage(&msg);
- uint32 value;
+ uint32_t value;
QuicErrorCode error = msg.GetUint32(kICSL, &value);
EXPECT_EQ(QUIC_NO_ERROR, error);
EXPECT_EQ(5u, value);
@@ -216,7 +216,7 @@
// QuicConfig should not accept an invalid flow control window to send to the
// peer: the receive window must be at least the default of 16 Kb.
QuicConfig config;
- const uint64 kInvalidWindow = kMinimumFlowControlSendWindow - 1;
+ const uint64_t kInvalidWindow = kMinimumFlowControlSendWindow - 1;
EXPECT_DFATAL(config.SetInitialStreamFlowControlWindowToSend(kInvalidWindow),
"Initial stream flow control receive window");
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index 0b4c74fd..b2a27d96 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -16,6 +16,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
diff --git a/net/quic/quic_connection.h b/net/quic/quic_connection.h
index 1eaf9e64c..76bfd34 100644
--- a/net/quic/quic_connection.h
+++ b/net/quic/quic_connection.h
@@ -17,6 +17,8 @@
#define NET_QUIC_QUIC_CONNECTION_H_
#include <stddef.h>
+#include <stdint.h>
+
#include <deque>
#include <list>
#include <map>
@@ -24,8 +26,8 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/ip_endpoint.h"
@@ -622,7 +624,7 @@
// Return the name of the cipher of the primary decrypter of the framer.
const char* cipher_name() const { return framer_.decrypter()->cipher_name(); }
// Return the id of the cipher of the primary decrypter of the framer.
- uint32 cipher_id() const { return framer_.decrypter()->cipher_id(); }
+ uint32_t cipher_id() const { return framer_.decrypter()->cipher_id(); }
std::vector<QuicEncryptedPacket*>* termination_packets() {
return termination_packets_.get();
@@ -807,7 +809,7 @@
// Used to store latest peer IP address for IP address migration.
IPAddressNumber migrating_peer_ip_;
// Used to store latest peer port to possibly migrate to later.
- uint16 migrating_peer_port_;
+ uint16_t migrating_peer_port_;
// True if the last packet has gotten far enough in the framer to be
// decrypted.
diff --git a/net/quic/quic_connection_helper.cc b/net/quic/quic_connection_helper.cc
index a57bc94d..0ec9ec2 100644
--- a/net/quic/quic_connection_helper.cc
+++ b/net/quic/quic_connection_helper.cc
@@ -43,7 +43,7 @@
weak_factory_.InvalidateWeakPtrs();
}
- int64 delay_us = deadline().Subtract(clock_->Now()).ToMicroseconds();
+ int64_t delay_us = deadline().Subtract(clock_->Now()).ToMicroseconds();
if (delay_us < 0) {
delay_us = 0;
}
diff --git a/net/quic/quic_connection_helper.h b/net/quic/quic_connection_helper.h
index 140bf9a..9b53f580 100644
--- a/net/quic/quic_connection_helper.h
+++ b/net/quic/quic_connection_helper.h
@@ -12,7 +12,7 @@
#include <set>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc
index 1332979c..90462f5 100644
--- a/net/quic/quic_connection_logger.cc
+++ b/net/quic/quic_connection_logger.cc
@@ -355,7 +355,7 @@
base::Bind(&NetLogQuicAckFrameCallback, frame.ack_frame));
const PacketNumberQueue& missing_packets =
frame.ack_frame->missing_packets;
- const uint8 max_ranges = std::numeric_limits<uint8>::max();
+ const uint8_t max_ranges = std::numeric_limits<uint8_t>::max();
// Compute an upper bound on the number of NACK ranges. If the bound
// is below the max, then it clearly isn't truncated.
if (missing_packets.NumPacketsSlow() < max_ranges ||
diff --git a/net/quic/quic_connection_logger.h b/net/quic/quic_connection_logger.h
index 7d308b1..6d41490 100644
--- a/net/quic/quic_connection_logger.h
+++ b/net/quic/quic_connection_logger.h
@@ -5,8 +5,11 @@
#ifndef NET_QUIC_QUIC_CONNECTION_LOGGER_H_
#define NET_QUIC_QUIC_CONNECTION_LOGGER_H_
+#include <stddef.h>
+
#include <bitset>
+#include "base/macros.h"
#include "net/base/ip_endpoint.h"
#include "net/base/network_change_notifier.h"
#include "net/base/socket_performance_watcher.h"
diff --git a/net/quic/quic_connection_stats.h b/net/quic/quic_connection_stats.h
index 737d81a8..655ab32 100644
--- a/net/quic/quic_connection_stats.h
+++ b/net/quic/quic_connection_stats.h
@@ -5,9 +5,11 @@
#ifndef NET_QUIC_QUIC_CONNECTION_STATS_H_
#define NET_QUIC_QUIC_CONNECTION_STATS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <ostream>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
#include "net/quic/quic_bandwidth.h"
#include "net/quic/quic_protocol.h"
@@ -61,8 +63,8 @@
size_t tlp_count;
size_t rto_count; // Count of times the rto timer fired.
- int64 min_rtt_us; // Minimum RTT in microseconds.
- int64 srtt_us; // Smoothed RTT in microseconds.
+ int64_t min_rtt_us; // Minimum RTT in microseconds.
+ int64_t srtt_us; // Smoothed RTT in microseconds.
QuicByteCount max_packet_size;
QuicByteCount max_received_packet_size;
QuicBandwidth estimated_bandwidth;
@@ -73,12 +75,12 @@
// Maximum reordering observed in packet number space.
QuicPacketNumber max_sequence_reordering;
// Maximum reordering observed in microseconds
- int64 max_time_reordering_us;
+ int64_t max_time_reordering_us;
// The following stats are used only in TcpCubicSender.
// The number of loss events from TCP's perspective. Each loss event includes
// one or more lost packets.
- uint32 tcp_loss_events;
+ uint32_t tcp_loss_events;
// Creation time, as reported by the QuicClock.
QuicTime connection_creation_time;
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index 6354a1e..421b4a39 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -6,8 +6,8 @@
#include <ostream>
-#include "base/basictypes.h"
#include "base/bind.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "net/base/net_errors.h"
@@ -72,7 +72,7 @@
// TaggingEncrypter appends kTagSize bytes of |tag| to the end of each message.
class TaggingEncrypter : public QuicEncrypter {
public:
- explicit TaggingEncrypter(uint8 tag) : tag_(tag) {}
+ explicit TaggingEncrypter(uint8_t tag) : tag_(tag) {}
~TaggingEncrypter() override {}
@@ -118,7 +118,7 @@
kTagSize = 12,
};
- const uint8 tag_;
+ const uint8_t tag_;
DISALLOW_COPY_AND_ASSIGN(TaggingEncrypter);
};
@@ -155,10 +155,10 @@
StringPiece GetNoncePrefix() const override { return StringPiece(); }
const char* cipher_name() const override { return "Tagging"; }
// Use a distinct value starting with 0xFFFFFF, which is never used by TLS.
- uint32 cipher_id() const override { return 0xFFFFFFF0; }
+ uint32_t cipher_id() const override { return 0xFFFFFFF0; }
protected:
- virtual uint8 GetTag(StringPiece ciphertext) {
+ virtual uint8_t GetTag(StringPiece ciphertext) {
return ciphertext.data()[ciphertext.size() - 1];
}
@@ -167,7 +167,7 @@
kTagSize = 12,
};
- bool CheckTag(StringPiece ciphertext, uint8 tag) {
+ bool CheckTag(StringPiece ciphertext, uint8_t tag) {
for (size_t i = ciphertext.size() - kTagSize; i < ciphertext.size(); i++) {
if (ciphertext.data()[i] != tag) {
return false;
@@ -182,18 +182,18 @@
// match the expected value.
class StrictTaggingDecrypter : public TaggingDecrypter {
public:
- explicit StrictTaggingDecrypter(uint8 tag) : tag_(tag) {}
+ explicit StrictTaggingDecrypter(uint8_t tag) : tag_(tag) {}
~StrictTaggingDecrypter() override {}
// TaggingQuicDecrypter
- uint8 GetTag(StringPiece ciphertext) override { return tag_; }
+ uint8_t GetTag(StringPiece ciphertext) override { return tag_; }
const char* cipher_name() const override { return "StrictTagging"; }
// Use a distinct value starting with 0xFFFFFF, which is never used by TLS.
- uint32 cipher_id() const override { return 0xFFFFFFF1; }
+ uint32_t cipher_id() const override { return 0xFFFFFFF1; }
private:
- const uint8 tag_;
+ const uint8_t tag_;
};
class TestConnectionHelper : public QuicConnectionHelperInterface {
@@ -356,19 +356,19 @@
}
// final_bytes_of_last_packet_ returns the last four bytes of the previous
- // packet as a little-endian, uint32. This is intended to be used with a
+ // packet as a little-endian, uint32_t. This is intended to be used with a
// TaggingEncrypter so that tests can determine which encrypter was used for
// a given packet.
- uint32 final_bytes_of_last_packet() { return final_bytes_of_last_packet_; }
+ uint32_t final_bytes_of_last_packet() { return final_bytes_of_last_packet_; }
// Returns the final bytes of the second to last packet.
- uint32 final_bytes_of_previous_packet() {
+ uint32_t final_bytes_of_previous_packet() {
return final_bytes_of_previous_packet_;
}
void use_tagging_decrypter() { use_tagging_decrypter_ = true; }
- uint32 packets_write_attempts() { return packets_write_attempts_; }
+ uint32_t packets_write_attempts() { return packets_write_attempts_; }
void Reset() { framer_.Reset(); }
@@ -388,10 +388,10 @@
bool write_should_fail_;
bool block_on_next_write_;
bool is_write_blocked_data_buffered_;
- uint32 final_bytes_of_last_packet_;
- uint32 final_bytes_of_previous_packet_;
+ uint32_t final_bytes_of_last_packet_;
+ uint32_t final_bytes_of_previous_packet_;
bool use_tagging_decrypter_;
- uint32 packets_write_attempts_;
+ uint32_t packets_write_attempts_;
MockClock* clock_;
// If non-zero, the clock will pause during WritePacket for this amount of
// time.
@@ -3292,7 +3292,7 @@
// Now send a packet "Far enough" after the encrypter was set and verify that
// the forward-secure encrypter is now used.
- for (uint64 i = 0; i < 3 * congestion_window - 1; ++i) {
+ for (uint64_t i = 0; i < 3 * congestion_window - 1; ++i) {
EXPECT_EQ(0x02020202u, writer_->final_bytes_of_last_packet());
SendAckPacketToPeer();
}
@@ -3307,7 +3307,7 @@
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
use_tagging_decrypter();
- const uint8 tag = 0x07;
+ const uint8_t tag = 0x07;
framer_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(tag));
// Process an encrypted packet which can not yet be decrypted which should
@@ -3337,7 +3337,7 @@
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
use_tagging_decrypter();
- const uint8 tag = 0x07;
+ const uint8_t tag = 0x07;
framer_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(tag));
// Don't send packet 1 and buffer initially encrypted packets.
@@ -3374,7 +3374,7 @@
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
use_tagging_decrypter();
- const uint8 tag = 0x07;
+ const uint8_t tag = 0x07;
framer_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(tag));
// Process an encrypted packet which can not yet be decrypted which should
@@ -4288,7 +4288,7 @@
QuicTime ack_time = clock_.ApproximateNow().Add(DefaultDelayedAckTime());
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
- const uint8 tag = 0x07;
+ const uint8_t tag = 0x07;
connection_.SetDecrypter(ENCRYPTION_INITIAL, new StrictTaggingDecrypter(tag));
framer_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(tag));
// Process a packet from the non-crypto stream.
@@ -4324,7 +4324,7 @@
QuicTime::Delta::FromMilliseconds(kMinRttMs / 4));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
- const uint8 tag = 0x07;
+ const uint8_t tag = 0x07;
connection_.SetDecrypter(ENCRYPTION_INITIAL, new StrictTaggingDecrypter(tag));
framer_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(tag));
// Process a packet from the non-crypto stream.
diff --git a/net/quic/quic_crypto_client_stream.cc b/net/quic/quic_crypto_client_stream.cc
index 828d9c98..657ae14 100644
--- a/net/quic/quic_crypto_client_stream.cc
+++ b/net/quic/quic_crypto_client_stream.cc
@@ -388,12 +388,12 @@
return;
}
- const uint32* reject_reasons;
+ const uint32_t* reject_reasons;
size_t num_reject_reasons;
- static_assert(sizeof(QuicTag) == sizeof(uint32), "header out of sync");
+ static_assert(sizeof(QuicTag) == sizeof(uint32_t), "header out of sync");
if (in->GetTaglist(kRREJ, &reject_reasons, &num_reject_reasons) ==
QUIC_NO_ERROR) {
- uint32 packed_error = 0;
+ uint32_t packed_error = 0;
for (size_t i = 0; i < num_reject_reasons; ++i) {
// HANDSHAKE_OK is 0 and don't report that as error.
if (reject_reasons[i] == HANDSHAKE_OK || reject_reasons[i] >= 32) {
diff --git a/net/quic/quic_crypto_client_stream.h b/net/quic/quic_crypto_client_stream.h
index 634b281..01fd8d3 100644
--- a/net/quic/quic_crypto_client_stream.h
+++ b/net/quic/quic_crypto_client_stream.h
@@ -5,8 +5,11 @@
#ifndef NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_
#define NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_
+#include <stdint.h>
+
#include <string>
+#include "base/macros.h"
#include "net/quic/crypto/channel_id.h"
#include "net/quic/crypto/proof_verifier.h"
#include "net/quic/crypto/quic_crypto_client_config.h"
@@ -195,7 +198,7 @@
const QuicServerId server_id_;
// Generation counter from QuicCryptoClientConfig's CachedState.
- uint64 generation_counter_;
+ uint64_t generation_counter_;
// True if a channel ID was sent.
bool channel_id_sent_;
diff --git a/net/quic/quic_crypto_client_stream_test.cc b/net/quic/quic_crypto_client_stream_test.cc
index 7addbe1..3b6c66a 100644
--- a/net/quic/quic_crypto_client_stream_test.cc
+++ b/net/quic/quic_crypto_client_stream_test.cc
@@ -26,7 +26,7 @@
namespace {
const char kServerHostname[] = "test.example.com";
-const uint16 kServerPort = 443;
+const uint16_t kServerPort = 443;
class QuicCryptoClientStreamTest : public ::testing::Test {
public:
diff --git a/net/quic/quic_crypto_server_stream.cc b/net/quic/quic_crypto_server_stream.cc
index c11f1bb0c..f32802d 100644
--- a/net/quic/quic_crypto_server_stream.cc
+++ b/net/quic/quic_crypto_server_stream.cc
@@ -239,11 +239,11 @@
session()->connection()->OnHandshakeComplete();
}
-uint8 QuicCryptoServerStream::NumHandshakeMessages() const {
+uint8_t QuicCryptoServerStream::NumHandshakeMessages() const {
return num_handshake_messages_;
}
-uint8 QuicCryptoServerStream::NumHandshakeMessagesWithServerNonces() const {
+uint8_t QuicCryptoServerStream::NumHandshakeMessagesWithServerNonces() const {
return num_handshake_messages_with_server_nonces_;
}
@@ -286,7 +286,7 @@
scoped_ptr<crypto::SecureHash> hash(
crypto::SecureHash::Create(crypto::SecureHash::SHA256));
hash->Update(channel_id.data(), channel_id.size());
- uint8 digest[32];
+ uint8_t digest[32];
hash->Finish(digest, sizeof(digest));
base::Base64Encode(
diff --git a/net/quic/quic_crypto_server_stream.h b/net/quic/quic_crypto_server_stream.h
index b07cef40..e8e708a5 100644
--- a/net/quic/quic_crypto_server_stream.h
+++ b/net/quic/quic_crypto_server_stream.h
@@ -5,8 +5,11 @@
#ifndef NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_
#define NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_
+#include <stdint.h>
+
#include <string>
+#include "base/macros.h"
#include "net/quic/crypto/crypto_handshake.h"
#include "net/quic/crypto/quic_crypto_server_config.h"
#include "net/quic/proto/source_address_token.pb.h"
@@ -75,8 +78,8 @@
virtual void OnServerHelloAcked() = 0;
// These are all accessors and setters to their respective counters.
- virtual uint8 NumHandshakeMessages() const = 0;
- virtual uint8 NumHandshakeMessagesWithServerNonces() const = 0;
+ virtual uint8_t NumHandshakeMessages() const = 0;
+ virtual uint8_t NumHandshakeMessagesWithServerNonces() const = 0;
virtual bool UseStatelessRejectsIfPeerSupported() const = 0;
virtual bool PeerSupportsStatelessRejects() const = 0;
virtual void SetPeerSupportsStatelessRejects(bool set) = 0;
@@ -101,8 +104,8 @@
void SendServerConfigUpdate(
const CachedNetworkParameters* cached_network_params) override;
void OnServerHelloAcked() override;
- uint8 NumHandshakeMessages() const override;
- uint8 NumHandshakeMessagesWithServerNonces() const override;
+ uint8_t NumHandshakeMessages() const override;
+ uint8_t NumHandshakeMessagesWithServerNonces() const override;
int NumServerConfigUpdateMessagesSent() const override;
const CachedNetworkParameters* PreviousCachedNetworkParams() const override;
bool UseStatelessRejectsIfPeerSupported() const override;
@@ -174,12 +177,12 @@
ValidateCallback* validate_client_hello_cb_;
// Number of handshake messages received by this stream.
- uint8 num_handshake_messages_;
+ uint8_t num_handshake_messages_;
// Number of handshake messages received by this stream that contain
// server nonces (indicating that this is a non-zero-RTT handshake
// attempt).
- uint8 num_handshake_messages_with_server_nonces_;
+ uint8_t num_handshake_messages_with_server_nonces_;
// Number of server config update (SCUP) messages sent by this stream.
int num_server_config_update_messages_sent_;
diff --git a/net/quic/quic_crypto_server_stream_test.cc b/net/quic/quic_crypto_server_stream_test.cc
index 3358147..57f43bbf 100644
--- a/net/quic/quic_crypto_server_stream_test.cc
+++ b/net/quic/quic_crypto_server_stream_test.cc
@@ -62,7 +62,7 @@
namespace {
const char kServerHostname[] = "test.example.com";
-const uint16 kServerPort = 443;
+const uint16_t kServerPort = 443;
class QuicCryptoServerStreamTest : public ::testing::TestWithParam<bool> {
public:
@@ -84,10 +84,10 @@
QuicCryptoServerConfigPeer::GetPrimaryOrbit(server_crypto_config_);
strike_register_client_ = new DelayedVerifyStrikeRegisterClient(
10000, // strike_register_max_entries
- static_cast<uint32>(
+ static_cast<uint32_t>(
server_connection_->clock()->WallNow().ToUNIXSeconds()),
60, // strike_register_window_secs
- reinterpret_cast<const uint8*>(orbit.data()),
+ reinterpret_cast<const uint8_t*>(orbit.data()),
StrikeRegister::NO_STARTUP_PERIOD_NEEDED);
strike_register_client_->StartDelayingVerification();
server_crypto_config_.SetStrikeRegisterClient(strike_register_client_);
diff --git a/net/quic/quic_crypto_stream.h b/net/quic/quic_crypto_stream.h
index de88dc2..e794cb8 100644
--- a/net/quic/quic_crypto_stream.h
+++ b/net/quic/quic_crypto_stream.h
@@ -5,7 +5,9 @@
#ifndef NET_QUIC_QUIC_CRYPTO_STREAM_H_
#define NET_QUIC_QUIC_CRYPTO_STREAM_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/crypto/crypto_framer.h"
#include "net/quic/crypto/crypto_utils.h"
#include "net/quic/quic_config.h"
diff --git a/net/quic/quic_crypto_stream_test.cc b/net/quic/quic_crypto_stream_test.cc
index afc83c4..8c7d181 100644
--- a/net/quic/quic_crypto_stream_test.cc
+++ b/net/quic/quic_crypto_stream_test.cc
@@ -7,6 +7,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/quic/crypto/crypto_handshake.h"
#include "net/quic/crypto/crypto_protocol.h"
@@ -88,9 +89,9 @@
TEST_F(QuicCryptoStreamTest, ProcessBadData) {
string bad(message_data_->data(), message_data_->length());
- const int kFirstTagIndex = sizeof(uint32) + // message tag
- sizeof(uint16) + // number of tag-value pairs
- sizeof(uint16); // padding
+ const int kFirstTagIndex = sizeof(uint32_t) + // message tag
+ sizeof(uint16_t) + // number of tag-value pairs
+ sizeof(uint16_t); // padding
EXPECT_EQ(1, bad[kFirstTagIndex]);
bad[kFirstTagIndex] = 0x7F; // out of order tag
diff --git a/net/quic/quic_data_reader.cc b/net/quic/quic_data_reader.cc
index 5433283..191263b 100644
--- a/net/quic/quic_data_reader.cc
+++ b/net/quic/quic_data_reader.cc
@@ -14,20 +14,20 @@
QuicDataReader::QuicDataReader(const char* data, const size_t len)
: data_(data), len_(len), pos_(0) {}
-bool QuicDataReader::ReadUInt16(uint16* result) {
+bool QuicDataReader::ReadUInt16(uint16_t* result) {
return ReadBytes(result, sizeof(*result));
}
-bool QuicDataReader::ReadUInt32(uint32* result) {
+bool QuicDataReader::ReadUInt32(uint32_t* result) {
return ReadBytes(result, sizeof(*result));
}
-bool QuicDataReader::ReadUInt64(uint64* result) {
+bool QuicDataReader::ReadUInt64(uint64_t* result) {
return ReadBytes(result, sizeof(*result));
}
-bool QuicDataReader::ReadUFloat16(uint64* result) {
- uint16 value;
+bool QuicDataReader::ReadUFloat16(uint64_t* result) {
+ uint16_t value;
if (!ReadUInt16(&value)) {
return false;
}
@@ -41,7 +41,8 @@
return true;
}
- uint16 exponent = value >> kUFloat16MantissaBits; // No sign extend on uint!
+ uint16_t exponent =
+ value >> kUFloat16MantissaBits; // No sign extend on uint!
// After the fast pass, the exponent is at least one (offset by one).
// Un-offset the exponent.
--exponent;
@@ -59,7 +60,7 @@
bool QuicDataReader::ReadStringPiece16(StringPiece* result) {
// Read resultant length.
- uint16 result_len;
+ uint16_t result_len;
if (!ReadUInt16(&result_len)) {
// OnFailure() already called.
return false;
diff --git a/net/quic/quic_data_reader.h b/net/quic/quic_data_reader.h
index 5e05fcd..970e5b2 100644
--- a/net/quic/quic_data_reader.h
+++ b/net/quic/quic_data_reader.h
@@ -5,9 +5,12 @@
#ifndef NET_QUIC_QUIC_DATA_READER_H_
#define NET_QUIC_QUIC_DATA_READER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <cstddef>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/int128.h"
#include "net/base/net_export.h"
@@ -39,22 +42,22 @@
// Reads a 16-bit unsigned integer into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadUInt16(uint16* result);
+ bool ReadUInt16(uint16_t* result);
// Reads a 32-bit unsigned integer into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadUInt32(uint32* result);
+ bool ReadUInt32(uint32_t* result);
// Reads a 64-bit unsigned integer into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadUInt64(uint64* result);
+ bool ReadUInt64(uint64_t* result);
// Reads a 16-bit unsigned float into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadUFloat16(uint64* result);
+ bool ReadUFloat16(uint64_t* result);
// Reads a string prefixed with 16-bit length into the given output parameter.
//
diff --git a/net/quic/quic_data_writer.cc b/net/quic/quic_data_writer.cc
index 96ae213..81cc712 100644
--- a/net/quic/quic_data_writer.cc
+++ b/net/quic/quic_data_writer.cc
@@ -22,44 +22,44 @@
return buffer_;
}
-bool QuicDataWriter::WriteUInt8(uint8 value) {
+bool QuicDataWriter::WriteUInt8(uint8_t value) {
return WriteBytes(&value, sizeof(value));
}
-bool QuicDataWriter::WriteUInt16(uint16 value) {
+bool QuicDataWriter::WriteUInt16(uint16_t value) {
return WriteBytes(&value, sizeof(value));
}
-bool QuicDataWriter::WriteUInt32(uint32 value) {
+bool QuicDataWriter::WriteUInt32(uint32_t value) {
return WriteBytes(&value, sizeof(value));
}
-bool QuicDataWriter::WriteUInt48(uint64 value) {
- uint16 hi = static_cast<uint16>(value >> 32);
- uint32 lo = static_cast<uint32>(value);
+bool QuicDataWriter::WriteUInt48(uint64_t value) {
+ uint16_t hi = static_cast<uint16_t>(value >> 32);
+ uint32_t lo = static_cast<uint32_t>(value);
return WriteUInt32(lo) && WriteUInt16(hi);
}
-bool QuicDataWriter::WriteUInt64(uint64 value) {
+bool QuicDataWriter::WriteUInt64(uint64_t value) {
return WriteBytes(&value, sizeof(value));
}
-bool QuicDataWriter::WriteUFloat16(uint64 value) {
- uint16 result;
+bool QuicDataWriter::WriteUFloat16(uint64_t value) {
+ uint16_t result;
if (value < (UINT64_C(1) << kUFloat16MantissaEffectiveBits)) {
// Fast path: either the value is denormalized, or has exponent zero.
// Both cases are represented by the value itself.
- result = static_cast<uint16>(value);
+ result = static_cast<uint16_t>(value);
} else if (value >= kUFloat16MaxValue) {
// Value is out of range; clamp it to the maximum representable.
- result = numeric_limits<uint16>::max();
+ result = numeric_limits<uint16_t>::max();
} else {
// The highest bit is between position 13 and 42 (zero-based), which
// corresponds to exponent 1-30. In the output, mantissa is from 0 to 10,
// hidden bit is 11 and exponent is 11 to 15. Shift the highest bit to 11
// and count the shifts.
- uint16 exponent = 0;
- for (uint16 offset = 16; offset > 0; offset /= 2) {
+ uint16_t exponent = 0;
+ for (uint16_t offset = 16; offset > 0; offset /= 2) {
// Right-shift the value until the highest bit is in position 11.
// For offset of 16, 8, 4, 2 and 1 (binary search over 1-30),
// shift if the bit is at or above 11 + offset.
@@ -77,17 +77,17 @@
// Hidden bit (position 11) is set. We should remove it and increment the
// exponent. Equivalently, we just add it to the exponent.
// This hides the bit.
- result = static_cast<uint16>(value + (exponent << kUFloat16MantissaBits));
+ result = static_cast<uint16_t>(value + (exponent << kUFloat16MantissaBits));
}
return WriteBytes(&result, sizeof(result));
}
bool QuicDataWriter::WriteStringPiece16(StringPiece val) {
- if (val.size() > numeric_limits<uint16>::max()) {
+ if (val.size() > numeric_limits<uint16_t>::max()) {
return false;
}
- if (!WriteUInt16(static_cast<uint16>(val.size()))) {
+ if (!WriteUInt16(static_cast<uint16_t>(val.size()))) {
return false;
}
return WriteBytes(val.data(), val.size());
@@ -103,7 +103,7 @@
}
#ifdef ARCH_CPU_64_BITS
- DCHECK_LE(length, std::numeric_limits<uint32>::max());
+ DCHECK_LE(length, std::numeric_limits<uint32_t>::max());
#endif
return buffer_ + length_;
@@ -121,7 +121,7 @@
return true;
}
-bool QuicDataWriter::WriteRepeatedByte(uint8 byte, size_t count) {
+bool QuicDataWriter::WriteRepeatedByte(uint8_t byte, size_t count) {
char* dest = BeginWrite(count);
if (!dest) {
return false;
diff --git a/net/quic/quic_data_writer.h b/net/quic/quic_data_writer.h
index b6e16674..dfe0fda 100644
--- a/net/quic/quic_data_writer.h
+++ b/net/quic/quic_data_writer.h
@@ -5,11 +5,14 @@
#ifndef NET_QUIC_QUIC_DATA_WRITER_H_
#define NET_QUIC_QUIC_DATA_WRITER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <cstddef>
#include <string>
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/int128.h"
#include "net/base/net_export.h"
@@ -38,18 +41,18 @@
// Methods for adding to the payload. These values are appended to the end
// of the QuicDataWriter payload. Note - binary integers are written in
// host byte order (little endian) not network byte order (big endian).
- bool WriteUInt8(uint8 value);
- bool WriteUInt16(uint16 value);
- bool WriteUInt32(uint32 value);
- bool WriteUInt48(uint64 value);
- bool WriteUInt64(uint64 value);
+ bool WriteUInt8(uint8_t value);
+ bool WriteUInt16(uint16_t value);
+ bool WriteUInt32(uint32_t value);
+ bool WriteUInt48(uint64_t value);
+ bool WriteUInt64(uint64_t value);
// Write unsigned floating point corresponding to the value. Large values are
// clamped to the maximum representable (kUFloat16MaxValue). Values that can
// not be represented directly are rounded down.
- bool WriteUFloat16(uint64 value);
+ bool WriteUFloat16(uint64_t value);
bool WriteStringPiece16(base::StringPiece val);
bool WriteBytes(const void* data, size_t data_len);
- bool WriteRepeatedByte(uint8 byte, size_t count);
+ bool WriteRepeatedByte(uint8_t byte, size_t count);
// Fills the remaining buffer with null characters.
void WritePadding();
diff --git a/net/quic/quic_data_writer_test.cc b/net/quic/quic_data_writer_test.cc
index f4be7a7..b3d6e77 100644
--- a/net/quic/quic_data_writer_test.cc
+++ b/net/quic/quic_data_writer_test.cc
@@ -26,8 +26,8 @@
TEST(QuicDataWriterTest, WriteUFloat16) {
struct TestCase {
- uint64 decoded;
- uint16 encoded;
+ uint64_t decoded;
+ uint16_t encoded;
};
TestCase test_cases[] = {
// Small numbers represent themselves.
@@ -98,14 +98,15 @@
char buffer[2];
QuicDataWriter writer(2, buffer);
EXPECT_TRUE(writer.WriteUFloat16(test_cases[i].decoded));
- EXPECT_EQ(test_cases[i].encoded, *reinterpret_cast<uint16*>(writer.data()));
+ EXPECT_EQ(test_cases[i].encoded,
+ *reinterpret_cast<uint16_t*>(writer.data()));
}
}
TEST(QuicDataWriterTest, ReadUFloat16) {
struct TestCase {
- uint64 decoded;
- uint16 encoded;
+ uint64_t decoded;
+ uint16_t encoded;
};
TestCase test_cases[] = {
// There are fewer decoding test cases because encoding truncates, and
@@ -156,7 +157,7 @@
for (int i = 0; i < num_test_cases; ++i) {
QuicDataReader reader(reinterpret_cast<char*>(&test_cases[i].encoded), 2);
- uint64 value;
+ uint64_t value;
EXPECT_TRUE(reader.ReadUFloat16(&value));
EXPECT_EQ(test_cases[i].decoded, value);
}
@@ -164,11 +165,11 @@
TEST(QuicDataWriterTest, RoundTripUFloat16) {
// Just test all 16-bit encoded values. 0 and max already tested above.
- uint64 previous_value = 0;
- for (uint16 i = 1; i < 0xFFFF; ++i) {
+ uint64_t previous_value = 0;
+ for (uint16_t i = 1; i < 0xFFFF; ++i) {
// Read the two bytes.
QuicDataReader reader(reinterpret_cast<char*>(&i), 2);
- uint64 value;
+ uint64_t value;
// All values must be decodable.
EXPECT_TRUE(reader.ReadUFloat16(&value));
// Check that small numbers represent themselves
@@ -188,12 +189,12 @@
EXPECT_TRUE(writer.WriteUFloat16(value));
EXPECT_TRUE(writer.WriteUFloat16(value + 1));
// Check minimal decoding (previous decoding has previous encoding).
- EXPECT_EQ(i - 1, *reinterpret_cast<uint16*>(writer.data()));
+ EXPECT_EQ(i - 1, *reinterpret_cast<uint16_t*>(writer.data()));
// Check roundtrip.
- EXPECT_EQ(i, *reinterpret_cast<uint16*>(writer.data() + 2));
+ EXPECT_EQ(i, *reinterpret_cast<uint16_t*>(writer.data() + 2));
// Check next decoding.
EXPECT_EQ(i < 4096 ? i + 1 : i,
- *reinterpret_cast<uint16*>(writer.data() + 4));
+ *reinterpret_cast<uint16_t*>(writer.data() + 4));
}
}
diff --git a/net/quic/quic_default_packet_writer.h b/net/quic/quic_default_packet_writer.h
index 2b58ade..7d03a04 100644
--- a/net/quic/quic_default_packet_writer.h
+++ b/net/quic/quic_default_packet_writer.h
@@ -5,7 +5,9 @@
#ifndef NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
#define NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/quic_connection.h"
diff --git a/net/quic/quic_end_to_end_unittest.cc b/net/quic/quic_end_to_end_unittest.cc
index e7145c6..6e631e4a 100644
--- a/net/quic/quic_end_to_end_unittest.cc
+++ b/net/quic/quic_end_to_end_unittest.cc
@@ -4,7 +4,6 @@
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
diff --git a/net/quic/quic_fec_group.cc b/net/quic/quic_fec_group.cc
index 37c3e5a..b6ff374 100644
--- a/net/quic/quic_fec_group.cc
+++ b/net/quic/quic_fec_group.cc
@@ -6,7 +6,6 @@
#include <limits>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/stl_util.h"
diff --git a/net/quic/quic_fec_group.h b/net/quic/quic_fec_group.h
index c35835ca..fe1471c 100644
--- a/net/quic/quic_fec_group.h
+++ b/net/quic/quic_fec_group.h
@@ -11,6 +11,7 @@
#include <cstddef>
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/quic/quic_fec_group_interface.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/quic_fec_group_interface.cc b/net/quic/quic_fec_group_interface.cc
index 65224b08..9422f1a4 100644
--- a/net/quic/quic_fec_group_interface.cc
+++ b/net/quic/quic_fec_group_interface.cc
@@ -6,7 +6,6 @@
#include <limits>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/stl_util.h"
diff --git a/net/quic/quic_fec_group_interface.h b/net/quic/quic_fec_group_interface.h
index 87914f7..3f287a7 100644
--- a/net/quic/quic_fec_group_interface.h
+++ b/net/quic/quic_fec_group_interface.h
@@ -9,7 +9,9 @@
#ifndef NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_
#define NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/quic_fec_group_test.cc b/net/quic/quic_fec_group_test.cc
index 9778302e..5f5358d 100644
--- a/net/quic/quic_fec_group_test.cc
+++ b/net/quic/quic_fec_group_test.cc
@@ -7,7 +7,6 @@
#include <algorithm>
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -54,7 +53,7 @@
// XOR in the packets.
for (size_t packet = 1; packet <= num_packets; ++packet) {
for (size_t i = 0; i < kDataMaxLen; i++) {
- uint8 byte = i > strlen(kData[packet]) ? 0x00 : kData[packet][i];
+ uint8_t byte = i > strlen(kData[packet]) ? 0x00 : kData[packet][i];
redundancy[i] = redundancy[i] ^ byte;
}
}
diff --git a/net/quic/quic_flags.cc b/net/quic/quic_flags.cc
index 39296bbd..dc642a43 100644
--- a/net/quic/quic_flags.cc
+++ b/net/quic/quic_flags.cc
@@ -25,7 +25,7 @@
// Time period for which a given connection_id should live in the time-wait
// state.
-int64 FLAGS_quic_time_wait_list_seconds = 200;
+int64_t FLAGS_quic_time_wait_list_seconds = 200;
// Currently, this number is quite conservative. The max QPS limit for an
// individual server silo is currently set to 1000 qps, though the actual max
@@ -36,7 +36,7 @@
//
// Maximum number of connections on the time-wait list. A negative value implies
// no configured limit.
-int64 FLAGS_quic_time_wait_list_max_connections = 600000;
+int64_t FLAGS_quic_time_wait_list_max_connections = 600000;
// Enables server-side support for QUIC stateless rejects.
bool FLAGS_enable_quic_stateless_reject_support = true;
diff --git a/net/quic/quic_flags.h b/net/quic/quic_flags.h
index be172a18..8ef0b8b 100644
--- a/net/quic/quic_flags.h
+++ b/net/quic/quic_flags.h
@@ -5,7 +5,8 @@
#ifndef NET_QUIC_QUIC_FLAGS_H_
#define NET_QUIC_QUIC_FLAGS_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "net/base/net_export.h"
NET_EXPORT_PRIVATE extern bool FLAGS_quic_use_time_loss_detection;
@@ -13,8 +14,8 @@
NET_EXPORT_PRIVATE extern bool FLAGS_enable_quic_fec;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_use_bbr_congestion_control;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_allow_bbr;
-NET_EXPORT_PRIVATE extern int64 FLAGS_quic_time_wait_list_seconds;
-NET_EXPORT_PRIVATE extern int64 FLAGS_quic_time_wait_list_max_connections;
+NET_EXPORT_PRIVATE extern int64_t FLAGS_quic_time_wait_list_seconds;
+NET_EXPORT_PRIVATE extern int64_t FLAGS_quic_time_wait_list_max_connections;
NET_EXPORT_PRIVATE extern bool FLAGS_enable_quic_stateless_reject_support;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_ack_decimation;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_auto_tune_receive_window;
diff --git a/net/quic/quic_flow_controller.cc b/net/quic/quic_flow_controller.cc
index 795f2ce..963d2e9 100644
--- a/net/quic/quic_flow_controller.cc
+++ b/net/quic/quic_flow_controller.cc
@@ -4,7 +4,6 @@
#include "net/quic/quic_flow_controller.h"
-#include "base/basictypes.h"
#include "net/quic/quic_connection.h"
#include "net/quic/quic_flags.h"
#include "net/quic/quic_protocol.h"
@@ -228,7 +227,7 @@
return SendWindowSize() == 0;
}
-uint64 QuicFlowController::SendWindowSize() const {
+uint64_t QuicFlowController::SendWindowSize() const {
if (bytes_sent_ > send_window_offset_) {
return 0;
}
diff --git a/net/quic/quic_flow_controller.h b/net/quic/quic_flow_controller.h
index 6a640df..62ae5b6 100644
--- a/net/quic/quic_flow_controller.h
+++ b/net/quic/quic_flow_controller.h
@@ -5,7 +5,7 @@
#ifndef NET_QUIC_QUIC_FLOW_CONTROLLER_H_
#define NET_QUIC_QUIC_FLOW_CONTROLLER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/quic_flow_controller_test.cc b/net/quic/quic_flow_controller_test.cc
index 71bfa1bf..474d182 100644
--- a/net/quic/quic_flow_controller_test.cc
+++ b/net/quic/quic_flow_controller_test.cc
@@ -19,7 +19,7 @@
namespace test {
// Receive window auto-tuning uses RTT in its logic.
-const int64 kRtt = 100;
+const int64_t kRtt = 100;
class QuicFlowControllerTest : public ::testing::Test {
public:
diff --git a/net/quic/quic_frame_list.h b/net/quic/quic_frame_list.h
index 9aad82e..a623597 100644
--- a/net/quic/quic_frame_list.h
+++ b/net/quic/quic_frame_list.h
@@ -5,6 +5,8 @@
#ifndef NET_QUIC_QUIC_FRAME_LIST_H_
#define NET_QUIC_QUIC_FRAME_LIST_H_
+#include <stddef.h>
+
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_stream_sequencer_buffer_interface.h"
diff --git a/net/quic/quic_framer.cc b/net/quic/quic_framer.cc
index e22b9a0..f78278b8 100644
--- a/net/quic/quic_framer.cc
+++ b/net/quic/quic_framer.cc
@@ -6,7 +6,6 @@
#include <stdint.h>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/stl_util.h"
@@ -43,7 +42,7 @@
// Number of bits the packet number length bits are shifted from the right
// edge of the public header.
-const uint8 kPublicHeaderSequenceNumberShift = 4;
+const uint8_t kPublicHeaderSequenceNumberShift = 4;
// New Frame Types, QUIC v. >= 10:
// There are two interpretations for the Frame Type byte in the QUIC protocol,
@@ -67,36 +66,36 @@
// Masks to determine if the frame type is a special use
// and for specific special frame types.
-const uint8 kQuicFrameTypeSpecialMask = 0xE0; // 0b 11100000
-const uint8 kQuicFrameTypeStreamMask = 0x80;
-const uint8 kQuicFrameTypeAckMask = 0x40;
+const uint8_t kQuicFrameTypeSpecialMask = 0xE0; // 0b 11100000
+const uint8_t kQuicFrameTypeStreamMask = 0x80;
+const uint8_t kQuicFrameTypeAckMask = 0x40;
// Stream frame relative shifts and masks for interpreting the stream flags.
// StreamID may be 1, 2, 3, or 4 bytes.
-const uint8 kQuicStreamIdShift = 2;
-const uint8 kQuicStreamIDLengthMask = 0x03;
+const uint8_t kQuicStreamIdShift = 2;
+const uint8_t kQuicStreamIDLengthMask = 0x03;
// Offset may be 0, 2, 3, 4, 5, 6, 7, 8 bytes.
-const uint8 kQuicStreamOffsetShift = 3;
-const uint8 kQuicStreamOffsetMask = 0x07;
+const uint8_t kQuicStreamOffsetShift = 3;
+const uint8_t kQuicStreamOffsetMask = 0x07;
// Data length may be 0 or 2 bytes.
-const uint8 kQuicStreamDataLengthShift = 1;
-const uint8 kQuicStreamDataLengthMask = 0x01;
+const uint8_t kQuicStreamDataLengthShift = 1;
+const uint8_t kQuicStreamDataLengthMask = 0x01;
// Fin bit may be set or not.
-const uint8 kQuicStreamFinShift = 1;
-const uint8 kQuicStreamFinMask = 0x01;
+const uint8_t kQuicStreamFinShift = 1;
+const uint8_t kQuicStreamFinMask = 0x01;
// packet number size shift used in AckFrames.
-const uint8 kQuicSequenceNumberLengthShift = 2;
+const uint8_t kQuicSequenceNumberLengthShift = 2;
// Acks may be truncated.
-const uint8 kQuicAckTruncatedShift = 1;
-const uint8 kQuicAckTruncatedMask = 0x01;
+const uint8_t kQuicAckTruncatedShift = 1;
+const uint8_t kQuicAckTruncatedMask = 0x01;
// Acks may not have any nacks.
-const uint8 kQuicHasNacksMask = 0x01;
+const uint8_t kQuicHasNacksMask = 0x01;
// Returns the absolute value of the difference between |a| and |b|.
QuicPacketNumber Delta(QuicPacketNumber a, QuicPacketNumber b) {
@@ -113,7 +112,7 @@
return (Delta(target, a) < Delta(target, b)) ? a : b;
}
-QuicPacketNumberLength ReadSequenceNumberLength(uint8 flags) {
+QuicPacketNumberLength ReadSequenceNumberLength(uint8_t flags) {
switch (flags & PACKET_FLAGS_6BYTE_PACKET) {
case PACKET_FLAGS_6BYTE_PACKET:
return PACKET_6BYTE_PACKET_NUMBER;
@@ -458,8 +457,8 @@
scoped_ptr<char[]> buffer(new char[len]);
QuicDataWriter writer(len, buffer.get());
- uint8 flags = static_cast<uint8>(PACKET_PUBLIC_FLAGS_RST |
- PACKET_PUBLIC_FLAGS_8BYTE_CONNECTION_ID);
+ uint8_t flags = static_cast<uint8_t>(PACKET_PUBLIC_FLAGS_RST |
+ PACKET_PUBLIC_FLAGS_8BYTE_CONNECTION_ID);
if (!writer.WriteUInt8(flags)) {
return nullptr;
}
@@ -484,8 +483,8 @@
scoped_ptr<char[]> buffer(new char[len]);
QuicDataWriter writer(len, buffer.get());
- uint8 flags = static_cast<uint8>(PACKET_PUBLIC_FLAGS_VERSION |
- PACKET_PUBLIC_FLAGS_8BYTE_CONNECTION_ID);
+ uint8_t flags = static_cast<uint8_t>(PACKET_PUBLIC_FLAGS_VERSION |
+ PACKET_PUBLIC_FLAGS_8BYTE_CONNECTION_ID);
if (!writer.WriteUInt8(flags)) {
return nullptr;
}
@@ -696,7 +695,7 @@
QuicDataWriter* writer) {
DVLOG(1) << "Appending header: " << header;
DCHECK(header.fec_group > 0 || header.is_in_fec_group == NOT_IN_FEC_GROUP);
- uint8 public_flags = 0;
+ uint8_t public_flags = 0;
if (header.public_header.reset_flag) {
public_flags |= PACKET_PUBLIC_FLAGS_RST;
}
@@ -768,7 +767,7 @@
return false;
}
- uint8 private_flags = 0;
+ uint8_t private_flags = 0;
if (header.entropy_flag) {
private_flags |= PACKET_PRIVATE_FLAGS_ENTROPY;
}
@@ -789,8 +788,8 @@
DCHECK_LT(header.packet_number - header.fec_group, 255u);
// Offset from the current packet number to the first fec
// protected packet.
- uint8 first_fec_protected_packet_offset =
- static_cast<uint8>(header.packet_number - header.fec_group);
+ uint8_t first_fec_protected_packet_offset =
+ static_cast<uint8_t>(header.packet_number - header.fec_group);
if (!writer->WriteBytes(&first_fec_protected_packet_offset, 1)) {
return false;
}
@@ -800,7 +799,7 @@
}
const QuicTime::Delta QuicFramer::CalculateTimestampFromWire(
- uint32 time_delta_us) {
+ uint32_t time_delta_us) {
// The new time_delta might have wrapped to the next epoch, or it
// might have reverse wrapped to the previous epoch, or it might
// remain in the same epoch. Select the time closest to the previous
@@ -808,13 +807,13 @@
//
// epoch_delta is the delta between epochs. A delta is 4 bytes of
// microseconds.
- const uint64 epoch_delta = UINT64_C(1) << 32;
- uint64 epoch = last_timestamp_.ToMicroseconds() & ~(epoch_delta - 1);
+ const uint64_t epoch_delta = UINT64_C(1) << 32;
+ uint64_t epoch = last_timestamp_.ToMicroseconds() & ~(epoch_delta - 1);
// Wrapping is safe here because a wrapped value will not be ClosestTo below.
- uint64 prev_epoch = epoch - epoch_delta;
- uint64 next_epoch = epoch + epoch_delta;
+ uint64_t prev_epoch = epoch - epoch_delta;
+ uint64_t next_epoch = epoch + epoch_delta;
- uint64 time = ClosestTo(
+ uint64_t time = ClosestTo(
last_timestamp_.ToMicroseconds(), epoch + time_delta_us,
ClosestTo(last_timestamp_.ToMicroseconds(), prev_epoch + time_delta_us,
next_epoch + time_delta_us));
@@ -847,7 +846,7 @@
bool QuicFramer::ProcessPublicHeader(QuicDataReader* reader,
QuicPacketPublicHeader* public_header) {
- uint8 public_flags;
+ uint8_t public_flags;
if (!reader->ReadBytes(&public_flags, 1)) {
set_detailed_error("Unable to read public flags.");
return false;
@@ -960,7 +959,7 @@
}
// static
-uint8 QuicFramer::GetSequenceNumberFlags(
+uint8_t QuicFramer::GetSequenceNumberFlags(
QuicPacketNumberLength packet_number_length) {
switch (packet_number_length) {
case PACKET_1BYTE_PACKET_NUMBER:
@@ -992,12 +991,12 @@
QuicPacketNumber last_missing = *iter;
++iter;
for (; iter != frame.missing_packets.end(); ++iter) {
- if (cur_range_length < numeric_limits<uint8>::max() &&
+ if (cur_range_length < numeric_limits<uint8_t>::max() &&
*iter == (last_missing + 1)) {
++cur_range_length;
} else {
ack_info.nack_ranges[last_missing - cur_range_length] =
- static_cast<uint8>(cur_range_length);
+ static_cast<uint8_t>(cur_range_length);
cur_range_length = 0;
}
ack_info.max_delta = max(ack_info.max_delta, *iter - last_missing);
@@ -1005,7 +1004,7 @@
}
// Include the last nack range.
ack_info.nack_ranges[last_missing - cur_range_length] =
- static_cast<uint8>(cur_range_length);
+ static_cast<uint8_t>(cur_range_length);
// Include the range to the largest observed.
ack_info.max_delta =
max(ack_info.max_delta, frame.largest_observed - last_missing);
@@ -1040,7 +1039,7 @@
bool QuicFramer::ProcessAuthenticatedHeader(QuicDataReader* reader,
QuicPacketHeader* header) {
- uint8 private_flags;
+ uint8_t private_flags;
if (!reader->ReadBytes(&private_flags, 1)) {
set_detailed_error("Unable to read private flags.");
return RaiseError(QUIC_INVALID_PACKET_HEADER);
@@ -1056,7 +1055,7 @@
if ((private_flags & PACKET_PRIVATE_FLAGS_FEC_GROUP) != 0) {
header->is_in_fec_group = IN_FEC_GROUP;
- uint8 first_fec_protected_packet_offset;
+ uint8_t first_fec_protected_packet_offset;
if (!reader->ReadBytes(&first_fec_protected_packet_offset, 1)) {
set_detailed_error("Unable to read first fec protected packet offset.");
return RaiseError(QUIC_INVALID_PACKET_HEADER);
@@ -1109,7 +1108,7 @@
return RaiseError(QUIC_MISSING_PAYLOAD);
}
while (!reader->IsDoneReading()) {
- uint8 frame_type;
+ uint8_t frame_type;
if (!reader->ReadBytes(&frame_type, 1)) {
set_detailed_error("Unable to read frame type.");
return RaiseError(QUIC_INVALID_FRAME_DATA);
@@ -1256,17 +1255,17 @@
}
bool QuicFramer::ProcessStreamFrame(QuicDataReader* reader,
- uint8 frame_type,
+ uint8_t frame_type,
QuicStreamFrame* frame) {
- uint8 stream_flags = frame_type;
+ uint8_t stream_flags = frame_type;
stream_flags &= ~kQuicFrameTypeStreamMask;
// Read from right to left: StreamID, Offset, Data Length, Fin.
- const uint8 stream_id_length = (stream_flags & kQuicStreamIDLengthMask) + 1;
+ const uint8_t stream_id_length = (stream_flags & kQuicStreamIDLengthMask) + 1;
stream_flags >>= kQuicStreamIdShift;
- uint8 offset_length = (stream_flags & kQuicStreamOffsetMask);
+ uint8_t offset_length = (stream_flags & kQuicStreamOffsetMask);
// There is no encoding for 1 byte, only 0 and 2 through 8.
if (offset_length > 0) {
offset_length += 1;
@@ -1305,13 +1304,13 @@
}
}
frame->frame_buffer = data.data();
- frame->frame_length = static_cast<uint16>(data.length());
+ frame->frame_length = static_cast<uint16_t>(data.length());
return true;
}
bool QuicFramer::ProcessAckFrame(QuicDataReader* reader,
- uint8 frame_type,
+ uint8_t frame_type,
QuicAckFrame* ack_frame) {
// Determine the three lengths from the frame type: largest observed length,
// missing packet number length, and missing range length.
@@ -1336,7 +1335,7 @@
return false;
}
- uint64 delta_time_largest_observed_us;
+ uint64_t delta_time_largest_observed_us;
if (!reader->ReadUFloat16(&delta_time_largest_observed_us)) {
set_detailed_error("Unable to read delta time largest observed.");
return false;
@@ -1357,7 +1356,7 @@
return true;
}
- uint8 num_missing_ranges;
+ uint8_t num_missing_ranges;
if (!reader->ReadBytes(&num_missing_ranges, 1)) {
set_detailed_error("Unable to read num missing packet ranges.");
return false;
@@ -1386,7 +1385,7 @@
// Parse the revived packets list.
// TODO(ianswett): Change the ack frame so it only expresses one revived.
- uint8 num_revived_packets;
+ uint8_t num_revived_packets;
if (!reader->ReadBytes(&num_revived_packets, 1)) {
set_detailed_error("Unable to read num revived packets.");
return false;
@@ -1410,14 +1409,14 @@
if (ack_frame->is_truncated) {
return true;
}
- uint8 num_received_packets;
+ uint8_t num_received_packets;
if (!reader->ReadBytes(&num_received_packets, 1)) {
set_detailed_error("Unable to read num received packets.");
return false;
}
if (num_received_packets > 0) {
- uint8 delta_from_largest_observed;
+ uint8_t delta_from_largest_observed;
if (!reader->ReadBytes(&delta_from_largest_observed,
PACKET_1BYTE_PACKET_NUMBER)) {
set_detailed_error("Unable to read sequence delta in received packets.");
@@ -1427,7 +1426,7 @@
ack_frame->largest_observed - delta_from_largest_observed;
// Time delta from the framer creation.
- uint32 time_delta_us;
+ uint32_t time_delta_us;
if (!reader->ReadBytes(&time_delta_us, sizeof(time_delta_us))) {
set_detailed_error("Unable to read time delta in received packets.");
return false;
@@ -1439,7 +1438,7 @@
ack_frame->received_packet_times.push_back(
std::make_pair(seq_num, creation_time_.Add(last_timestamp_)));
- for (uint8 i = 1; i < num_received_packets; ++i) {
+ for (uint8_t i = 1; i < num_received_packets; ++i) {
if (!reader->ReadBytes(&delta_from_largest_observed,
PACKET_1BYTE_PACKET_NUMBER)) {
set_detailed_error(
@@ -1449,7 +1448,7 @@
seq_num = ack_frame->largest_observed - delta_from_largest_observed;
// Time delta from the previous timestamp.
- uint64 incremental_time_delta_us;
+ uint64_t incremental_time_delta_us;
if (!reader->ReadUFloat16(&incremental_time_delta_us)) {
set_detailed_error(
"Unable to read incremental time delta in received packets.");
@@ -1497,7 +1496,7 @@
return false;
}
- uint32 error_code;
+ uint32_t error_code;
if (!reader->ReadUInt32(&error_code)) {
set_detailed_error("Unable to read rst stream error code.");
return false;
@@ -1514,7 +1513,7 @@
bool QuicFramer::ProcessConnectionCloseFrame(QuicDataReader* reader,
QuicConnectionCloseFrame* frame) {
- uint32 error_code;
+ uint32_t error_code;
if (!reader->ReadUInt32(&error_code)) {
set_detailed_error("Unable to read connection close error code.");
return false;
@@ -1539,7 +1538,7 @@
bool QuicFramer::ProcessGoAwayFrame(QuicDataReader* reader,
QuicGoAwayFrame* frame) {
- uint32 error_code;
+ uint32_t error_code;
if (!reader->ReadUInt32(&error_code)) {
set_detailed_error("Unable to read go away error code.");
return false;
@@ -1551,7 +1550,7 @@
return false;
}
- uint32 stream_id;
+ uint32_t stream_id;
if (!reader->ReadUInt32(&stream_id)) {
set_detailed_error("Unable to read last good stream id.");
return false;
@@ -1810,7 +1809,7 @@
bool QuicFramer::AppendTypeByte(const QuicFrame& frame,
bool no_stream_frame_length,
QuicDataWriter* writer) {
- uint8 type_byte = 0;
+ uint8_t type_byte = 0;
switch (frame.type) {
case STREAM_FRAME: {
if (frame.stream_frame == nullptr) {
@@ -1839,10 +1838,10 @@
case ACK_FRAME:
return true;
case MTU_DISCOVERY_FRAME:
- type_byte = static_cast<uint8>(PING_FRAME);
+ type_byte = static_cast<uint8_t>(PING_FRAME);
break;
default:
- type_byte = static_cast<uint8>(frame.type);
+ type_byte = static_cast<uint8_t>(frame.type);
break;
}
@@ -1890,8 +1889,8 @@
return false;
}
if (!no_stream_frame_length) {
- if ((frame.frame_length > numeric_limits<uint16>::max()) ||
- !writer->WriteUInt16(static_cast<uint16>(frame.frame_length))) {
+ if ((frame.frame_length > numeric_limits<uint16_t>::max()) ||
+ !writer->WriteUInt16(static_cast<uint16_t>(frame.frame_length))) {
LOG(DFATAL) << "Writing stream frame length failed";
return false;
}
@@ -1933,7 +1932,7 @@
// Write out the type byte by setting the low order bits and doing shifts
// to make room for the next bit flags to be set.
// Whether there are any nacks.
- uint8 type_byte = ack_info.nack_ranges.empty() ? 0 : kQuicHasNacksMask;
+ uint8_t type_byte = ack_info.nack_ranges.empty() ? 0 : kQuicHasNacksMask;
// truncating bit.
type_byte <<= kQuicAckTruncatedShift;
@@ -1980,7 +1979,7 @@
return false;
}
- uint64 delta_time_largest_observed_us = kUFloat16MaxValue;
+ uint64_t delta_time_largest_observed_us = kUFloat16MaxValue;
if (!frame.delta_time_largest_observed.IsInfinite()) {
DCHECK_LE(0u, frame.delta_time_largest_observed.ToMicroseconds());
delta_time_largest_observed_us =
@@ -2002,8 +2001,8 @@
return true;
}
- const uint8 num_missing_ranges =
- static_cast<uint8>(min(ack_info.nack_ranges.size(), max_num_ranges));
+ const uint8_t num_missing_ranges =
+ static_cast<uint8_t>(min(ack_info.nack_ranges.size(), max_num_ranges));
if (!writer->WriteBytes(&num_missing_ranges, 1)) {
return false;
}
@@ -2030,7 +2029,7 @@
// Append revived packets.
// If not all the revived packets fit, only mention the ones that do.
- uint8 num_revived_packets = frame.latest_revived_packet == 0 ? 0 : 1;
+ uint8_t num_revived_packets = frame.latest_revived_packet == 0 ? 0 : 1;
if (((writer->capacity() - writer->length()) / largest_observed_length) ==
0) {
num_revived_packets = 0;
@@ -2053,13 +2052,13 @@
bool QuicFramer::AppendTimestampToAckFrame(const QuicAckFrame& frame,
QuicDataWriter* writer) {
- DCHECK_GE(numeric_limits<uint8>::max(), frame.received_packet_times.size());
+ DCHECK_GE(numeric_limits<uint8_t>::max(), frame.received_packet_times.size());
// num_received_packets is only 1 byte.
- if (frame.received_packet_times.size() > numeric_limits<uint8>::max()) {
+ if (frame.received_packet_times.size() > numeric_limits<uint8_t>::max()) {
return false;
}
- uint8 num_received_packets = frame.received_packet_times.size();
+ uint8_t num_received_packets = frame.received_packet_times.size();
if (!writer->WriteBytes(&num_received_packets, 1)) {
return false;
}
@@ -2072,8 +2071,8 @@
QuicPacketNumber delta_from_largest_observed =
frame.largest_observed - packet_number;
- DCHECK_GE(numeric_limits<uint8>::max(), delta_from_largest_observed);
- if (delta_from_largest_observed > numeric_limits<uint8>::max()) {
+ DCHECK_GE(numeric_limits<uint8_t>::max(), delta_from_largest_observed);
+ if (delta_from_largest_observed > numeric_limits<uint8_t>::max()) {
return false;
}
@@ -2083,10 +2082,10 @@
}
// Use the lowest 4 bytes of the time delta from the creation_time_.
- const uint64 time_epoch_delta_us = UINT64_C(1) << 32;
- uint32 time_delta_us =
- static_cast<uint32>(it->second.Subtract(creation_time_).ToMicroseconds() &
- (time_epoch_delta_us - 1));
+ const uint64_t time_epoch_delta_us = UINT64_C(1) << 32;
+ uint32_t time_delta_us = static_cast<uint32_t>(
+ it->second.Subtract(creation_time_).ToMicroseconds() &
+ (time_epoch_delta_us - 1));
if (!writer->WriteBytes(&time_delta_us, sizeof(time_delta_us))) {
return false;
}
@@ -2097,7 +2096,7 @@
packet_number = it->first;
delta_from_largest_observed = frame.largest_observed - packet_number;
- if (delta_from_largest_observed > numeric_limits<uint8>::max()) {
+ if (delta_from_largest_observed > numeric_limits<uint8_t>::max()) {
return false;
}
@@ -2106,7 +2105,7 @@
return false;
}
- uint64 frame_time_delta_us =
+ uint64_t frame_time_delta_us =
it->second.Subtract(prev_time).ToMicroseconds();
prev_time = it->second;
if (!writer->WriteUFloat16(frame_time_delta_us)) {
@@ -2155,7 +2154,7 @@
return false;
}
- uint32 error_code = static_cast<uint32>(frame.error_code);
+ uint32_t error_code = static_cast<uint32_t>(frame.error_code);
if (!writer->WriteUInt32(error_code)) {
return false;
}
@@ -2166,7 +2165,7 @@
bool QuicFramer::AppendConnectionCloseFrame(
const QuicConnectionCloseFrame& frame,
QuicDataWriter* writer) {
- uint32 error_code = static_cast<uint32>(frame.error_code);
+ uint32_t error_code = static_cast<uint32_t>(frame.error_code);
if (!writer->WriteUInt32(error_code)) {
return false;
}
@@ -2178,11 +2177,11 @@
bool QuicFramer::AppendGoAwayFrame(const QuicGoAwayFrame& frame,
QuicDataWriter* writer) {
- uint32 error_code = static_cast<uint32>(frame.error_code);
+ uint32_t error_code = static_cast<uint32_t>(frame.error_code);
if (!writer->WriteUInt32(error_code)) {
return false;
}
- uint32 stream_id = static_cast<uint32>(frame.last_good_stream_id);
+ uint32_t stream_id = static_cast<uint32_t>(frame.last_good_stream_id);
if (!writer->WriteUInt32(stream_id)) {
return false;
}
@@ -2194,7 +2193,7 @@
bool QuicFramer::AppendWindowUpdateFrame(const QuicWindowUpdateFrame& frame,
QuicDataWriter* writer) {
- uint32 stream_id = static_cast<uint32>(frame.stream_id);
+ uint32_t stream_id = static_cast<uint32_t>(frame.stream_id);
if (!writer->WriteUInt32(stream_id)) {
return false;
}
@@ -2206,7 +2205,7 @@
bool QuicFramer::AppendBlockedFrame(const QuicBlockedFrame& frame,
QuicDataWriter* writer) {
- uint32 stream_id = static_cast<uint32>(frame.stream_id);
+ uint32_t stream_id = static_cast<uint32_t>(frame.stream_id);
if (!writer->WriteUInt32(stream_id)) {
return false;
}
diff --git a/net/quic/quic_framer.h b/net/quic/quic_framer.h
index 2f1e15c..3e5e719 100644
--- a/net/quic/quic_framer.h
+++ b/net/quic/quic_framer.h
@@ -5,11 +5,14 @@
#ifndef NET_QUIC_QUIC_FRAMER_H_
#define NET_QUIC_QUIC_FRAMER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -357,7 +360,7 @@
private:
friend class test::QuicFramerPeer;
- typedef std::map<QuicPacketNumber, uint8> NackRangeMap;
+ typedef std::map<QuicPacketNumber, uint8_t> NackRangeMap;
struct AckFrameInfo {
AckFrameInfo();
@@ -400,10 +403,10 @@
QuicPacketNumber* packet_number);
bool ProcessFrameData(QuicDataReader* reader, const QuicPacketHeader& header);
bool ProcessStreamFrame(QuicDataReader* reader,
- uint8 frame_type,
+ uint8_t frame_type,
QuicStreamFrame* frame);
bool ProcessAckFrame(QuicDataReader* reader,
- uint8 frame_type,
+ uint8_t frame_type,
QuicAckFrame* frame);
bool ProcessTimestampsInAckFrame(QuicDataReader* reader, QuicAckFrame* frame);
bool ProcessStopWaitingFrame(QuicDataReader* reader,
@@ -432,7 +435,7 @@
// Returns the QuicTime::Delta corresponding to the time from when the framer
// was created.
- const QuicTime::Delta CalculateTimestampFromWire(uint32 time_delta_us);
+ const QuicTime::Delta CalculateTimestampFromWire(uint32_t time_delta_us);
// Computes the wire size in bytes of the |ack| frame, assuming no truncation.
size_t GetAckFrameSize(const QuicAckFrame& ack,
@@ -449,7 +452,7 @@
QuicPacketNumber packet_number,
QuicDataWriter* writer);
- static uint8 GetSequenceNumberFlags(
+ static uint8_t GetSequenceNumberFlags(
QuicPacketNumberLength packet_number_length);
static AckFrameInfo GetAckFrameInfo(const QuicAckFrame& frame);
diff --git a/net/quic/quic_framer_test.cc b/net/quic/quic_framer_test.cc
index 219554d..91f0e06 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -189,7 +189,7 @@
StringPiece GetNoncePrefix() const override { return StringPiece(); }
const char* cipher_name() const override { return "Test"; }
// Use a distinct value starting with 0xFFFFFF, which is never used by TLS.
- uint32 cipher_id() const override { return 0xFFFFFFF2; }
+ uint32_t cipher_id() const override { return 0xFFFFFFF2; }
QuicPacketNumber packet_number_;
string associated_data_;
string ciphertext_;
@@ -514,14 +514,14 @@
CheckCalculatePacketNumber(kEpoch, kMask);
// Cases where the last number was close to the start of the range.
- for (uint64 last = 0; last < 10; last++) {
+ for (uint64_t last = 0; last < 10; last++) {
// Small numbers should not wrap (even if they're out of order).
- for (uint64 j = 0; j < 10; j++) {
+ for (uint64_t j = 0; j < 10; j++) {
CheckCalculatePacketNumber(j, last);
}
// Large numbers should not wrap either (because we're near 0 already).
- for (uint64 j = 0; j < 10; j++) {
+ for (uint64_t j = 0; j < 10; j++) {
CheckCalculatePacketNumber(kEpoch - 1 - j, last);
}
}
@@ -529,16 +529,16 @@
TEST_P(QuicFramerTest, CalculatePacketNumberFromWireNearEpochEnd) {
// Cases where the last number was close to the end of the range
- for (uint64 i = 0; i < 10; i++) {
+ for (uint64_t i = 0; i < 10; i++) {
QuicPacketNumber last = kEpoch - i;
// Small numbers should wrap.
- for (uint64 j = 0; j < 10; j++) {
+ for (uint64_t j = 0; j < 10; j++) {
CheckCalculatePacketNumber(kEpoch + j, last);
}
// Large numbers should not (even if they're out of order).
- for (uint64 j = 0; j < 10; j++) {
+ for (uint64_t j = 0; j < 10; j++) {
CheckCalculatePacketNumber(kEpoch - 1 - j, last);
}
}
@@ -547,62 +547,62 @@
// Next check where we're in a non-zero epoch to verify we handle
// reverse wrapping, too.
TEST_P(QuicFramerTest, CalculatePacketNumberFromWireNearPrevEpoch) {
- const uint64 prev_epoch = 1 * kEpoch;
- const uint64 cur_epoch = 2 * kEpoch;
+ const uint64_t prev_epoch = 1 * kEpoch;
+ const uint64_t cur_epoch = 2 * kEpoch;
// Cases where the last number was close to the start of the range
- for (uint64 i = 0; i < 10; i++) {
- uint64 last = cur_epoch + i;
+ for (uint64_t i = 0; i < 10; i++) {
+ uint64_t last = cur_epoch + i;
// Small number should not wrap (even if they're out of order).
- for (uint64 j = 0; j < 10; j++) {
+ for (uint64_t j = 0; j < 10; j++) {
CheckCalculatePacketNumber(cur_epoch + j, last);
}
// But large numbers should reverse wrap.
- for (uint64 j = 0; j < 10; j++) {
- uint64 num = kEpoch - 1 - j;
+ for (uint64_t j = 0; j < 10; j++) {
+ uint64_t num = kEpoch - 1 - j;
CheckCalculatePacketNumber(prev_epoch + num, last);
}
}
}
TEST_P(QuicFramerTest, CalculatePacketNumberFromWireNearNextEpoch) {
- const uint64 cur_epoch = 2 * kEpoch;
- const uint64 next_epoch = 3 * kEpoch;
+ const uint64_t cur_epoch = 2 * kEpoch;
+ const uint64_t next_epoch = 3 * kEpoch;
// Cases where the last number was close to the end of the range
- for (uint64 i = 0; i < 10; i++) {
+ for (uint64_t i = 0; i < 10; i++) {
QuicPacketNumber last = next_epoch - 1 - i;
// Small numbers should wrap.
- for (uint64 j = 0; j < 10; j++) {
+ for (uint64_t j = 0; j < 10; j++) {
CheckCalculatePacketNumber(next_epoch + j, last);
}
// but large numbers should not (even if they're out of order).
- for (uint64 j = 0; j < 10; j++) {
- uint64 num = kEpoch - 1 - j;
+ for (uint64_t j = 0; j < 10; j++) {
+ uint64_t num = kEpoch - 1 - j;
CheckCalculatePacketNumber(cur_epoch + num, last);
}
}
}
TEST_P(QuicFramerTest, CalculatePacketNumberFromWireNearNextMax) {
- const uint64 max_number = numeric_limits<uint64>::max();
- const uint64 max_epoch = max_number & ~kMask;
+ const uint64_t max_number = numeric_limits<uint64_t>::max();
+ const uint64_t max_epoch = max_number & ~kMask;
// Cases where the last number was close to the end of the range
- for (uint64 i = 0; i < 10; i++) {
+ for (uint64_t i = 0; i < 10; i++) {
// Subtract 1, because the expected next packet number is 1 more than the
// last packet number.
QuicPacketNumber last = max_number - i - 1;
// Small numbers should not wrap, because they have nowhere to go.
- for (uint64 j = 0; j < 10; j++) {
+ for (uint64_t j = 0; j < 10; j++) {
CheckCalculatePacketNumber(max_epoch + j, last);
}
// Large numbers should not wrap either.
- for (uint64 j = 0; j < 10; j++) {
- uint64 num = kEpoch - 1 - j;
+ for (uint64_t j = 0; j < 10; j++) {
+ uint64_t num = kEpoch - 1 - j;
CheckCalculatePacketNumber(max_epoch + num, last);
}
}
@@ -3001,7 +3001,7 @@
};
// clang-format on
- uint64 header_size = GetPacketHeaderSize(
+ uint64_t header_size = GetPacketHeaderSize(
PACKET_8BYTE_CONNECTION_ID, !kIncludeVersion, !kIncludePathId,
PACKET_6BYTE_PACKET_NUMBER, NOT_IN_FEC_GROUP);
memset(packet + header_size + 1, 0x00, kMaxPacketSize - header_size - 1);
@@ -3048,7 +3048,7 @@
};
// clang-format on
- uint64 header_size = GetPacketHeaderSize(
+ uint64_t header_size = GetPacketHeaderSize(
PACKET_8BYTE_CONNECTION_ID, !kIncludeVersion, !kIncludePathId,
PACKET_4BYTE_PACKET_NUMBER, NOT_IN_FEC_GROUP);
memset(packet + header_size + 1, 0x00, kMaxPacketSize - header_size - 1);
@@ -3095,7 +3095,7 @@
};
// clang-format on
- uint64 header_size = GetPacketHeaderSize(
+ uint64_t header_size = GetPacketHeaderSize(
PACKET_8BYTE_CONNECTION_ID, !kIncludeVersion, !kIncludePathId,
PACKET_2BYTE_PACKET_NUMBER, NOT_IN_FEC_GROUP);
memset(packet + header_size + 1, 0x00, kMaxPacketSize - header_size - 1);
@@ -3142,7 +3142,7 @@
};
// clang-format on
- uint64 header_size = GetPacketHeaderSize(
+ uint64_t header_size = GetPacketHeaderSize(
PACKET_8BYTE_CONNECTION_ID, !kIncludeVersion, !kIncludePathId,
PACKET_1BYTE_PACKET_NUMBER, NOT_IN_FEC_GROUP);
memset(packet + header_size + 1, 0x00, kMaxPacketSize - header_size - 1);
diff --git a/net/quic/quic_headers_stream.cc b/net/quic/quic_headers_stream.cc
index e678a13..0676b54e 100644
--- a/net/quic/quic_headers_stream.cc
+++ b/net/quic/quic_headers_stream.cc
@@ -4,6 +4,7 @@
#include "net/quic/quic_headers_stream.h"
+#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
#include "net/quic/quic_flags.h"
@@ -100,7 +101,7 @@
CloseConnection("SPDY RST_STREAM frame received.");
}
- void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {
+ void OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) override {
CloseConnection("SPDY SETTINGS frame received.");
}
diff --git a/net/quic/quic_headers_stream.h b/net/quic/quic_headers_stream.h
index 5114d34..385650e9 100644
--- a/net/quic/quic_headers_stream.h
+++ b/net/quic/quic_headers_stream.h
@@ -5,7 +5,9 @@
#ifndef NET_QUIC_QUIC_HEADERS_STREAM_H_
#define NET_QUIC_QUIC_HEADERS_STREAM_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/quic_headers_stream_test.cc b/net/quic/quic_headers_stream_test.cc
index 7e8e118..e985657 100644
--- a/net/quic/quic_headers_stream_test.cc
+++ b/net/quic/quic_headers_stream_test.cc
@@ -60,7 +60,8 @@
MOCK_METHOD2(OnRstStream,
void(SpdyStreamId stream_id, SpdyRstStreamStatus status));
MOCK_METHOD1(OnSettings, void(bool clear_persisted));
- MOCK_METHOD3(OnSetting, void(SpdySettingsIds id, uint8 flags, uint32 value));
+ MOCK_METHOD3(OnSetting,
+ void(SpdySettingsIds id, uint8_t flags, uint32_t value));
MOCK_METHOD0(OnSettingsAck, void());
MOCK_METHOD0(OnSettingsEnd, void());
MOCK_METHOD2(OnPing, void(SpdyPingId unique_id, bool is_ack));
diff --git a/net/quic/quic_http_stream.h b/net/quic/quic_http_stream.h
index 80f25d73..eaed72b2 100644
--- a/net/quic/quic_http_stream.h
+++ b/net/quic/quic_http_stream.h
@@ -5,10 +5,12 @@
#ifndef NET_QUIC_QUIC_HTTP_STREAM_H_
#define NET_QUIC_QUIC_HTTP_STREAM_H_
+#include <stddef.h>
#include <stdint.h>
#include <list>
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/io_buffer.h"
#include "net/http/http_stream.h"
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index ab5063c8..09da2918 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -58,7 +58,7 @@
const char kUploadData[] = "Really nifty data!";
const char kDefaultServerHostName[] = "www.google.com";
-const uint16 kDefaultServerPort = 80;
+const uint16_t kDefaultServerPort = 80;
class TestQuicConnection : public QuicConnection {
public:
diff --git a/net/quic/quic_http_utils_test.cc b/net/quic/quic_http_utils_test.cc
index a4819a4..5f33096 100644
--- a/net/quic/quic_http_utils_test.cc
+++ b/net/quic/quic_http_utils_test.cc
@@ -29,7 +29,7 @@
EXPECT_EQ(IDLE, ConvertQuicPriorityToRequestPriority(4));
// These are invalid values, but we should still handle them
// gracefully. TODO(rtenneti): should we test for all possible values of
- // uint32?
+ // uint32_t?
for (int i = 5; i < std::numeric_limits<uint8_t>::max(); ++i) {
EXPECT_EQ(IDLE, ConvertQuicPriorityToRequestPriority(i));
}
diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc
index 245021a..22ad48c 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -4,8 +4,8 @@
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
@@ -351,7 +351,7 @@
}
void CheckResponsePort(const scoped_ptr<HttpNetworkTransaction>& trans,
- uint16 port) {
+ uint16_t port) {
const HttpResponseInfo* response = trans->GetResponseInfo();
ASSERT_TRUE(response != nullptr);
EXPECT_EQ(port, response->socket_address.port());
@@ -395,13 +395,13 @@
}
void SendRequestAndExpectQuicResponseOnPort(const std::string& expected,
- uint16 port) {
+ uint16_t port) {
SendRequestAndExpectQuicResponseMaybeFromProxy(expected, false, port);
}
void SendRequestAndExpectQuicResponseFromProxyOnPort(
const std::string& expected,
- uint16 port) {
+ uint16_t port) {
SendRequestAndExpectQuicResponseMaybeFromProxy(expected, true, port);
}
@@ -466,7 +466,7 @@
void SendRequestAndExpectQuicResponseMaybeFromProxy(
const std::string& expected,
bool used_proxy,
- uint16 port) {
+ uint16_t port) {
scoped_ptr<HttpNetworkTransaction> trans(
new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get()));
ProxyHeadersHandler proxy_headers_handler;
diff --git a/net/quic/quic_packet_creator.cc b/net/quic/quic_packet_creator.cc
index c47dcc6..a9739e6 100644
--- a/net/quic/quic_packet_creator.cc
+++ b/net/quic/quic_packet_creator.cc
@@ -6,8 +6,8 @@
#include <algorithm>
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "net/quic/crypto/quic_random.h"
#include "net/quic/quic_data_writer.h"
#include "net/quic/quic_fec_group.h"
@@ -42,7 +42,7 @@
// Minimum timeout for FEC alarm, set to half the minimum Tail Loss Probe
// timeout of 10ms.
-const int64 kMinFecTimeoutMs = 5u;
+const int64_t kMinFecTimeoutMs = 5u;
} // namespace
@@ -72,9 +72,9 @@
// Source of entropy.
QuicRandom* random_;
// Stored random bits.
- uint64 bit_bucket_;
+ uint64_t bit_bucket_;
// The next available bit has "1" in the mask. Zero means empty bucket.
- uint64 bit_mask_;
+ uint64_t bit_mask_;
DISALLOW_COPY_AND_ASSIGN(QuicRandomBoolSource);
};
@@ -242,7 +242,7 @@
const QuicPacketNumber current_delta = max_packets_per_fec_group_ +
packet_number_ + 1 -
least_packet_awaited_by_peer;
- const uint64 delta = max(current_delta, max_packets_in_flight);
+ const uint64_t delta = max(current_delta, max_packets_in_flight);
next_packet_number_length_ =
QuicFramer::GetMinSequenceNumberLength(delta * 4);
}
diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
index 0350cec..a70c1bb 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -11,10 +11,13 @@
#ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_
#define NET_QUIC_QUIC_PACKET_CREATOR_H_
+#include <stddef.h>
+
#include <string>
#include <utility>
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/quic/quic_fec_group.h"
diff --git a/net/quic/quic_packet_creator_test.cc b/net/quic/quic_packet_creator_test.cc
index 4a85376..25cc3dc 100644
--- a/net/quic/quic_packet_creator_test.cc
+++ b/net/quic/quic_packet_creator_test.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include "base/macros.h"
#include "base/stl_util.h"
#include "net/quic/crypto/null_encrypter.h"
#include "net/quic/crypto/quic_decrypter.h"
@@ -1249,7 +1250,7 @@
(mock_random_.RandUint64() & (UINT64_C(1) << j)) != 0;
bool observed_rand_bool =
(serialized.entropy_hash & (1 << ((j + 1) % 8))) != 0;
- uint8 rest_of_hash = serialized.entropy_hash & ~(1 << ((j + 1) % 8));
+ uint8_t rest_of_hash = serialized.entropy_hash & ~(1 << ((j + 1) % 8));
EXPECT_EQ(expected_rand_bool, observed_rand_bool);
EXPECT_EQ(0, rest_of_hash);
delete serialized.packet;
diff --git a/net/quic/quic_packet_generator.cc b/net/quic/quic_packet_generator.cc
index 094355f..df04dc7 100644
--- a/net/quic/quic_packet_generator.cc
+++ b/net/quic/quic_packet_generator.cc
@@ -4,7 +4,6 @@
#include "net/quic/quic_packet_generator.h"
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/quic/quic_fec_group.h"
#include "net/quic/quic_flags.h"
@@ -348,7 +347,7 @@
max_packets_in_flight);
}
-void QuicPacketGenerator::SetConnectionIdLength(uint32 length) {
+void QuicPacketGenerator::SetConnectionIdLength(uint32_t length) {
if (length == 0) {
packet_creator_.set_connection_id_length(PACKET_0BYTE_CONNECTION_ID);
} else if (length == 1) {
diff --git a/net/quic/quic_packet_generator.h b/net/quic/quic_packet_generator.h
index cf6c961..e9e56c3 100644
--- a/net/quic/quic_packet_generator.h
+++ b/net/quic/quic_packet_generator.h
@@ -53,8 +53,12 @@
#ifndef NET_QUIC_QUIC_PACKET_GENERATOR_H_
#define NET_QUIC_QUIC_PACKET_GENERATOR_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <list>
+#include "base/macros.h"
#include "net/quic/quic_packet_creator.h"
#include "net/quic/quic_sent_packet_manager.h"
#include "net/quic/quic_types.h"
@@ -156,7 +160,7 @@
QuicPacketCount max_packets_in_flight);
// Set the minimum number of bytes for the connection id length;
- void SetConnectionIdLength(uint32 length);
+ void SetConnectionIdLength(uint32_t length);
// Called when the FEC alarm fires.
void OnFecTimeout();
diff --git a/net/quic/quic_packet_generator_test.cc b/net/quic/quic_packet_generator_test.cc
index bc5ca9b..458df68 100644
--- a/net/quic/quic_packet_generator_test.cc
+++ b/net/quic/quic_packet_generator_test.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "base/macros.h"
#include "net/quic/crypto/crypto_protocol.h"
#include "net/quic/crypto/null_encrypter.h"
#include "net/quic/crypto/quic_decrypter.h"
@@ -32,7 +33,7 @@
namespace test {
namespace {
-const int64 kMinFecTimeoutMs = 5u;
+const int64_t kMinFecTimeoutMs = 5u;
static const FecSendPolicy kFecSendPolicyList[] = {
FEC_ANY_TRIGGER, FEC_ALARM_TRIGGER,
diff --git a/net/quic/quic_packet_reader.h b/net/quic/quic_packet_reader.h
index e6fde6f..4456da2d 100644
--- a/net/quic/quic_packet_reader.h
+++ b/net/quic/quic_packet_reader.h
@@ -6,6 +6,7 @@
#ifndef NET_QUIC_QUIC_PACKET_READER_H_
#define NET_QUIC_QUIC_PACKET_READER_H_
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/io_buffer.h"
#include "net/base/net_export.h"
diff --git a/net/quic/quic_packet_writer.h b/net/quic/quic_packet_writer.h
index f26fee05..4c9963a 100644
--- a/net/quic/quic_packet_writer.h
+++ b/net/quic/quic_packet_writer.h
@@ -5,6 +5,8 @@
#ifndef NET_QUIC_QUIC_PACKET_WRITER_H_
#define NET_QUIC_QUIC_PACKET_WRITER_H_
+#include <stddef.h>
+
#include "net/base/ip_endpoint.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/quic_protocol.cc b/net/quic/quic_protocol.cc
index df0b07b..98a8d3b 100644
--- a/net/quic/quic_protocol.cc
+++ b/net/quic/quic_protocol.cc
@@ -158,9 +158,9 @@
QuicStreamFrame::~QuicStreamFrame() {}
-uint32 MakeQuicTag(char a, char b, char c, char d) {
- return static_cast<uint32>(a) | static_cast<uint32>(b) << 8 |
- static_cast<uint32>(c) << 16 | static_cast<uint32>(d) << 24;
+uint32_t MakeQuicTag(char a, char b, char c, char d) {
+ return static_cast<uint32_t>(a) | static_cast<uint32_t>(b) << 8 |
+ static_cast<uint32_t>(c) << 16 | static_cast<uint32_t>(d) << 24;
}
bool ContainsQuicTag(const QuicTagVector& tag_vector, QuicTag tag) {
@@ -303,7 +303,7 @@
QuicRstStreamErrorCode error_code,
QuicStreamOffset bytes_written)
: stream_id(stream_id), error_code(error_code), byte_offset(bytes_written) {
- DCHECK_LE(error_code, numeric_limits<uint8>::max());
+ DCHECK_LE(error_code, numeric_limits<uint8_t>::max());
}
QuicConnectionCloseFrame::QuicConnectionCloseFrame()
@@ -632,7 +632,7 @@
: error_code(error_code),
last_good_stream_id(last_good_stream_id),
reason_phrase(reason) {
- DCHECK_LE(error_code, numeric_limits<uint8>::max());
+ DCHECK_LE(error_code, numeric_limits<uint8_t>::max());
}
QuicData::QuicData(const char* buffer, size_t length)
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h
index b7c92c88..33f88469 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+
#include <limits>
#include <list>
#include <map>
@@ -16,9 +17,9 @@
#include <utility>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
@@ -37,20 +38,20 @@
class QuicPacket;
struct QuicPacketHeader;
-typedef uint64 QuicConnectionId;
-typedef uint32 QuicStreamId;
-typedef uint64 QuicStreamOffset;
-typedef uint64 QuicPacketNumber;
-typedef uint8 QuicPathId;
+typedef uint64_t QuicConnectionId;
+typedef uint32_t QuicStreamId;
+typedef uint64_t QuicStreamOffset;
+typedef uint64_t QuicPacketNumber;
+typedef uint8_t QuicPathId;
typedef QuicPacketNumber QuicFecGroupNumber;
-typedef uint64 QuicPublicResetNonceProof;
-typedef uint8 QuicPacketEntropyHash;
-typedef uint32 QuicHeaderId;
+typedef uint64_t QuicPublicResetNonceProof;
+typedef uint8_t QuicPacketEntropyHash;
+typedef uint32_t QuicHeaderId;
// QuicTag is the type of a tag in the wire protocol.
-typedef uint32 QuicTag;
+typedef uint32_t QuicTag;
typedef std::vector<QuicTag> QuicTagVector;
typedef std::map<QuicTag, std::string> QuicTagValueMap;
-typedef uint16 QuicPacketLength;
+typedef uint16_t QuicPacketLength;
// Default initial maximum size in bytes of a QUIC packet.
const QuicByteCount kDefaultMaxPacketSize = 1350;
@@ -69,7 +70,7 @@
const QuicPacketCount kInitialCongestionWindow = 32;
// Minimum size of initial flow control window, for both stream and session.
-const uint32 kMinimumFlowControlSendWindow = 16 * 1024; // 16 KB
+const uint32_t kMinimumFlowControlSendWindow = 16 * 1024; // 16 KB
// Maximum flow control receive window limits for connection and stream.
const QuicByteCount kStreamReceiveWindowLimit = 16 * 1024 * 1024; // 16 MB
@@ -99,10 +100,10 @@
static const float kConservativeReceiveBufferFraction = 0.6f;
// Don't allow a client to suggest an RTT shorter than 10ms.
-const uint32 kMinInitialRoundTripTimeUs = 10 * kNumMicrosPerMilli;
+const uint32_t kMinInitialRoundTripTimeUs = 10 * kNumMicrosPerMilli;
// Don't allow a client to suggest an RTT longer than 15 seconds.
-const uint32 kMaxInitialRoundTripTimeUs = 15 * kNumMicrosPerSecond;
+const uint32_t kMaxInitialRoundTripTimeUs = 15 * kNumMicrosPerSecond;
// Maximum number of open streams per connection.
const size_t kDefaultMaxStreamsPerConnection = 100;
@@ -134,23 +135,23 @@
NET_EXPORT_PRIVATE extern const char* const kFinalOffsetHeaderKey;
// Maximum delayed ack time, in ms.
-const int64 kMaxDelayedAckTimeMs = 25;
+const int64_t kMaxDelayedAckTimeMs = 25;
// The timeout before the handshake succeeds.
-const int64 kInitialIdleTimeoutSecs = 5;
+const int64_t kInitialIdleTimeoutSecs = 5;
// The default idle timeout.
-const int64 kDefaultIdleTimeoutSecs = 30;
+const int64_t kDefaultIdleTimeoutSecs = 30;
// The maximum idle timeout that can be negotiated.
-const int64 kMaximumIdleTimeoutSecs = 60 * 10; // 10 minutes.
+const int64_t kMaximumIdleTimeoutSecs = 60 * 10; // 10 minutes.
// The default timeout for a connection until the crypto handshake succeeds.
-const int64 kMaxTimeForCryptoHandshakeSecs = 10; // 10 secs.
+const int64_t kMaxTimeForCryptoHandshakeSecs = 10; // 10 secs.
// Default limit on the number of undecryptable packets the connection buffers
// before the CHLO/SHLO arrive.
const size_t kDefaultMaxUndecryptablePackets = 10;
// Default ping timeout.
-const int64 kPingTimeoutSecs = 15; // 15 secs.
+const int64_t kPingTimeoutSecs = 15; // 15 secs.
// Minimum number of RTTs between Server Config Updates (SCUP) sent to client.
const int kMinIntervalBetweenServerConfigUpdatesRTTs = 10;
@@ -181,14 +182,14 @@
// bit) and denormals, but without signs, transfinites or fractions. Wire format
// 16 bits (little-endian byte order) are split into exponent (high 5) and
// mantissa (low 11) and decoded as:
-// uint64 value;
+// uint64_t value;
// if (exponent == 0) value = mantissa;
// else value = (mantissa | 1 << 11) << (exponent - 1)
const int kUFloat16ExponentBits = 5;
const int kUFloat16MaxExponent = (1 << kUFloat16ExponentBits) - 2; // 30
const int kUFloat16MantissaBits = 16 - kUFloat16ExponentBits; // 11
const int kUFloat16MantissaEffectiveBits = kUFloat16MantissaBits + 1; // 12
-const uint64 kUFloat16MaxValue = // 0x3FFC0000000
+const uint64_t kUFloat16MaxValue = // 0x3FFC0000000
((UINT64_C(1) << kUFloat16MantissaEffectiveBits) - 1)
<< kUFloat16MaxExponent;
@@ -399,7 +400,7 @@
// representation of the name of the tag. For example
// the client hello tag (CHLO) will be written as the
// following 4 bytes: 'C' 'H' 'L' 'O'. Since it is
-// stored in memory as a little endian uint32, we need
+// stored in memory as a little endian uint32_t, we need
// to reverse the order of the bytes.
// MakeQuicTag returns a value given the four bytes. For example:
@@ -1249,7 +1250,7 @@
EncryptionLevel encryption_level;
QuicPacketNumberLength packet_number_length;
QuicPacketLength bytes_sent;
- uint16 nack_count;
+ uint16_t nack_count;
QuicTime sent_time;
// Reason why this packet was transmitted.
TransmissionType transmission_type;
diff --git a/net/quic/quic_received_packet_manager.cc b/net/quic/quic_received_packet_manager.cc
index 13e9a7410..48cd757c 100644
--- a/net/quic/quic_received_packet_manager.cc
+++ b/net/quic/quic_received_packet_manager.cc
@@ -163,7 +163,7 @@
stats_->max_sequence_reordering =
max(stats_->max_sequence_reordering,
ack_frame_.largest_observed - packet_number);
- int64 reordering_time_us =
+ int64_t reordering_time_us =
receipt_time.Subtract(time_largest_observed_).ToMicroseconds();
stats_->max_time_reordering_us =
max(stats_->max_time_reordering_us, reordering_time_us);
@@ -206,7 +206,7 @@
// Return true if the packet in p is too different from largest_observed_
// to express.
bool operator()(const std::pair<QuicPacketNumber, QuicTime>& p) const {
- return largest_observed_ - p.first >= numeric_limits<uint8>::max();
+ return largest_observed_ - p.first >= numeric_limits<uint8_t>::max();
}
};
} // namespace
@@ -235,7 +235,7 @@
for (PacketTimeVector::iterator it = ack_frame_.received_packet_times.begin();
it != ack_frame_.received_packet_times.end();) {
if (ack_frame_.largest_observed - it->first >=
- numeric_limits<uint8>::max()) {
+ numeric_limits<uint8_t>::max()) {
it = ack_frame_.received_packet_times.erase(it);
} else {
++it;
diff --git a/net/quic/quic_received_packet_manager.h b/net/quic/quic_received_packet_manager.h
index e26dbbb..61edf85 100644
--- a/net/quic/quic_received_packet_manager.h
+++ b/net/quic/quic_received_packet_manager.h
@@ -8,8 +8,11 @@
#ifndef NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_
#define NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_
+#include <stddef.h>
+
#include <deque>
+#include "base/macros.h"
#include "net/quic/quic_config.h"
#include "net/quic/quic_framer.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/quic_reliable_client_stream.h b/net/quic/quic_reliable_client_stream.h
index 17ef55e..3e02fc10 100644
--- a/net/quic/quic_reliable_client_stream.h
+++ b/net/quic/quic_reliable_client_stream.h
@@ -7,6 +7,9 @@
#ifndef NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_
#define NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/base/ip_endpoint.h"
#include "net/base/upload_data_stream.h"
#include "net/http/http_request_info.h"
diff --git a/net/quic/quic_reliable_client_stream_test.cc b/net/quic/quic_reliable_client_stream_test.cc
index f09b34c8..7898202ea 100644
--- a/net/quic/quic_reliable_client_stream_test.cc
+++ b/net/quic/quic_reliable_client_stream_test.cc
@@ -4,6 +4,7 @@
#include "net/quic/quic_reliable_client_stream.h"
+#include "base/macros.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/quic/quic_chromium_client_session.h"
diff --git a/net/quic/quic_sent_entropy_manager.h b/net/quic/quic_sent_entropy_manager.h
index cf12c84..9ea90056 100644
--- a/net/quic/quic_sent_entropy_manager.h
+++ b/net/quic/quic_sent_entropy_manager.h
@@ -10,6 +10,7 @@
#include <deque>
+#include "base/macros.h"
#include "net/base/linked_hash_map.h"
#include "net/quic/quic_framer.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 9648917..d4f0f162 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -22,15 +22,15 @@
// The length of the recent min rtt window in seconds. Windowing is disabled for
// values less than or equal to 0.
-int32 FLAGS_quic_recent_min_rtt_window_s = 60;
+int32_t FLAGS_quic_recent_min_rtt_window_s = 60;
namespace {
-static const int64 kDefaultRetransmissionTimeMs = 500;
+static const int64_t kDefaultRetransmissionTimeMs = 500;
// TCP RFC calls for 1 second RTO however Linux differs from this default and
// define the minimum RTO to 200ms, we will use the same until we have data to
// support a higher or lower value.
-static const int64 kMinRetransmissionTimeMs = 200;
-static const int64 kMaxRetransmissionTimeMs = 60000;
+static const int64_t kMinRetransmissionTimeMs = 200;
+static const int64_t kMaxRetransmissionTimeMs = 60000;
// Maximum number of exponential backoffs used for RTO timeouts.
static const size_t kMaxRetransmissions = 10;
// Maximum number of packets retransmitted upon an RTO.
@@ -38,12 +38,12 @@
// Ensure the handshake timer isnt't faster than 10ms.
// This limits the tenth retransmitted packet to 10s after the initial CHLO.
-static const int64 kMinHandshakeTimeoutMs = 10;
+static const int64_t kMinHandshakeTimeoutMs = 10;
// Sends up to two tail loss probes before firing an RTO,
// per draft RFC draft-dukkipati-tcpm-tcp-loss-probe.
static const size_t kDefaultMaxTailLossProbes = 2;
-static const int64 kMinTailLossProbeTimeoutMs = 10;
+static const int64_t kMinTailLossProbeTimeoutMs = 10;
// Number of unpaced packets to send after quiescence.
static const size_t kInitialUnpacedBurst = 10;
@@ -186,7 +186,7 @@
const CachedNetworkParameters& cached_network_params,
bool max_bandwidth_resumption) {
if (cached_network_params.has_min_rtt_ms()) {
- uint32 initial_rtt_us =
+ uint32_t initial_rtt_us =
kNumMicrosPerMilli * cached_network_params.min_rtt_ms();
rtt_stats_.set_initial_rtt_us(
max(kMinInitialRoundTripTimeUs,
@@ -876,8 +876,8 @@
if (srtt.IsZero()) {
srtt = QuicTime::Delta::FromMicroseconds(rtt_stats_.initial_rtt_us());
}
- int64 delay_ms = max(kMinHandshakeTimeoutMs,
- static_cast<int64>(1.5 * srtt.ToMilliseconds()));
+ int64_t delay_ms = max(kMinHandshakeTimeoutMs,
+ static_cast<int64_t>(1.5 * srtt.ToMilliseconds()));
return QuicTime::Delta::FromMilliseconds(
delay_ms << consecutive_crypto_retransmission_count_);
}
@@ -890,7 +890,7 @@
if (enable_half_rtt_tail_loss_probe_ && consecutive_tlp_count_ == 0u) {
return QuicTime::Delta::FromMilliseconds(
max(kMinTailLossProbeTimeoutMs,
- static_cast<int64>(0.5 * srtt.ToMilliseconds())));
+ static_cast<int64_t>(0.5 * srtt.ToMilliseconds())));
}
if (!unacked_packets_.HasMultipleInFlightPackets()) {
return QuicTime::Delta::Max(
@@ -900,7 +900,7 @@
}
return QuicTime::Delta::FromMilliseconds(
max(kMinTailLossProbeTimeoutMs,
- static_cast<int64>(2 * srtt.ToMilliseconds())));
+ static_cast<int64_t>(2 * srtt.ToMilliseconds())));
}
const QuicTime::Delta QuicSentPacketManager::GetRetransmissionDelay() const {
diff --git a/net/quic/quic_sent_packet_manager.h b/net/quic/quic_sent_packet_manager.h
index 84ff327..2bddc4e 100644
--- a/net/quic/quic_sent_packet_manager.h
+++ b/net/quic/quic_sent_packet_manager.h
@@ -5,12 +5,15 @@
#ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_
#define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_
+#include <stddef.h>
+
#include <map>
#include <set>
#include <utility>
#include <vector>
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/linked_hash_map.h"
#include "net/quic/congestion_control/loss_detection_interface.h"
diff --git a/net/quic/quic_sent_packet_manager_test.cc b/net/quic/quic_sent_packet_manager_test.cc
index 9b7442c..9d3e0cd9 100644
--- a/net/quic/quic_sent_packet_manager_test.cc
+++ b/net/quic/quic_sent_packet_manager_test.cc
@@ -28,7 +28,7 @@
namespace {
// Default packet length.
-const uint32 kDefaultLength = 1000;
+const uint32_t kDefaultLength = 1000;
// Stream ID for data sent in CreatePacket().
const QuicStreamId kStreamId = 7;
@@ -1654,7 +1654,7 @@
}
TEST_F(QuicSentPacketManagerTest, UseInitialRoundTripTimeToSend) {
- uint32 initial_rtt_us = 325000;
+ uint32_t initial_rtt_us = 325000;
EXPECT_NE(initial_rtt_us,
manager_.GetRttStats()->smoothed_rtt().ToMicroseconds());
@@ -1679,7 +1679,7 @@
EXPECT_CALL(*send_algorithm_, ResumeConnectionState(_, false));
manager_.ResumeConnectionState(cached_network_params, false);
EXPECT_EQ(kRttMs * kNumMicrosPerMilli,
- static_cast<uint64>(manager_.GetRttStats()->initial_rtt_us()));
+ static_cast<uint64_t>(manager_.GetRttStats()->initial_rtt_us()));
}
} // namespace
diff --git a/net/quic/quic_server_id.cc b/net/quic/quic_server_id.cc
index a79d677..b810bb3 100644
--- a/net/quic/quic_server_id.cc
+++ b/net/quic/quic_server_id.cc
@@ -21,11 +21,11 @@
PrivacyMode privacy_mode)
: host_port_pair_(host_port_pair), privacy_mode_(privacy_mode) {}
-QuicServerId::QuicServerId(const string& host, uint16 port)
+QuicServerId::QuicServerId(const string& host, uint16_t port)
: host_port_pair_(host, port), privacy_mode_(PRIVACY_MODE_DISABLED) {}
QuicServerId::QuicServerId(const string& host,
- uint16 port,
+ uint16_t port,
PrivacyMode privacy_mode)
: host_port_pair_(host, port), privacy_mode_(privacy_mode) {}
diff --git a/net/quic/quic_server_id.h b/net/quic/quic_server_id.h
index 609c3b7..97dbebb 100644
--- a/net/quic/quic_server_id.h
+++ b/net/quic/quic_server_id.h
@@ -5,6 +5,8 @@
#ifndef NET_QUIC_QUIC_SERVER_ID_H_
#define NET_QUIC_QUIC_SERVER_ID_H_
+#include <stdint.h>
+
#include <string>
#include "net/base/host_port_pair.h"
@@ -19,8 +21,10 @@
public:
QuicServerId();
QuicServerId(const HostPortPair& host_port_pair, PrivacyMode privacy_mode);
- QuicServerId(const std::string& host, uint16 port);
- QuicServerId(const std::string& host, uint16 port, PrivacyMode privacy_mode);
+ QuicServerId(const std::string& host, uint16_t port);
+ QuicServerId(const std::string& host,
+ uint16_t port,
+ PrivacyMode privacy_mode);
~QuicServerId();
// Needed to be an element of std::set.
@@ -40,7 +44,7 @@
const std::string& host() const { return host_port_pair_.host(); }
- uint16 port() const { return host_port_pair_.port(); }
+ uint16_t port() const { return host_port_pair_.port(); }
PrivacyMode privacy_mode() const { return privacy_mode_; }
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index 08753fd..5cc208c8 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -428,15 +428,16 @@
void QuicSession::OnConfigNegotiated() {
connection_->SetFromConfig(config_);
- uint32 max_streams = config_.MaxStreamsPerConnection();
+ uint32_t max_streams = config_.MaxStreamsPerConnection();
if (perspective() == Perspective::IS_SERVER) {
// A server should accept a small number of additional streams beyond the
// limit sent to the client. This helps avoid early connection termination
// when FIN/RSTs for old streams are lost or arrive out of order.
// Use a minimum number of additional streams, or a percentage increase,
// whichever is larger.
- max_streams = max(max_streams + kMaxStreamsMinimumIncrement,
- static_cast<uint32>(max_streams * kMaxStreamsMultiplier));
+ max_streams =
+ max(max_streams + kMaxStreamsMinimumIncrement,
+ static_cast<uint32_t>(max_streams * kMaxStreamsMultiplier));
if (config_.HasReceivedConnectionOptions()) {
if (ContainsQuicTag(config_.ReceivedConnectionOptions(), kAFCW)) {
diff --git a/net/quic/quic_session.h b/net/quic/quic_session.h
index 619cf5a0..c3f3e5a 100644
--- a/net/quic/quic_session.h
+++ b/net/quic/quic_session.h
@@ -7,12 +7,15 @@
#ifndef NET_QUIC_QUIC_SESSION_H_
#define NET_QUIC_QUIC_SESSION_H_
+#include <stddef.h>
+
#include <map>
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/ip_endpoint.h"
diff --git a/net/quic/quic_session_test.cc b/net/quic/quic_session_test.cc
index bda96ae..feae2fb 100644
--- a/net/quic/quic_session_test.cc
+++ b/net/quic/quic_session_test.cc
@@ -6,7 +6,6 @@
#include <set>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/rand_util.h"
#include "base/stl_util.h"
@@ -940,8 +939,8 @@
// Connection starts with some non-zero highest received byte offset,
// due to other active streams.
- const uint64 kInitialConnectionBytesConsumed = 567;
- const uint64 kInitialConnectionHighestReceivedOffset = 1234;
+ const uint64_t kInitialConnectionBytesConsumed = 567;
+ const uint64_t kInitialConnectionHighestReceivedOffset = 1234;
EXPECT_LT(kInitialConnectionBytesConsumed,
kInitialConnectionHighestReceivedOffset);
session_.flow_controller()->UpdateHighestReceivedOffset(
@@ -977,8 +976,8 @@
// Connection starts with some non-zero highest received byte offset,
// due to other active streams.
- const uint64 kInitialConnectionBytesConsumed = 567;
- const uint64 kInitialConnectionHighestReceivedOffset = 1234;
+ const uint64_t kInitialConnectionBytesConsumed = 567;
+ const uint64_t kInitialConnectionHighestReceivedOffset = 1234;
EXPECT_LT(kInitialConnectionBytesConsumed,
kInitialConnectionHighestReceivedOffset);
session_.flow_controller()->UpdateHighestReceivedOffset(
@@ -1008,7 +1007,7 @@
TEST_P(QuicSessionTestServer, InvalidStreamFlowControlWindowInHandshake) {
// Test that receipt of an invalid (< default) stream flow control window from
// the peer results in the connection being torn down.
- const uint32 kInvalidWindow = kMinimumFlowControlSendWindow - 1;
+ const uint32_t kInvalidWindow = kMinimumFlowControlSendWindow - 1;
QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow(session_.config(),
kInvalidWindow);
@@ -1020,7 +1019,7 @@
TEST_P(QuicSessionTestServer, InvalidSessionFlowControlWindowInHandshake) {
// Test that receipt of an invalid (< default) session flow control window
// from the peer results in the connection being torn down.
- const uint32 kInvalidWindow = kMinimumFlowControlSendWindow - 1;
+ const uint32_t kInvalidWindow = kMinimumFlowControlSendWindow - 1;
QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(session_.config(),
kInvalidWindow);
@@ -1032,7 +1031,7 @@
TEST_P(QuicSessionTestServer, FlowControlWithInvalidFinalOffset) {
// Test that if we receive a stream RST with a highest byte offset that
// violates flow control, that we close the connection.
- const uint64 kLargeOffset = kInitialSessionFlowControlWindowForTest + 1;
+ const uint64_t kLargeOffset = kInitialSessionFlowControlWindowForTest + 1;
EXPECT_CALL(*connection_,
SendConnectionClose(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA))
.Times(2);
diff --git a/net/quic/quic_socket_address_coder.cc b/net/quic/quic_socket_address_coder.cc
index 3d0031d1..bd28353 100644
--- a/net/quic/quic_socket_address_coder.cc
+++ b/net/quic/quic_socket_address_coder.cc
@@ -14,8 +14,8 @@
// For convenience, the values of these constants match the values of AF_INET
// and AF_INET6 on Linux.
-const uint16 kIPv4 = 2;
-const uint16 kIPv6 = 10;
+const uint16_t kIPv4 = 2;
+const uint16_t kIPv6 = 10;
} // namespace
@@ -28,7 +28,7 @@
string QuicSocketAddressCoder::Encode() const {
string serialized;
- uint16 address_family;
+ uint16_t address_family;
switch (address_.GetSockAddrFamily()) {
case AF_INET:
address_family = kIPv4;
@@ -42,13 +42,13 @@
serialized.append(reinterpret_cast<const char*>(&address_family),
sizeof(address_family));
serialized.append(IPAddressToPackedString(address_.address()));
- uint16 port = address_.port();
+ uint16_t port = address_.port();
serialized.append(reinterpret_cast<const char*>(&port), sizeof(port));
return serialized;
}
bool QuicSocketAddressCoder::Decode(const char* data, size_t length) {
- uint16 address_family;
+ uint16_t address_family;
if (length < sizeof(address_family)) {
return false;
}
@@ -75,7 +75,7 @@
data += ip_length;
length -= ip_length;
- uint16 port;
+ uint16_t port;
if (length != sizeof(port)) {
return false;
}
diff --git a/net/quic/quic_socket_address_coder.h b/net/quic/quic_socket_address_coder.h
index 852682e..0b620ba 100644
--- a/net/quic/quic_socket_address_coder.h
+++ b/net/quic/quic_socket_address_coder.h
@@ -5,9 +5,12 @@
#ifndef NET_QUIC_QUIC_SOCKET_ADDRESS_CODER_H_
#define NET_QUIC_QUIC_SOCKET_ADDRESS_CODER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_export.h"
@@ -28,7 +31,7 @@
IPAddressNumber ip() const { return address_.address(); }
- uint16 port() const { return address_.port(); }
+ uint16_t port() const { return address_.port(); }
private:
IPEndPoint address_;
diff --git a/net/quic/quic_socket_address_coder_test.cc b/net/quic/quic_socket_address_coder_test.cc
index aeba0d1..7962493 100644
--- a/net/quic/quic_socket_address_coder_test.cc
+++ b/net/quic/quic_socket_address_coder_test.cc
@@ -99,7 +99,7 @@
TEST(QuicSocketAddressCoderTest, EncodeAndDecode) {
struct {
const char* ip_literal;
- uint16 port;
+ uint16_t port;
} test_case[] = {
{"93.184.216.119", 0x1234},
{"199.204.44.194", 80},
diff --git a/net/quic/quic_spdy_session.h b/net/quic/quic_spdy_session.h
index 56783dd..d660af7 100644
--- a/net/quic/quic_spdy_session.h
+++ b/net/quic/quic_spdy_session.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_QUIC_SPDY_SESSION_H_
#define NET_QUIC_QUIC_SPDY_SESSION_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/quic_headers_stream.h"
#include "net/quic/quic_session.h"
#include "net/quic/quic_spdy_stream.h"
diff --git a/net/quic/quic_spdy_stream.h b/net/quic/quic_spdy_stream.h
index cae7b31..d49d650 100644
--- a/net/quic/quic_spdy_stream.h
+++ b/net/quic/quic_spdy_stream.h
@@ -9,12 +9,13 @@
#ifndef NET_QUIC_QUIC_SPDY_STREAM_H_
#define NET_QUIC_QUIC_SPDY_STREAM_H_
+#include <stddef.h>
#include <sys/types.h>
#include <list>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/iovec.h"
#include "net/base/ip_endpoint.h"
diff --git a/net/quic/quic_spdy_stream_test.cc b/net/quic/quic_spdy_stream_test.cc
index 53b47c07..d12969b 100644
--- a/net/quic/quic_spdy_stream_test.cc
+++ b/net/quic/quic_spdy_stream_test.cc
@@ -349,7 +349,7 @@
Initialize(kShouldProcessData);
// Set a small flow control limit.
- const uint64 kWindow = 36;
+ const uint64_t kWindow = 36;
QuicFlowControllerPeer::SetSendWindowOffset(stream_->flow_controller(),
kWindow);
EXPECT_EQ(kWindow, QuicFlowControllerPeer::SendWindowOffset(
@@ -358,7 +358,7 @@
// Try to send more data than the flow control limit allows.
string headers = SpdyUtils::SerializeUncompressedHeaders(headers_);
string body;
- const uint64 kOverflow = 15;
+ const uint64_t kOverflow = 15;
GenerateBody(&body, kWindow + kOverflow);
EXPECT_CALL(*connection_, SendBlocked(kClientDataStreamId1));
@@ -387,7 +387,7 @@
EXPECT_CALL(*connection_, SendWindowUpdate(_, _)).Times(0);
// Set a small flow control receive window.
- const uint64 kWindow = 36;
+ const uint64_t kWindow = 36;
QuicFlowControllerPeer::SetReceiveWindowOffset(stream_->flow_controller(),
kWindow);
QuicFlowControllerPeer::SetMaxReceiveWindow(stream_->flow_controller(),
@@ -425,7 +425,7 @@
Initialize(kShouldProcessData);
// Set a small flow control limit.
- const uint64 kWindow = 36;
+ const uint64_t kWindow = 36;
QuicFlowControllerPeer::SetReceiveWindowOffset(stream_->flow_controller(),
kWindow);
QuicFlowControllerPeer::SetMaxReceiveWindow(stream_->flow_controller(),
@@ -469,7 +469,7 @@
Initialize(kShouldProcessData);
// Set a small flow control limit for streams and connection.
- const uint64 kWindow = 36;
+ const uint64_t kWindow = 36;
QuicFlowControllerPeer::SetReceiveWindowOffset(stream_->flow_controller(),
kWindow);
QuicFlowControllerPeer::SetMaxReceiveWindow(stream_->flow_controller(),
@@ -524,7 +524,7 @@
Initialize(!kShouldProcessData);
// Set a small flow control limit.
- const uint64 kWindow = 50;
+ const uint64_t kWindow = 50;
QuicFlowControllerPeer::SetReceiveWindowOffset(stream_->flow_controller(),
kWindow);
@@ -570,8 +570,8 @@
Initialize(!kShouldProcessData);
// Set a small flow control window on streams, and connection.
- const uint64 kStreamWindow = 50;
- const uint64 kConnectionWindow = 10;
+ const uint64_t kStreamWindow = 50;
+ const uint64_t kConnectionWindow = 10;
QuicFlowControllerPeer::SetReceiveWindowOffset(stream_->flow_controller(),
kStreamWindow);
QuicFlowControllerPeer::SetReceiveWindowOffset(session_->flow_controller(),
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 0663160e..976cfcf4 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -8,6 +8,7 @@
#include <set>
#include "base/location.h"
+#include "base/macros.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
@@ -71,11 +72,11 @@
};
// The maximum receive window sizes for QUIC sessions and streams.
-const int32 kQuicSessionMaxRecvWindowSize = 15 * 1024 * 1024; // 15 MB
-const int32 kQuicStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
+const int32_t kQuicSessionMaxRecvWindowSize = 15 * 1024 * 1024; // 15 MB
+const int32_t kQuicStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
// Set the maximum number of undecryptable packets the connection will store.
-const int32 kMaxUndecryptablePackets = 100;
+const int32_t kMaxUndecryptablePackets = 100;
void HistogramCreateSessionFailure(enum CreateSessionFailure error) {
UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.CreationError", error,
@@ -373,7 +374,7 @@
if (factory_->load_server_info_timeout_srtt_multiplier_ > 0) {
const int kMaxLoadServerInfoTimeoutMs = 50;
// Wait for DiskCache a maximum of 50ms.
- int64 load_server_info_timeout_ms =
+ int64_t load_server_info_timeout_ms =
min(static_cast<int>(
(factory_->load_server_info_timeout_srtt_multiplier_ *
factory_->GetServerNetworkStatsSmoothedRttInMicroseconds(
@@ -693,7 +694,8 @@
const QuicServerId& server_id) {
if (!delay_tcp_race_ || require_confirmation_)
return base::TimeDelta();
- int64 srtt = 1.5 * GetServerNetworkStatsSmoothedRttInMicroseconds(server_id);
+ int64_t srtt =
+ 1.5 * GetServerNetworkStatsSmoothedRttInMicroseconds(server_id);
// Picked 300ms based on mean time from
// Net.QuicSession.HostResolution.HandshakeConfirmedTime histogram.
const int kDefaultRTT = 300 * kNumMicrosPerMilli;
@@ -888,7 +890,7 @@
}
QuicChromiumClientSession::QuicDisabledReason
-QuicStreamFactory::QuicDisabledReason(uint16 port) const {
+QuicStreamFactory::QuicDisabledReason(uint16_t port) const {
if (max_number_of_lossy_connections_ > 0 &&
number_of_lossy_connections_.find(port) !=
number_of_lossy_connections_.end() &&
@@ -911,7 +913,7 @@
const char* QuicStreamFactory::QuicDisabledReasonString() const {
// TODO(ckrasic) - better solution for port/lossy connections?
- const uint16 port = 443;
+ const uint16_t port = 443;
switch (QuicDisabledReason(port)) {
case QuicChromiumClientSession::QUIC_DISABLED_BAD_PACKET_LOSS_RATE:
return "Bad packet loss rate.";
@@ -924,7 +926,7 @@
}
}
-bool QuicStreamFactory::IsQuicDisabled(uint16 port) {
+bool QuicStreamFactory::IsQuicDisabled(uint16_t port) {
return QuicDisabledReason(port) !=
QuicChromiumClientSession::QUIC_DISABLED_NOT;
}
@@ -932,7 +934,7 @@
bool QuicStreamFactory::OnHandshakeConfirmed(QuicChromiumClientSession* session,
float packet_loss_rate) {
DCHECK(session);
- uint16 port = session->server_id().port();
+ uint16_t port = session->server_id().port();
if (packet_loss_rate < packet_loss_threshold_) {
number_of_lossy_connections_[port] = 0;
return false;
@@ -998,7 +1000,7 @@
void QuicStreamFactory::MaybeDisableQuic(QuicChromiumClientSession* session) {
DCHECK(session);
- uint16 port = session->server_id().port();
+ uint16_t port = session->server_id().port();
if (IsQuicDisabled(port))
return;
@@ -1271,9 +1273,9 @@
config.SetInitialSessionFlowControlWindowToSend(
kQuicSessionMaxRecvWindowSize);
config.SetInitialStreamFlowControlWindowToSend(kQuicStreamMaxRecvWindowSize);
- int64 srtt = GetServerNetworkStatsSmoothedRttInMicroseconds(server_id);
+ int64_t srtt = GetServerNetworkStatsSmoothedRttInMicroseconds(server_id);
if (srtt > 0)
- config.SetInitialRoundTripTimeUsToSend(static_cast<uint32>(srtt));
+ config.SetInitialRoundTripTimeUsToSend(static_cast<uint32_t>(srtt));
config.SetBytesForConnectionIdToSend(0);
if (quic_server_info_factory_.get() && !server_info) {
@@ -1327,7 +1329,7 @@
ip_aliases_[peer_address].insert(session);
}
-int64 QuicStreamFactory::GetServerNetworkStatsSmoothedRttInMicroseconds(
+int64_t QuicStreamFactory::GetServerNetworkStatsSmoothedRttInMicroseconds(
const QuicServerId& server_id) const {
const ServerNetworkStats* stats =
http_server_properties_->GetServerNetworkStats(
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h
index 9eea4199..fd317d66 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_
#define NET_QUIC_QUIC_STREAM_FACTORY_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <list>
#include <map>
#include <string>
@@ -12,6 +15,7 @@
#include "base/gtest_prod_util.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "net/base/address_list.h"
@@ -171,11 +175,11 @@
float packet_loss_rate);
// Returns true if QUIC is disabled for this port.
- bool IsQuicDisabled(uint16 port);
+ bool IsQuicDisabled(uint16_t port);
// Returns reason QUIC is disabled for this port, or QUIC_DISABLED_NOT if not.
QuicChromiumClientSession::QuicDisabledReason QuicDisabledReason(
- uint16 port) const;
+ uint16_t port) const;
// Returns reason QUIC is disabled as string for net-internals, or
// returns empty string if QUIC is not disabled.
@@ -305,7 +309,7 @@
// Returns |srtt| in micro seconds from ServerNetworkStats. Returns 0 if there
// is no |http_server_properties_| or if |http_server_properties_| doesn't
// have ServerNetworkStats for the given |server_id|.
- int64 GetServerNetworkStatsSmoothedRttInMicroseconds(
+ int64_t GetServerNetworkStatsSmoothedRttInMicroseconds(
const QuicServerId& server_id) const;
// Helper methods.
@@ -413,7 +417,7 @@
// and is considered as a lossy connection.
float packet_loss_threshold_;
// Count number of lossy connections by port.
- std::map<uint16, int> number_of_lossy_connections_;
+ std::map<uint16_t, int> number_of_lossy_connections_;
// Keep track of stats for recently closed connections, using a
// bounded queue.
@@ -454,7 +458,7 @@
// port when we re-connect to any given server/port. The differences between
// profiles (probablistically) prevent two profiles from colliding in their
// ephemeral port requests.
- uint64 port_seed_;
+ uint64_t port_seed_;
// Local address of socket that was created in CreateSession.
IPEndPoint local_address_;
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index 9ad8e2b..30868c1 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -753,8 +753,8 @@
HostPortPair server1("www.example.org", 443);
HostPortPair server2("mail.example.org", 443);
- uint8 primary_pin = 1;
- uint8 backup_pin = 2;
+ uint8_t primary_pin = 1;
+ uint8_t backup_pin = 2;
test::AddPin(&transport_security_state_, "mail.example.org", primary_pin,
backup_pin);
@@ -801,8 +801,8 @@
HostPortPair server1("www.example.org", 443);
HostPortPair server2("mail.example.org", 443);
- uint8 primary_pin = 1;
- uint8 backup_pin = 2;
+ uint8_t primary_pin = 1;
+ uint8_t backup_pin = 2;
test::AddPin(&transport_security_state_, "mail.example.org", primary_pin,
backup_pin);
@@ -849,9 +849,9 @@
HostPortPair server1("www.example.org", 443);
HostPortPair server2("mail.example.org", 443);
- uint8 primary_pin = 1;
- uint8 backup_pin = 2;
- uint8 bad_pin = 3;
+ uint8_t primary_pin = 1;
+ uint8_t backup_pin = 2;
+ uint8_t bad_pin = 3;
test::AddPin(&transport_security_state_, "mail.example.org", primary_pin,
backup_pin);
diff --git a/net/quic/quic_stream_sequencer.h b/net/quic/quic_stream_sequencer.h
index d1108be16..65d99baa 100644
--- a/net/quic/quic_stream_sequencer.h
+++ b/net/quic/quic_stream_sequencer.h
@@ -5,10 +5,12 @@
#ifndef NET_QUIC_QUIC_STREAM_SEQUENCER_H_
#define NET_QUIC_QUIC_STREAM_SEQUENCER_H_
+#include <stddef.h>
+
#include <map>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/quic/quic_frame_list.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/quic_stream_sequencer_buffer_interface.h b/net/quic/quic_stream_sequencer_buffer_interface.h
index 22b4ed81..2fc9e65 100644
--- a/net/quic/quic_stream_sequencer_buffer_interface.h
+++ b/net/quic/quic_stream_sequencer_buffer_interface.h
@@ -5,6 +5,8 @@
#ifndef NET_QUIC_QUIC_STREAM_SEQUENCER_BUFFER_INTERFACE_H_
#define NET_QUIC_QUIC_STREAM_SEQUENCER_BUFFER_INTERFACE_H_
+#include <stddef.h>
+
#include "net/quic/quic_protocol.h"
using base::StringPiece;
diff --git a/net/quic/quic_sustained_bandwidth_recorder.h b/net/quic/quic_sustained_bandwidth_recorder.h
index 1e6b43a..bc0d1b8 100644
--- a/net/quic/quic_sustained_bandwidth_recorder.h
+++ b/net/quic/quic_sustained_bandwidth_recorder.h
@@ -5,7 +5,10 @@
#ifndef NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_
#define NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_
+#include <stdint.h>
+
#include "base/logging.h"
+#include "base/macros.h"
#include "net/quic/quic_bandwidth.h"
#include "net/quic/quic_time.h"
@@ -46,7 +49,7 @@
return max_bandwidth_estimate_;
}
- int64 MaxBandwidthTimestamp() const {
+ int64_t MaxBandwidthTimestamp() const {
DCHECK(has_estimate_);
return max_bandwidth_timestamp_;
}
@@ -77,7 +80,7 @@
QuicBandwidth max_bandwidth_estimate_;
// Timestamp indicating when the max_bandwidth_estimate_ was seen.
- int64 max_bandwidth_timestamp_;
+ int64_t max_bandwidth_timestamp_;
// Timestamp marking the beginning of the latest recording period.
QuicTime start_time_;
diff --git a/net/quic/quic_sustained_bandwidth_recorder_test.cc b/net/quic/quic_sustained_bandwidth_recorder_test.cc
index 6a5fbb2..91cff412 100644
--- a/net/quic/quic_sustained_bandwidth_recorder_test.cc
+++ b/net/quic/quic_sustained_bandwidth_recorder_test.cc
@@ -61,7 +61,7 @@
EXPECT_EQ(recorder.BandwidthEstimate(), bandwidth);
estimate_time = estimate_time.Add(srtt.Multiply(3));
- const int64 kSeconds = 556677;
+ const int64_t kSeconds = 556677;
QuicWallTime second_bandwidth_wall_time =
QuicWallTime::FromUNIXSeconds(kSeconds);
recorder.RecordEstimate(in_recovery, in_slow_start, second_bandwidth,
diff --git a/net/quic/quic_types.h b/net/quic/quic_types.h
index 2854a17..4f24e95 100644
--- a/net/quic/quic_types.h
+++ b/net/quic/quic_types.h
@@ -10,6 +10,7 @@
// including quic_protocol.h.
#include <stddef.h>
+
#include <ostream>
#include "net/base/net_export.h"
diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc
index ae0e0ed..74dde00 100644
--- a/net/quic/quic_unacked_packet_map.cc
+++ b/net/quic/quic_unacked_packet_map.cc
@@ -167,7 +167,7 @@
}
void QuicUnackedPacketMap::NackPacket(QuicPacketNumber packet_number,
- uint16 min_nacks) {
+ uint16_t min_nacks) {
DCHECK_GE(packet_number, least_unacked_);
DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size());
unacked_packets_[packet_number - least_unacked_].nack_count = max(
diff --git a/net/quic/quic_unacked_packet_map.h b/net/quic/quic_unacked_packet_map.h
index 1622264..51cd03e6 100644
--- a/net/quic/quic_unacked_packet_map.h
+++ b/net/quic/quic_unacked_packet_map.h
@@ -5,8 +5,11 @@
#ifndef NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_
#define NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_
+#include <stddef.h>
+
#include <deque>
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
namespace net {
@@ -41,7 +44,7 @@
bool IsUnacked(QuicPacketNumber packet_number) const;
// Sets the nack count to the max of the current nack count and |min_nacks|.
- void NackPacket(QuicPacketNumber packet_number, uint16 min_nacks);
+ void NackPacket(QuicPacketNumber packet_number, uint16_t min_nacks);
// Notifies all the AckListeners attached to the |info| and
// clears them to ensure they're not notified again.
diff --git a/net/quic/quic_unacked_packet_map_test.cc b/net/quic/quic_unacked_packet_map_test.cc
index b58a16db7..09596db 100644
--- a/net/quic/quic_unacked_packet_map_test.cc
+++ b/net/quic/quic_unacked_packet_map_test.cc
@@ -18,8 +18,8 @@
namespace {
// Default packet length.
-const uint32 kDefaultAckLength = 50;
-const uint32 kDefaultLength = 1000;
+const uint32_t kDefaultAckLength = 50;
+const uint32_t kDefaultLength = 1000;
class QuicUnackedPacketMapTest : public ::testing::Test {
protected:
diff --git a/net/quic/quic_utils.cc b/net/quic/quic_utils.cc
index 57c4adc..6748d6a 100644
--- a/net/quic/quic_utils.cc
+++ b/net/quic/quic_utils.cc
@@ -10,7 +10,6 @@
#include <algorithm>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/adapters.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
@@ -24,13 +23,13 @@
namespace net {
// static
-uint64 QuicUtils::FNV1a_64_Hash(const char* data, int len) {
- static const uint64 kOffset = UINT64_C(14695981039346656037);
- static const uint64 kPrime = UINT64_C(1099511628211);
+uint64_t QuicUtils::FNV1a_64_Hash(const char* data, int len) {
+ static const uint64_t kOffset = UINT64_C(14695981039346656037);
+ static const uint64_t kPrime = UINT64_C(1099511628211);
- const uint8* octets = reinterpret_cast<const uint8*>(data);
+ const uint8_t* octets = reinterpret_cast<const uint8_t*>(data);
- uint64 hash = kOffset;
+ uint64_t hash = kOffset;
for (int i = 0; i < len; ++i) {
hash = hash ^ octets[i];
@@ -67,7 +66,7 @@
uint128 QuicUtils::IncrementalHash(uint128 hash, const char* data, size_t len) {
// 309485009821345068724781371
const uint128 kPrime(16777216, 315);
- const uint8* octets = reinterpret_cast<const uint8*>(data);
+ const uint8_t* octets = reinterpret_cast<const uint8_t*>(data);
for (size_t i = 0; i < len; ++i) {
hash = hash ^ uint128(0, octets[i]);
hash = hash * kPrime;
@@ -123,9 +122,9 @@
}
// static
-void QuicUtils::SerializeUint128Short(uint128 v, uint8* out) {
- const uint64 lo = Uint128Low64(v);
- const uint64 hi = Uint128High64(v);
+void QuicUtils::SerializeUint128Short(uint128 v, uint8_t* out) {
+ const uint64_t lo = Uint128Low64(v);
+ const uint64_t hi = Uint128High64(v);
// This assumes that the system is little-endian.
memcpy(out, &lo, sizeof(lo));
memcpy(out + sizeof(lo), &hi, sizeof(hi) / 2);
@@ -300,7 +299,7 @@
for (const base::StringPiece& token :
base::SplitStringPiece(connection_options, ",", base::TRIM_WHITESPACE,
base::SPLIT_WANT_ALL)) {
- uint32 option = 0;
+ uint32_t option = 0;
for (char token_char : base::Reversed(token)) {
option <<= 8;
option |= static_cast<unsigned char>(token_char);
diff --git a/net/quic/quic_utils.h b/net/quic/quic_utils.h
index 017ad46..d1c0e109 100644
--- a/net/quic/quic_utils.h
+++ b/net/quic/quic_utils.h
@@ -7,8 +7,12 @@
#ifndef NET_QUIC_QUIC_UTILS_H_
#define NET_QUIC_QUIC_UTILS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/int128.h"
#include "net/base/net_export.h"
@@ -25,7 +29,7 @@
// Returns the 64 bit FNV1a hash of the data. See
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
- static uint64 FNV1a_64_Hash(const char* data, int len);
+ static uint64_t FNV1a_64_Hash(const char* data, int len);
// returns the 128 bit FNV1a hash of the data. See
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
@@ -59,7 +63,7 @@
// SerializeUint128 writes the first 96 bits of |v| in little-endian form
// to |out|.
- static void SerializeUint128Short(uint128 v, uint8* out);
+ static void SerializeUint128Short(uint128 v, uint8_t* out);
// Returns the name of the QuicRstStreamErrorCode as a char*
static const char* StreamErrorToString(QuicRstStreamErrorCode error);
diff --git a/net/quic/quic_utils_chromium.h b/net/quic/quic_utils_chromium.h
index 037d54d..daa34dd2 100644
--- a/net/quic/quic_utils_chromium.h
+++ b/net/quic/quic_utils_chromium.h
@@ -7,7 +7,6 @@
#ifndef NET_QUIC_QUIC_UTILS_CHROMIUM_H_
#define NET_QUIC_QUIC_UTILS_CHROMIUM_H_
-#include "base/basictypes.h"
#include "base/logging.h"
namespace net {
diff --git a/net/quic/quic_write_blocked_list.h b/net/quic/quic_write_blocked_list.h
index 5e24b80..ad511877 100644
--- a/net/quic/quic_write_blocked_list.h
+++ b/net/quic/quic_write_blocked_list.h
@@ -5,8 +5,12 @@
#ifndef NET_QUIC_QUIC_WRITE_BLOCKED_LIST_H_
#define NET_QUIC_QUIC_WRITE_BLOCKED_LIST_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <set>
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/quic_flags.h"
#include "net/quic/quic_protocol.h"
@@ -120,7 +124,7 @@
// If this was the last data stream popped by PopFront, update the
// bytes remaining in its batch write.
bytes_left_for_batch_write_[last_priority_popped_] -=
- static_cast<int32>(bytes);
+ static_cast<int32_t>(bytes);
} else {
// If a batch write stream was set, it should only be preempted by the
// crypto or headers streams. Any higher priority data stream would
@@ -185,7 +189,7 @@
// Set to kBatchWriteSize when we set a new batch_write_stream_id_ for a given
// priority. This is decremented with each write the stream does until it is
// done with its batch write.
- int32 bytes_left_for_batch_write_[kV3LowestPriority + 1];
+ int32_t bytes_left_for_batch_write_[kV3LowestPriority + 1];
// Tracks the last priority popped for UpdateBytesForStream.
SpdyPriority last_priority_popped_;
diff --git a/net/quic/reliable_quic_stream.cc b/net/quic/reliable_quic_stream.cc
index 399581e..65602d9 100644
--- a/net/quic/reliable_quic_stream.cc
+++ b/net/quic/reliable_quic_stream.cc
@@ -421,7 +421,7 @@
bool ReliableQuicStream::MaybeIncreaseHighestReceivedOffset(
QuicStreamOffset new_offset) {
- uint64 increment =
+ uint64_t increment =
new_offset - flow_controller_.highest_received_byte_offset();
if (!flow_controller_.UpdateHighestReceivedOffset(new_offset)) {
return false;
diff --git a/net/quic/reliable_quic_stream.h b/net/quic/reliable_quic_stream.h
index 6040198..dfb86b3 100644
--- a/net/quic/reliable_quic_stream.h
+++ b/net/quic/reliable_quic_stream.h
@@ -17,12 +17,14 @@
#ifndef NET_QUIC_RELIABLE_QUIC_STREAM_H_
#define NET_QUIC_RELIABLE_QUIC_STREAM_H_
+#include <stddef.h>
+#include <stdint.h>
#include <sys/types.h>
#include <list>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_piece.h"
#include "net/base/iovec.h"
@@ -112,10 +114,10 @@
bool fin_received() { return fin_received_; }
bool fin_sent() { return fin_sent_; }
- uint64 queued_data_bytes() const { return queued_data_bytes_; }
+ uint64_t queued_data_bytes() const { return queued_data_bytes_; }
- uint64 stream_bytes_read() const { return stream_bytes_read_; }
- uint64 stream_bytes_written() const { return stream_bytes_written_; }
+ uint64_t stream_bytes_read() const { return stream_bytes_read_; }
+ uint64_t stream_bytes_written() const { return stream_bytes_written_; }
void set_fin_sent(bool fin_sent) { fin_sent_ = fin_sent; }
void set_fin_received(bool fin_received) { fin_received_ = fin_received; }
@@ -248,7 +250,7 @@
std::list<PendingData> queued_data_;
// How many bytes are queued?
- uint64 queued_data_bytes_;
+ uint64_t queued_data_bytes_;
QuicStreamSequencer sequencer_;
QuicStreamId id_;
@@ -256,8 +258,8 @@
QuicSession* session_;
// Bytes read and written refer to payload bytes only: they do not include
// framing, encryption overhead etc.
- uint64 stream_bytes_read_;
- uint64 stream_bytes_written_;
+ uint64_t stream_bytes_read_;
+ uint64_t stream_bytes_written_;
// Stream error code received from a RstStreamFrame or error code sent by the
// visitor or sequencer in the RstStreamFrame.
diff --git a/net/quic/reliable_quic_stream_test.cc b/net/quic/reliable_quic_stream_test.cc
index daedd307..73973ffc 100644
--- a/net/quic/reliable_quic_stream_test.cc
+++ b/net/quic/reliable_quic_stream_test.cc
@@ -51,7 +51,7 @@
void OnDataAvailable() override {}
- uint32 ProcessRawData(const char* data, uint32 data_len) {
+ uint32_t ProcessRawData(const char* data, uint32_t data_len) {
EXPECT_NE(0u, data_len);
DVLOG(1) << "ProcessData data_len: " << data_len;
data_ += string(data, data_len);
@@ -129,7 +129,7 @@
bool fin_sent() { return ReliableQuicStreamPeer::FinSent(stream_); }
bool rst_sent() { return ReliableQuicStreamPeer::RstSent(stream_); }
- void set_initial_flow_control_window_bytes(uint32 val) {
+ void set_initial_flow_control_window_bytes(uint32_t val) {
initial_flow_control_window_bytes_ = val;
}
@@ -156,7 +156,7 @@
TestStream* stream_;
SpdyHeaderBlock headers_;
QuicWriteBlockedList* write_blocked_list_;
- uint32 initial_flow_control_window_bytes_;
+ uint32_t initial_flow_control_window_bytes_;
QuicTime::Delta zero_;
QuicVersionVector supported_versions_;
const QuicStreamId kTestStreamId = 5u;
diff --git a/net/quic/spdy_utils.cc b/net/quic/spdy_utils.cc
index 6703d3d..3ff1527 100644
--- a/net/quic/spdy_utils.cc
+++ b/net/quic/spdy_utils.cc
@@ -32,7 +32,7 @@
// static
bool SpdyUtils::ParseHeaders(const char* data,
- uint32 data_len,
+ uint32_t data_len,
int* content_length,
SpdyHeaderBlock* headers) {
SpdyFramer framer(HTTP2);
@@ -67,7 +67,7 @@
// static
bool SpdyUtils::ParseTrailers(const char* data,
- uint32 data_len,
+ uint32_t data_len,
size_t* final_byte_offset,
SpdyHeaderBlock* trailers) {
SpdyFramer framer(HTTP2);
diff --git a/net/quic/spdy_utils.h b/net/quic/spdy_utils.h
index 8c50cf2..b0d8a597 100644
--- a/net/quic/spdy_utils.h
+++ b/net/quic/spdy_utils.h
@@ -5,9 +5,13 @@
#ifndef NET_QUIC_SPDY_UTILS_H_
#define NET_QUIC_SPDY_UTILS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
#include <string>
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/quic/quic_protocol.h"
#include "net/spdy/spdy_framer.h"
@@ -25,7 +29,7 @@
// header if one or more are present.
// Returns true on success, false if parsing fails, or invalid keys are found.
static bool ParseHeaders(const char* data,
- uint32 data_len,
+ uint32_t data_len,
int* content_length,
SpdyHeaderBlock* headers);
@@ -35,7 +39,7 @@
// value will be copied to |final_byte_offset|.
// Returns true on success, false if parsing fails, or invalid keys are found.
static bool ParseTrailers(const char* data,
- uint32 data_len,
+ uint32_t data_len,
size_t* final_byte_offset,
SpdyHeaderBlock* trailers);
diff --git a/net/quic/stream_sequencer_buffer.cc b/net/quic/stream_sequencer_buffer.cc
index 161cc49..a54f13cf 100644
--- a/net/quic/stream_sequencer_buffer.cc
+++ b/net/quic/stream_sequencer_buffer.cc
@@ -4,7 +4,6 @@
#include "net/quic/stream_sequencer_buffer.h"
-#include "base/basictypes.h"
#include "base/logging.h"
using std::min;
diff --git a/net/quic/stream_sequencer_buffer.h b/net/quic/stream_sequencer_buffer.h
index efb8bbbf..64a7959c 100644
--- a/net/quic/stream_sequencer_buffer.h
+++ b/net/quic/stream_sequencer_buffer.h
@@ -60,6 +60,8 @@
// size_t consumed = consume_iovs(iovs, iov_count);
// buffer.MarkConsumed(consumed);
+#include <stddef.h>
+
#include <functional>
#include <list>
#include <memory>
diff --git a/net/quic/stream_sequencer_buffer_test.cc b/net/quic/stream_sequencer_buffer_test.cc
index c85de86..ccebb73 100644
--- a/net/quic/stream_sequencer_buffer_test.cc
+++ b/net/quic/stream_sequencer_buffer_test.cc
@@ -763,7 +763,7 @@
bytes_to_buffer_ = 2 * max_capacity_bytes_;
Initialize();
- uint32 seed = base::RandInt(0, std::numeric_limits<int32>::max());
+ uint32_t seed = base::RandInt(0, std::numeric_limits<int32_t>::max());
LOG(INFO) << "RandomWriteAndProcessInPlace test seed is " << seed;
rng_.set_seed(seed);
}
@@ -855,8 +855,8 @@
while ((!shuffled_buf_.empty() || total_bytes_read_ < bytes_to_buffer_) &&
iterations <= 2 * bytes_to_buffer_) {
- uint8 next_action =
- shuffled_buf_.empty() ? uint8{1} : rng_.RandUint64() % 2;
+ uint8_t next_action =
+ shuffled_buf_.empty() ? uint8_t{1} : rng_.RandUint64() % 2;
DVLOG(1) << "iteration: " << iterations;
switch (next_action) {
case 0: { // write
@@ -913,8 +913,8 @@
while ((!shuffled_buf_.empty() || total_bytes_read_ < bytes_to_buffer_) &&
iterations <= 2 * bytes_to_buffer_) {
- uint8 next_action =
- shuffled_buf_.empty() ? uint8{1} : rng_.RandUint64() % 2;
+ uint8_t next_action =
+ shuffled_buf_.empty() ? uint8_t{1} : rng_.RandUint64() % 2;
DVLOG(1) << "iteration: " << iterations;
switch (next_action) {
case 0: { // write
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc
index de4360e..8f46d92 100644
--- a/net/quic/test_tools/crypto_test_utils.cc
+++ b/net/quic/test_tools/crypto_test_utils.cc
@@ -54,7 +54,7 @@
// HexChar parses |c| as a hex character. If valid, it sets |*value| to the
// value of the hex character and returns true. Otherwise it returns false.
-bool HexChar(char c, uint8* value) {
+bool HexChar(char c, uint8_t* value) {
if (c >= '0' && c <= '9') {
*value = c - '0';
return true;
@@ -288,7 +288,7 @@
class MockCommonCertSets : public CommonCertSets {
public:
- MockCommonCertSets(StringPiece cert, uint64 hash, uint32 index)
+ MockCommonCertSets(StringPiece cert, uint64_t hash, uint32_t index)
: cert_(cert.as_string()), hash_(hash), index_(index) {}
StringPiece GetCommonHashes() const override {
@@ -296,7 +296,7 @@
return StringPiece();
}
- StringPiece GetCert(uint64 hash, uint32 index) const override {
+ StringPiece GetCert(uint64_t hash, uint32_t index) const override {
if (hash == hash_ && index == index_) {
return cert_;
}
@@ -305,18 +305,18 @@
bool MatchCert(StringPiece cert,
StringPiece common_set_hashes,
- uint64* out_hash,
- uint32* out_index) const override {
+ uint64_t* out_hash,
+ uint32_t* out_index) const override {
if (cert != cert_) {
return false;
}
- if (common_set_hashes.size() % sizeof(uint64) != 0) {
+ if (common_set_hashes.size() % sizeof(uint64_t) != 0) {
return false;
}
bool client_has_set = false;
- for (size_t i = 0; i < common_set_hashes.size(); i += sizeof(uint64)) {
- uint64 hash;
+ for (size_t i = 0; i < common_set_hashes.size(); i += sizeof(uint64_t)) {
+ uint64_t hash;
memcpy(&hash, common_set_hashes.data() + i, sizeof(hash));
if (hash == hash_) {
client_has_set = true;
@@ -335,13 +335,13 @@
private:
const string cert_;
- const uint64 hash_;
- const uint32 index_;
+ const uint64_t hash_;
+ const uint32_t index_;
};
CommonCertSets* CryptoTestUtils::MockCommonCertSets(StringPiece cert,
- uint64 hash,
- uint32 index) {
+ uint64_t hash,
+ uint32_t index) {
return new class MockCommonCertSets(cert, hash, index);
}
@@ -505,7 +505,7 @@
for (size_t i = 0; i < 8; i++) {
tag <<= 4;
- uint8 v = 0;
+ uint8_t v = 0;
CHECK(HexChar(tagstr[i], &v));
tag |= v;
}
@@ -517,7 +517,7 @@
for (size_t i = 0; i < 4; i++) {
tag >>= 8;
if (i < len) {
- tag |= static_cast<uint32>(tagstr[i]) << 24;
+ tag |= static_cast<uint32_t>(tagstr[i]) << 24;
}
}
@@ -560,10 +560,10 @@
len--;
CHECK_EQ(0u, len % 2);
- scoped_ptr<uint8[]> buf(new uint8[len / 2]);
+ scoped_ptr<uint8_t[]> buf(new uint8_t[len / 2]);
for (size_t i = 0; i < len / 2; i++) {
- uint8 v = 0;
+ uint8_t v = 0;
CHECK(HexChar(valuestr[i * 2], &v));
buf[i] = v << 4;
CHECK(HexChar(valuestr[i * 2 + 1], &v));
diff --git a/net/quic/test_tools/crypto_test_utils.h b/net/quic/test_tools/crypto_test_utils.h
index 56b07507..6d2ad00 100644
--- a/net/quic/test_tools/crypto_test_utils.h
+++ b/net/quic/test_tools/crypto_test_utils.h
@@ -6,12 +6,14 @@
#define NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_
#include <stdarg.h>
+#include <stddef.h>
+#include <stdint.h>
#include <utility>
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/quic/crypto/crypto_framer.h"
#include "net/quic/quic_framer.h"
@@ -153,8 +155,8 @@
// MockCommonCertSets returns a CommonCertSets that contains a single set with
// hash |hash|, consisting of the certificate |cert| at index |index|.
static CommonCertSets* MockCommonCertSets(base::StringPiece cert,
- uint64 hash,
- uint32 index);
+ uint64_t hash,
+ uint32_t index);
// Creates a minimal dummy reject message that will pass the client-config
// validation tests. This will include a server config, but no certs, proof
diff --git a/net/quic/test_tools/crypto_test_utils_chromium.cc b/net/quic/test_tools/crypto_test_utils_chromium.cc
index f3ccf98..9cc1368 100644
--- a/net/quic/test_tools/crypto_test_utils_chromium.cc
+++ b/net/quic/test_tools/crypto_test_utils_chromium.cc
@@ -6,6 +6,7 @@
#include "base/callback_helpers.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
diff --git a/net/quic/test_tools/crypto_test_utils_openssl.cc b/net/quic/test_tools/crypto_test_utils_openssl.cc
index a7f968d..80228ee 100644
--- a/net/quic/test_tools/crypto_test_utils_openssl.cc
+++ b/net/quic/test_tools/crypto_test_utils_openssl.cc
@@ -49,21 +49,21 @@
return false;
}
- scoped_ptr<uint8[]> der_sig(new uint8[sig_len]);
+ scoped_ptr<uint8_t[]> der_sig(new uint8_t[sig_len]);
if (!EVP_DigestSignFinal(md_ctx.get(), der_sig.get(), &sig_len)) {
return false;
}
- uint8* derp = der_sig.get();
+ uint8_t* derp = der_sig.get();
crypto::ScopedECDSA_SIG sig(
- d2i_ECDSA_SIG(nullptr, const_cast<const uint8**>(&derp), sig_len));
+ d2i_ECDSA_SIG(nullptr, const_cast<const uint8_t**>(&derp), sig_len));
if (sig.get() == nullptr) {
return false;
}
// The signature consists of a pair of 32-byte numbers.
static const size_t kSignatureLength = 32 * 2;
- scoped_ptr<uint8[]> signature(new uint8[kSignatureLength]);
+ scoped_ptr<uint8_t[]> signature(new uint8_t[kSignatureLength]);
if (!BN_bn2bin_padded(&signature[0], 32, sig->r) ||
!BN_bn2bin_padded(&signature[32], 32, sig->s)) {
return false;
@@ -86,8 +86,8 @@
return "";
}
- uint8 buf[kExpectedKeyLength];
- uint8* derp = buf;
+ uint8_t buf[kExpectedKeyLength];
+ uint8_t* derp = buf;
i2d_PublicKey(ecdsa_key_.get(), &derp);
return string(reinterpret_cast<char*>(buf + 1), kExpectedKeyLength - 1);
diff --git a/net/quic/test_tools/delayed_verify_strike_register_client.cc b/net/quic/test_tools/delayed_verify_strike_register_client.cc
index f971cac..f65852f1 100644
--- a/net/quic/test_tools/delayed_verify_strike_register_client.cc
+++ b/net/quic/test_tools/delayed_verify_strike_register_client.cc
@@ -13,9 +13,9 @@
DelayedVerifyStrikeRegisterClient::DelayedVerifyStrikeRegisterClient(
unsigned max_entries,
- uint32 current_time_external,
- uint32 window_secs,
- const uint8 orbit[8],
+ uint32_t current_time_external,
+ uint32_t window_secs,
+ const uint8_t orbit[8],
StrikeRegister::StartupType startup)
: LocalStrikeRegisterClient(max_entries,
current_time_external,
diff --git a/net/quic/test_tools/delayed_verify_strike_register_client.h b/net/quic/test_tools/delayed_verify_strike_register_client.h
index 33d13f89..8d14647b 100644
--- a/net/quic/test_tools/delayed_verify_strike_register_client.h
+++ b/net/quic/test_tools/delayed_verify_strike_register_client.h
@@ -5,9 +5,12 @@
#ifndef NET_QUIC_TEST_TOOLS_DELAYED_VERIFY_STRIKE_REGISTER_CLIENT_H_
#define NET_QUIC_TEST_TOOLS_DELAYED_VERIFY_STRIKE_REGISTER_CLIENT_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/quic/crypto/local_strike_register_client.h"
@@ -19,9 +22,9 @@
class DelayedVerifyStrikeRegisterClient : public LocalStrikeRegisterClient {
public:
DelayedVerifyStrikeRegisterClient(unsigned max_entries,
- uint32 current_time_external,
- uint32 window_secs,
- const uint8 orbit[8],
+ uint32_t current_time_external,
+ uint32_t window_secs,
+ const uint8_t orbit[8],
StrikeRegister::StartupType startup);
~DelayedVerifyStrikeRegisterClient() override;
diff --git a/net/quic/test_tools/mock_clock.h b/net/quic/test_tools/mock_clock.h
index 30c76ddf..9364724 100644
--- a/net/quic/test_tools/mock_clock.h
+++ b/net/quic/test_tools/mock_clock.h
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/time/time.h"
namespace net {
diff --git a/net/quic/test_tools/mock_crypto_client_stream.h b/net/quic/test_tools/mock_crypto_client_stream.h
index 6de68ddf..e9281ab 100644
--- a/net/quic/test_tools/mock_crypto_client_stream.h
+++ b/net/quic/test_tools/mock_crypto_client_stream.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "net/quic/crypto/crypto_handshake.h"
#include "net/quic/crypto/crypto_protocol.h"
#include "net/quic/quic_crypto_client_stream.h"
diff --git a/net/quic/test_tools/mock_crypto_client_stream_factory.h b/net/quic/test_tools/mock_crypto_client_stream_factory.h
index 207e28a2..11beaa6f 100644
--- a/net/quic/test_tools/mock_crypto_client_stream_factory.h
+++ b/net/quic/test_tools/mock_crypto_client_stream_factory.h
@@ -8,6 +8,7 @@
#include <queue>
#include <string>
+#include "base/macros.h"
#include "net/quic/quic_crypto_client_stream.h"
#include "net/quic/quic_crypto_client_stream_factory.h"
#include "net/quic/test_tools/mock_crypto_client_stream.h"
diff --git a/net/quic/test_tools/mock_quic_dispatcher.h b/net/quic/test_tools/mock_quic_dispatcher.h
index 1c0c4f8..b3bc85a 100644
--- a/net/quic/test_tools/mock_quic_dispatcher.h
+++ b/net/quic/test_tools/mock_quic_dispatcher.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_TEST_TOOLS_MOCK_QUIC_DISPATCHER_H_
#define NET_QUIC_TEST_TOOLS_MOCK_QUIC_DISPATCHER_H_
+#include "base/macros.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/crypto/quic_crypto_server_config.h"
#include "net/quic/quic_config.h"
diff --git a/net/quic/test_tools/mock_random.cc b/net/quic/test_tools/mock_random.cc
index a8a8e53b..87977be 100644
--- a/net/quic/test_tools/mock_random.cc
+++ b/net/quic/test_tools/mock_random.cc
@@ -9,13 +9,13 @@
MockRandom::MockRandom() : base_(0xDEADBEEF), increment_(0) {}
-MockRandom::MockRandom(uint32 base) : base_(base), increment_(0) {}
+MockRandom::MockRandom(uint32_t base) : base_(base), increment_(0) {}
void MockRandom::RandBytes(void* data, size_t len) {
memset(data, 'r' + increment_, len);
}
-uint64 MockRandom::RandUint64() {
+uint64_t MockRandom::RandUint64() {
return base_ + increment_;
}
diff --git a/net/quic/test_tools/mock_random.h b/net/quic/test_tools/mock_random.h
index 7c26ed49..0394cb9 100644
--- a/net/quic/test_tools/mock_random.h
+++ b/net/quic/test_tools/mock_random.h
@@ -5,7 +5,11 @@
#ifndef NET_QUIC_TEST_TOOLS_MOCK_RANDOM_H_
#define NET_QUIC_TEST_TOOLS_MOCK_RANDOM_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/quic/crypto/quic_random.h"
namespace net {
@@ -15,13 +19,13 @@
public:
// Initializes base_ to 0xDEADBEEF.
MockRandom();
- explicit MockRandom(uint32 base);
+ explicit MockRandom(uint32_t base);
// QuicRandom:
// Fills the |data| buffer with a repeating byte, initially 'r'.
void RandBytes(void* data, size_t len) override;
// Returns base + the current increment.
- uint64 RandUint64() override;
+ uint64_t RandUint64() override;
// Does nothing.
void Reseed(const void* additional_entropy, size_t entropy_len) override;
@@ -30,8 +34,8 @@
void ChangeValue();
private:
- uint32 base_;
- uint8 increment_;
+ uint32_t base_;
+ uint8_t increment_;
DISALLOW_COPY_AND_ASSIGN(MockRandom);
};
diff --git a/net/quic/test_tools/quic_chromium_client_session_peer.h b/net/quic/test_tools/quic_chromium_client_session_peer.h
index 6b06abef..4000bd7 100644
--- a/net/quic/test_tools/quic_chromium_client_session_peer.h
+++ b/net/quic/test_tools/quic_chromium_client_session_peer.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_CHROMIUM_CLIENT_SESSION_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_CHROMIUM_CLIENT_SESSION_PEER_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
namespace net {
diff --git a/net/quic/test_tools/quic_config_peer.cc b/net/quic/test_tools/quic_config_peer.cc
index 05f7538..84fa190 100644
--- a/net/quic/test_tools/quic_config_peer.cc
+++ b/net/quic/test_tools/quic_config_peer.cc
@@ -12,14 +12,14 @@
// static
void QuicConfigPeer::SetReceivedSocketReceiveBuffer(
QuicConfig* config,
- uint32 receive_buffer_bytes) {
+ uint32_t receive_buffer_bytes) {
config->socket_receive_buffer_.SetReceivedValue(receive_buffer_bytes);
}
// static
void QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow(
QuicConfig* config,
- uint32 window_bytes) {
+ uint32_t window_bytes) {
config->initial_stream_flow_control_window_bytes_.SetReceivedValue(
window_bytes);
}
@@ -27,7 +27,7 @@
// static
void QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(
QuicConfig* config,
- uint32 window_bytes) {
+ uint32_t window_bytes) {
config->initial_session_flow_control_window_bytes_.SetReceivedValue(
window_bytes);
}
@@ -41,7 +41,7 @@
// static
void QuicConfigPeer::SetReceivedBytesForConnectionId(QuicConfig* config,
- uint32 bytes) {
+ uint32_t bytes) {
config->bytes_for_connection_id_.SetReceivedValue(bytes);
}
diff --git a/net/quic/test_tools/quic_config_peer.h b/net/quic/test_tools/quic_config_peer.h
index ca2a3391..c212270 100644
--- a/net/quic/test_tools/quic_config_peer.h
+++ b/net/quic/test_tools/quic_config_peer.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_CONFIG_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_CONFIG_PEER_H_
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/quic/quic_config.h"
#include "net/quic/quic_protocol.h"
@@ -17,18 +20,19 @@
class QuicConfigPeer {
public:
static void SetReceivedSocketReceiveBuffer(QuicConfig* config,
- uint32 receive_buffer_bytes);
+ uint32_t receive_buffer_bytes);
static void SetReceivedInitialStreamFlowControlWindow(QuicConfig* config,
- uint32 window_bytes);
+ uint32_t window_bytes);
static void SetReceivedInitialSessionFlowControlWindow(QuicConfig* config,
- uint32 window_bytes);
+ uint32_t window_bytes);
static void SetReceivedConnectionOptions(QuicConfig* config,
const QuicTagVector& options);
- static void SetReceivedBytesForConnectionId(QuicConfig* config, uint32 bytes);
+ static void SetReceivedBytesForConnectionId(QuicConfig* config,
+ uint32_t bytes);
private:
DISALLOW_COPY_AND_ASSIGN(QuicConfigPeer);
diff --git a/net/quic/test_tools/quic_connection_peer.h b/net/quic/test_tools/quic_connection_peer.h
index 4f591ac..2f97c51f 100644
--- a/net/quic/test_tools/quic_connection_peer.h
+++ b/net/quic/test_tools/quic_connection_peer.h
@@ -5,7 +5,7 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_CONNECTION_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_CONNECTION_PEER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/quic_connection_stats.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/test_tools/quic_flow_controller_peer.h b/net/quic/test_tools/quic_flow_controller_peer.h
index 3d7c9d0..59ef7c2 100644
--- a/net/quic/test_tools/quic_flow_controller_peer.h
+++ b/net/quic/test_tools/quic_flow_controller_peer.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_FLOW_CONTROLLER_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_FLOW_CONTROLLER_PEER_H_
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
namespace net {
diff --git a/net/quic/test_tools/quic_framer_peer.h b/net/quic/test_tools/quic_framer_peer.h
index 6716aa10..2dd5774 100644
--- a/net/quic/test_tools/quic_framer_peer.h
+++ b/net/quic/test_tools/quic_framer_peer.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_FRAMER_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_FRAMER_PEER_H_
+#include "base/macros.h"
#include "net/quic/crypto/quic_encrypter.h"
#include "net/quic/quic_framer.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/test_tools/quic_packet_creator_peer.h b/net/quic/test_tools/quic_packet_creator_peer.h
index dafafd1..a5ac0ed 100644
--- a/net/quic/test_tools/quic_packet_creator_peer.h
+++ b/net/quic/test_tools/quic_packet_creator_peer.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_PACKET_CREATOR_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_PACKET_CREATOR_PEER_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
namespace net {
diff --git a/net/quic/test_tools/quic_packet_generator_peer.h b/net/quic/test_tools/quic_packet_generator_peer.h
index 0762d1f..246684f 100644
--- a/net/quic/test_tools/quic_packet_generator_peer.h
+++ b/net/quic/test_tools/quic_packet_generator_peer.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_PACKET_GENERATOR_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_PACKET_GENERATOR_PEER_H_
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
namespace net {
diff --git a/net/quic/test_tools/quic_received_packet_manager_peer.h b/net/quic/test_tools/quic_received_packet_manager_peer.h
index 957acad..10612612 100644
--- a/net/quic/test_tools/quic_received_packet_manager_peer.h
+++ b/net/quic/test_tools/quic_received_packet_manager_peer.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_RECEIVED_PACKET_MANAGER_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_RECEIVED_PACKET_MANAGER_PEER_H_
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
namespace net {
diff --git a/net/quic/test_tools/quic_sent_packet_manager_peer.h b/net/quic/test_tools/quic_sent_packet_manager_peer.h
index deb6c47..d7f28eb 100644
--- a/net/quic/test_tools/quic_sent_packet_manager_peer.h
+++ b/net/quic/test_tools/quic_sent_packet_manager_peer.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_sent_packet_manager.h"
diff --git a/net/quic/test_tools/quic_session_peer.cc b/net/quic/test_tools/quic_session_peer.cc
index cbf0ab46..64ca722 100644
--- a/net/quic/test_tools/quic_session_peer.cc
+++ b/net/quic/test_tools/quic_session_peer.cc
@@ -26,7 +26,7 @@
// static
void QuicSessionPeer::SetMaxOpenStreams(QuicSession* session,
- uint32 max_streams) {
+ uint32_t max_streams) {
session->max_open_streams_ = max_streams;
}
diff --git a/net/quic/test_tools/quic_session_peer.h b/net/quic/test_tools/quic_session_peer.h
index 5ff9da98..bf9af69 100644
--- a/net/quic/test_tools/quic_session_peer.h
+++ b/net/quic/test_tools/quic_session_peer.h
@@ -5,9 +5,12 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_SESSION_PEER_H_
+#include <stdint.h>
+
#include <map>
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_session.h"
#include "net/quic/quic_write_blocked_list.h"
@@ -26,7 +29,7 @@
public:
static QuicStreamId GetNextOutgoingStreamId(QuicSession* session);
static void SetNextOutgoingStreamId(QuicSession* session, QuicStreamId id);
- static void SetMaxOpenStreams(QuicSession* session, uint32 max_streams);
+ static void SetMaxOpenStreams(QuicSession* session, uint32_t max_streams);
static QuicCryptoStream* GetCryptoStream(QuicSession* session);
static QuicWriteBlockedList* GetWriteBlockedStreams(QuicSession* session);
static ReliableQuicStream* GetOrCreateDynamicStream(QuicSession* session,
diff --git a/net/quic/test_tools/quic_spdy_session_peer.h b/net/quic/test_tools/quic_spdy_session_peer.h
index 840f3dc..d6597c75 100644
--- a/net/quic/test_tools/quic_spdy_session_peer.h
+++ b/net/quic/test_tools/quic_spdy_session_peer.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_SPDY_SESSION_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_SPDY_SESSION_PEER_H_
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_write_blocked_list.h"
diff --git a/net/quic/test_tools/quic_spdy_stream_peer.h b/net/quic/test_tools/quic_spdy_stream_peer.h
index ff20c3c..49ee55c 100644
--- a/net/quic/test_tools/quic_spdy_stream_peer.h
+++ b/net/quic/test_tools/quic_spdy_stream_peer.h
@@ -5,7 +5,7 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_SPDY_STREAM_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_SPDY_STREAM_PEER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
namespace net {
diff --git a/net/quic/test_tools/quic_stream_factory_peer.cc b/net/quic/test_tools/quic_stream_factory_peer.cc
index 7f002fb..99c4ef3f 100644
--- a/net/quic/test_tools/quic_stream_factory_peer.cc
+++ b/net/quic/test_tools/quic_stream_factory_peer.cc
@@ -64,12 +64,12 @@
int QuicStreamFactoryPeer::GetNumberOfLossyConnections(
QuicStreamFactory* factory,
- uint16 port) {
+ uint16_t port) {
return factory->number_of_lossy_connections_[port];
}
bool QuicStreamFactoryPeer::IsQuicDisabled(QuicStreamFactory* factory,
- uint16 port) {
+ uint16_t port) {
return factory->IsQuicDisabled(port);
}
diff --git a/net/quic/test_tools/quic_stream_factory_peer.h b/net/quic/test_tools/quic_stream_factory_peer.h
index d8ddf2d..2f73176 100644
--- a/net/quic/test_tools/quic_stream_factory_peer.h
+++ b/net/quic/test_tools/quic_stream_factory_peer.h
@@ -5,7 +5,10 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+#include <stdint.h>
+
+#include "base/macros.h"
#include "base/task_runner.h"
#include "net/base/host_port_pair.h"
#include "net/base/privacy_mode.h"
@@ -47,9 +50,9 @@
base::TaskRunner* task_runner);
static int GetNumberOfLossyConnections(QuicStreamFactory* factory,
- uint16 port);
+ uint16_t port);
- static bool IsQuicDisabled(QuicStreamFactory* factory, uint16 port);
+ static bool IsQuicDisabled(QuicStreamFactory* factory, uint16_t port);
static bool GetDelayTcpRace(QuicStreamFactory* factory);
diff --git a/net/quic/test_tools/quic_stream_sequencer_peer.h b/net/quic/test_tools/quic_stream_sequencer_peer.h
index e8421c16..f25c8984 100644
--- a/net/quic/test_tools/quic_stream_sequencer_peer.h
+++ b/net/quic/test_tools/quic_stream_sequencer_peer.h
@@ -5,7 +5,9 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_STREAM_SEQUENCER_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_STREAM_SEQUENCER_PEER_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/quic_frame_list.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.cc b/net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.cc
index fd3678cc..6779aeac 100644
--- a/net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.cc
+++ b/net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.cc
@@ -13,7 +13,7 @@
// static
void QuicSustainedBandwidthRecorderPeer::SetBandwidthEstimate(
QuicSustainedBandwidthRecorder* bandwidth_recorder,
- int32 bandwidth_estimate_kbytes_per_second) {
+ int32_t bandwidth_estimate_kbytes_per_second) {
bandwidth_recorder->has_estimate_ = true;
bandwidth_recorder->bandwidth_estimate_ =
QuicBandwidth::FromKBytesPerSecond(bandwidth_estimate_kbytes_per_second);
@@ -22,8 +22,8 @@
// static
void QuicSustainedBandwidthRecorderPeer::SetMaxBandwidthEstimate(
QuicSustainedBandwidthRecorder* bandwidth_recorder,
- int32 max_bandwidth_estimate_kbytes_per_second,
- int32 max_bandwidth_timestamp) {
+ int32_t max_bandwidth_estimate_kbytes_per_second,
+ int32_t max_bandwidth_timestamp) {
bandwidth_recorder->max_bandwidth_estimate_ =
QuicBandwidth::FromKBytesPerSecond(
max_bandwidth_estimate_kbytes_per_second);
diff --git a/net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h b/net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h
index 161a94e..186dbb6 100644
--- a/net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h
+++ b/net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_SUSTAINED_BANDWIDTH_RECORDER_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_SUSTAINED_BANDWIDTH_RECORDER_PEER_H_
+#include <stdint.h>
+
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
namespace net {
@@ -17,12 +20,12 @@
public:
static void SetBandwidthEstimate(
QuicSustainedBandwidthRecorder* bandwidth_recorder,
- int32 bandwidth_estimate_kbytes_per_second);
+ int32_t bandwidth_estimate_kbytes_per_second);
static void SetMaxBandwidthEstimate(
QuicSustainedBandwidthRecorder* bandwidth_recorder,
- int32 max_bandwidth_estimate_kbytes_per_second,
- int32 max_bandwidth_timestamp);
+ int32_t max_bandwidth_estimate_kbytes_per_second,
+ int32_t max_bandwidth_timestamp);
private:
DISALLOW_COPY_AND_ASSIGN(QuicSustainedBandwidthRecorderPeer);
diff --git a/net/quic/test_tools/quic_test_packet_maker.h b/net/quic/test_tools/quic_test_packet_maker.h
index 7806ec4..a63bbfa 100644
--- a/net/quic/test_tools/quic_test_packet_maker.h
+++ b/net/quic/test_tools/quic_test_packet_maker.h
@@ -7,6 +7,9 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/request_priority.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
index 37e29959..2f82c41 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -93,7 +93,7 @@
header.public_header.packet_number_length);
}
-uint64 SimpleRandom::RandUint64() {
+uint64_t SimpleRandom::RandUint64() {
unsigned char hash[base::kSHA1Length];
base::SHA1HashBytes(reinterpret_cast<unsigned char*>(&seed_), sizeof(seed_),
hash);
@@ -602,7 +602,7 @@
bytes->clear();
if (hex.empty())
return true;
- std::vector<uint8> v;
+ std::vector<uint8_t> v;
if (!base::HexStringToBytes(hex.as_string(), &v))
return false;
if (!v.empty())
@@ -803,7 +803,7 @@
*server_connection, DefaultQuicConfig(), server_crypto_config);
// We advance the clock initially because the default time is zero and the
- // strike register worries that we've just overflowed a uint32 time.
+ // strike register worries that we've just overflowed a uint32_t time.
(*server_connection)->AdvanceTime(connection_start_time);
}
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h
index 05b3ac6f..0da5ff6f 100644
--- a/net/quic/test_tools/quic_test_utils.h
+++ b/net/quic/test_tools/quic_test_utils.h
@@ -7,10 +7,13 @@
#ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
#define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/quic/congestion_control/loss_detection_interface.h"
#include "net/quic/congestion_control/send_algorithm_interface.h"
@@ -34,10 +37,10 @@
namespace test {
static const QuicConnectionId kTestConnectionId = 42;
-static const uint16 kTestPort = 123;
-static const uint32 kInitialStreamFlowControlWindowForTest =
+static const uint16_t kTestPort = 123;
+static const uint32_t kInitialStreamFlowControlWindowForTest =
1024 * 1024; // 1 MB
-static const uint32 kInitialSessionFlowControlWindowForTest =
+static const uint32_t kInitialSessionFlowControlWindowForTest =
1536 * 1024; // 1.5 MB
// Data stream IDs start at 5: the crypto stream is 1, headers stream is 3.
static const QuicStreamId kClientDataStreamId1 = 5;
@@ -184,12 +187,12 @@
SimpleRandom() : seed_(0) {}
// Returns a random number in the range [0, kuint64max].
- uint64 RandUint64();
+ uint64_t RandUint64();
- void set_seed(uint64 seed) { seed_ = seed; }
+ void set_seed(uint64_t seed) { seed_ = seed; }
private:
- uint64 seed_;
+ uint64_t seed_;
DISALLOW_COPY_AND_ASSIGN(SimpleRandom);
};
diff --git a/net/quic/test_tools/reliable_quic_stream_peer.cc b/net/quic/test_tools/reliable_quic_stream_peer.cc
index a4a52be8..97a7278c 100644
--- a/net/quic/test_tools/reliable_quic_stream_peer.cc
+++ b/net/quic/test_tools/reliable_quic_stream_peer.cc
@@ -67,8 +67,8 @@
}
// static
-uint32 ReliableQuicStreamPeer::SizeOfQueuedData(ReliableQuicStream* stream) {
- uint32 total = 0;
+uint32_t ReliableQuicStreamPeer::SizeOfQueuedData(ReliableQuicStream* stream) {
+ uint32_t total = 0;
std::list<ReliableQuicStream::PendingData>::iterator it =
stream->queued_data_.begin();
while (it != stream->queued_data_.end()) {
diff --git a/net/quic/test_tools/reliable_quic_stream_peer.h b/net/quic/test_tools/reliable_quic_stream_peer.h
index 848a5c0..db172da1 100644
--- a/net/quic/test_tools/reliable_quic_stream_peer.h
+++ b/net/quic/test_tools/reliable_quic_stream_peer.h
@@ -5,7 +5,9 @@
#ifndef NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_
#define NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/quic/quic_protocol.h"
@@ -31,7 +33,7 @@
static bool ReadSideClosed(ReliableQuicStream* stream);
static bool WriteSideClosed(ReliableQuicStream* stream);
- static uint32 SizeOfQueuedData(ReliableQuicStream* stream);
+ static uint32_t SizeOfQueuedData(ReliableQuicStream* stream);
static void SetFecPolicy(ReliableQuicStream* stream, FecPolicy fec_policy);
diff --git a/net/quic/test_tools/rtt_stats_peer.h b/net/quic/test_tools/rtt_stats_peer.h
index 640d9b6c..ac528b5 100644
--- a/net/quic/test_tools/rtt_stats_peer.h
+++ b/net/quic/test_tools/rtt_stats_peer.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_TEST_TOOLS_RTT_STATS_PEER_H_
#define NET_QUIC_TEST_TOOLS_RTT_STATS_PEER_H_
+#include "base/macros.h"
#include "net/quic/congestion_control/rtt_stats.h"
#include "net/quic/quic_time.h"
diff --git a/net/quic/test_tools/simple_quic_framer.cc b/net/quic/test_tools/simple_quic_framer.cc
index 1fc893d..7b65ca7 100644
--- a/net/quic/test_tools/simple_quic_framer.cc
+++ b/net/quic/test_tools/simple_quic_framer.cc
@@ -4,6 +4,7 @@
#include "net/quic/test_tools/simple_quic_framer.h"
+#include "base/macros.h"
#include "base/stl_util.h"
#include "net/quic/crypto/quic_decrypter.h"
#include "net/quic/crypto/quic_encrypter.h"
diff --git a/net/quic/test_tools/simple_quic_framer.h b/net/quic/test_tools/simple_quic_framer.h
index c8cf62b8..c476550 100644
--- a/net/quic/test_tools/simple_quic_framer.h
+++ b/net/quic/test_tools/simple_quic_framer.h
@@ -5,9 +5,11 @@
#ifndef NET_QUIC_TEST_TOOLS_SIMPLE_QUIC_FRAMER_H_
#define NET_QUIC_TEST_TOOLS_SIMPLE_QUIC_FRAMER_H_
+#include <stddef.h>
+
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/quic/quic_framer.h"
diff --git a/net/quic/test_tools/test_task_runner.h b/net/quic/test_tools/test_task_runner.h
index 69a1bcb..258cf73 100644
--- a/net/quic/test_tools/test_task_runner.h
+++ b/net/quic/test_tools/test_task_runner.h
@@ -9,7 +9,7 @@
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/task_runner.h"
#include "base/test/test_pending_task.h"
diff --git a/net/sdch/sdch_owner.cc b/net/sdch/sdch_owner.cc
index 81936c2b..954732a1 100644
--- a/net/sdch/sdch_owner.cc
+++ b/net/sdch/sdch_owner.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/debug/alias.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/prefs/persistent_pref_store.h"
#include "base/prefs/value_map_pref_store.h"
@@ -280,8 +281,7 @@
if (external_pref_store_)
external_pref_store_->RemoveObserver(this);
- int64 object_lifetime =
- (clock_->Now() - creation_time_).InMilliseconds();
+ int64_t object_lifetime = (clock_->Now() - creation_time_).InMilliseconds();
for (const auto& val : consumed_byte_seconds_) {
if (object_lifetime > 0) {
// Objects that are created and immediately destroyed don't add any memory
diff --git a/net/sdch/sdch_owner.h b/net/sdch/sdch_owner.h
index 3d6b59b..86f3b0f2 100644
--- a/net/sdch/sdch_owner.h
+++ b/net/sdch/sdch_owner.h
@@ -5,9 +5,13 @@
#ifndef NET_SDCH_SDCH_OWNER_H_
#define NET_SDCH_SDCH_OWNER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
#include <string>
+#include "base/macros.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/memory/ref_counted.h"
#include "base/prefs/pref_store.h"
@@ -203,7 +207,7 @@
// Byte-seconds consumed by dictionaries that have been unloaded. These are
// stored for later uploading in the SdchOwner destructor.
- std::vector<int64> consumed_byte_seconds_;
+ std::vector<int64_t> consumed_byte_seconds_;
// Creation time for this SdchOwner object, used for reporting temporal memory
// pressure.
diff --git a/net/sdch/sdch_owner_unittest.cc b/net/sdch/sdch_owner_unittest.cc
index 149041f..da5b48b 100644
--- a/net/sdch/sdch_owner_unittest.cc
+++ b/net/sdch/sdch_owner_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/prefs/testing_pref_store.h"
#include "base/run_loop.h"
diff --git a/net/server/http_connection.h b/net/server/http_connection.h
index 8163ced..8103e4e 100644
--- a/net/server/http_connection.h
+++ b/net/server/http_connection.h
@@ -8,7 +8,7 @@
#include <queue>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/io_buffer.h"
diff --git a/net/server/http_server.cc b/net/server/http_server.cc
index a184f4d1..d6c615e 100644
--- a/net/server/http_server.cc
+++ b/net/server/http_server.cc
@@ -123,13 +123,13 @@
return server_socket_->GetLocalAddress(address);
}
-void HttpServer::SetReceiveBufferSize(int connection_id, int32 size) {
+void HttpServer::SetReceiveBufferSize(int connection_id, int32_t size) {
HttpConnection* connection = FindConnection(connection_id);
if (connection)
connection->read_buf()->set_max_buffer_size(size);
}
-void HttpServer::SetSendBufferSize(int connection_id, int32 size) {
+void HttpServer::SetSendBufferSize(int connection_id, int32_t size) {
HttpConnection* connection = FindConnection(connection_id);
if (connection)
connection->write_buf()->set_max_buffer_size(size);
diff --git a/net/server/http_server.h b/net/server/http_server.h
index b8be0ed6..7e103dd 100644
--- a/net/server/http_server.h
+++ b/net/server/http_server.h
@@ -5,10 +5,12 @@
#ifndef NET_SERVER_HTTP_SERVER_H_
#define NET_SERVER_HTTP_SERVER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
#include <string>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -71,8 +73,8 @@
void Close(int connection_id);
- void SetReceiveBufferSize(int connection_id, int32 size);
- void SetSendBufferSize(int connection_id, int32 size);
+ void SetReceiveBufferSize(int connection_id, int32_t size);
+ void SetSendBufferSize(int connection_id, int32_t size);
// Copies the local address to |address|. Returns a network error code.
int GetLocalAddress(IPEndPoint* address);
diff --git a/net/server/http_server_response_info.h b/net/server/http_server_response_info.h
index e583e0dd..fd8dfbc 100644
--- a/net/server/http_server_response_info.h
+++ b/net/server/http_server_response_info.h
@@ -5,6 +5,8 @@
#ifndef NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_
#define NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_
+#include <stddef.h>
+
#include <string>
#include <utility>
diff --git a/net/server/http_server_unittest.cc b/net/server/http_server_unittest.cc
index 98571fb..ce754e83 100644
--- a/net/server/http_server_unittest.cc
+++ b/net/server/http_server_unittest.cc
@@ -15,6 +15,7 @@
#include "base/format_macros.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -164,7 +165,7 @@
return false;
// Return true if response has data equal to or more than content length.
- int64 body_size = static_cast<int64>(response.size()) - end_of_headers;
+ int64_t body_size = static_cast<int64_t>(response.size()) - end_of_headers;
DCHECK_LE(0, body_size);
scoped_refptr<HttpResponseHeaders> headers(new HttpResponseHeaders(
HttpUtil::AssembleRawHeaders(response.data(), end_of_headers)));
@@ -536,8 +537,10 @@
const CompletionCallback& callback) override {
return ERR_NOT_IMPLEMENTED;
}
- int SetReceiveBufferSize(int32 size) override { return ERR_NOT_IMPLEMENTED; }
- int SetSendBufferSize(int32 size) override { return ERR_NOT_IMPLEMENTED; }
+ int SetReceiveBufferSize(int32_t size) override {
+ return ERR_NOT_IMPLEMENTED;
+ }
+ int SetSendBufferSize(int32_t size) override { return ERR_NOT_IMPLEMENTED; }
void DidRead(const char* data, int data_len) {
if (!read_buf_.get()) {
diff --git a/net/server/web_socket.h b/net/server/web_socket.h
index 5309544..19e9c71a 100644
--- a/net/server/web_socket.h
+++ b/net/server/web_socket.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
diff --git a/net/server/web_socket_encoder.cc b/net/server/web_socket_encoder.cc
index 6e3da4e3..40d82410 100644
--- a/net/server/web_socket_encoder.cc
+++ b/net/server/web_socket_encoder.cc
@@ -91,7 +91,7 @@
if (client_frame && !masked) // In Hybi-17 spec client MUST mask its frame.
return WebSocket::FRAME_ERROR;
- uint64 payload_length64 = second_byte & kPayloadLengthMask;
+ uint64_t payload_length64 = second_byte & kPayloadLengthMask;
if (payload_length64 > kMaxSingleBytePayloadLength) {
int extended_payload_length_size;
if (payload_length64 == kTwoBytePayloadLengthField)
@@ -110,7 +110,7 @@
}
size_t actual_masking_key_length = masked ? kMaskingKeyWidthInBytes : 0;
- static const uint64 max_payload_length = 0x7FFFFFFFFFFFFFFFull;
+ static const uint64_t max_payload_length = 0x7FFFFFFFFFFFFFFFull;
static size_t max_length = std::numeric_limits<size_t>::max();
if (payload_length64 > max_payload_length ||
payload_length64 + actual_masking_key_length > max_length) {
diff --git a/net/server/web_socket_encoder.h b/net/server/web_socket_encoder.h
index 097df0e..1e9206fd 100644
--- a/net/server/web_socket_encoder.h
+++ b/net/server/web_socket_encoder.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/server/web_socket.h"
diff --git a/net/server/web_socket_encoder_unittest.cc b/net/server/web_socket_encoder_unittest.cc
index b5284e77..27babda 100644
--- a/net/server/web_socket_encoder_unittest.cc
+++ b/net/server/web_socket_encoder_unittest.cc
@@ -214,7 +214,7 @@
std::string frame;
frame.reserve(length);
for (int i = 0; i < length; ++i) {
- int64 j = i;
+ int64_t j = i;
frame += temp.data()[(j * j) % length];
}
diff --git a/net/socket/client_socket_factory.h b/net/socket/client_socket_factory.h
index a1ad503..668f39e 100644
--- a/net/socket/client_socket_factory.h
+++ b/net/socket/client_socket_factory.h
@@ -7,7 +7,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/base/rand_callback.h"
diff --git a/net/socket/client_socket_handle.h b/net/socket/client_socket_handle.h
index a4f7befb..c5b2720 100644
--- a/net/socket/client_socket_handle.h
+++ b/net/socket/client_socket_handle.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
diff --git a/net/socket/client_socket_pool.cc b/net/socket/client_socket_pool.cc
index 261e87fc..5d12324 100644
--- a/net/socket/client_socket_pool.cc
+++ b/net/socket/client_socket_pool.cc
@@ -12,10 +12,10 @@
// alive.
// TODO(ziadh): Change this timeout after getting histogram data on how long it
// should be.
-int64 g_unused_idle_socket_timeout_s = 10;
+int64_t g_unused_idle_socket_timeout_s = 10;
// The maximum duration, in seconds, to keep used idle persistent sockets alive.
-int64 g_used_idle_socket_timeout_s = 300; // 5 minutes
+int64_t g_used_idle_socket_timeout_s = 300; // 5 minutes
} // namespace
diff --git a/net/socket/client_socket_pool.h b/net/socket/client_socket_pool.h
index f43792d..e1785a3 100644
--- a/net/socket/client_socket_pool.h
+++ b/net/socket/client_socket_pool.h
@@ -8,7 +8,7 @@
#include <deque>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/template_util.h"
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 2f21981..c033724 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -22,6 +22,9 @@
#ifndef NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
#define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <cstddef>
#include <deque>
#include <list>
@@ -30,7 +33,7 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -157,7 +160,7 @@
: public ConnectJob::Delegate,
public NetworkChangeNotifier::IPAddressObserver {
public:
- typedef uint32 Flags;
+ typedef uint32_t Flags;
// Used to specify specific behavior for the ClientSocketPool.
enum Flag {
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index 4e8fbdb0..05fab62 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -13,6 +13,7 @@
#include "base/callback.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
@@ -151,8 +152,8 @@
was_used_to_convey_data_ = true;
return len;
}
- int SetReceiveBufferSize(int32 size) override { return OK; }
- int SetSendBufferSize(int32 size) override { return OK; }
+ int SetReceiveBufferSize(int32_t size) override { return OK; }
+ int SetSendBufferSize(int32_t size) override { return OK; }
// StreamSocket implementation.
int Connect(const CompletionCallback& callback) override {
diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket_pool_manager.cc
index ac1c1e8..c053b1f4 100644
--- a/net/socket/client_socket_pool_manager.cc
+++ b/net/socket/client_socket_pool_manager.cc
@@ -6,7 +6,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "net/base/load_flags.h"
diff --git a/net/socket/client_socket_pool_manager_impl.h b/net/socket/client_socket_pool_manager_impl.h
index 2038220..da6bfdb 100644
--- a/net/socket/client_socket_pool_manager_impl.h
+++ b/net/socket/client_socket_pool_manager_impl.h
@@ -6,8 +6,8 @@
#define NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_IMPL_H_
#include <map>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
diff --git a/net/socket/mock_client_socket_pool_manager.h b/net/socket/mock_client_socket_pool_manager.h
index 80327665..e24b2fb 100644
--- a/net/socket/mock_client_socket_pool_manager.h
+++ b/net/socket/mock_client_socket_pool_manager.h
@@ -5,7 +5,7 @@
#ifndef NET_SOCKET_MOCK_CLIENT_SOCKET_POOL_MANAGER_H_
#define NET_SOCKET_MOCK_CLIENT_SOCKET_POOL_MANAGER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/socket/client_socket_pool_manager.h"
#include "net/socket/client_socket_pool_manager_impl.h"
diff --git a/net/socket/nss_ssl_util.cc b/net/socket/nss_ssl_util.cc
index 554bd27..74b4d41 100644
--- a/net/socket/nss_ssl_util.cc
+++ b/net/socket/nss_ssl_util.cc
@@ -37,7 +37,7 @@
// |to_remove| and sets every instance of them in |ciphers| to zero. It returns
// true if it found and removed every element of |to_remove|. It assumes that
// there are no duplicates in |ciphers| nor in |to_remove|.
-bool CiphersRemove(const uint16* to_remove, uint16* ciphers, size_t num) {
+bool CiphersRemove(const uint16_t* to_remove, uint16_t* ciphers, size_t num) {
size_t i, found = 0;
for (i = 0; ; i++) {
@@ -59,7 +59,7 @@
// CiphersCompact takes an array of cipher suite ids in |ciphers|, where some
// entries are zero, and moves the entries so that all the non-zero elements
// are compacted at the end of the array.
-void CiphersCompact(uint16* ciphers, size_t num) {
+void CiphersCompact(uint16_t* ciphers, size_t num) {
size_t j = num - 1;
for (size_t i = num - 1; i < num; i--) {
@@ -71,7 +71,7 @@
// CiphersCopy copies the zero-terminated array |in| to |out|. It returns the
// number of cipher suite ids copied.
-size_t CiphersCopy(const uint16* in, uint16* out) {
+size_t CiphersCopy(const uint16_t* in, uint16_t* out) {
for (size_t i = 0; ; i++) {
if (in[i] == 0)
return i;
@@ -146,26 +146,24 @@
// forward-secret ChaCha20-Poly1305. If the local machine has AES-NI then
// we prefer AES-GCM, otherwise ChaCha20. The remainder of the cipher suite
// preference is inheriented from NSS. */
- static const uint16 chacha_ciphers[] = {
- TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
- TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
- 0,
+ static const uint16_t chacha_ciphers[] = {
+ TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, 0,
};
- static const uint16 aes_gcm_ciphers[] = {
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
- TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
- 0,
+ static const uint16_t aes_gcm_ciphers[] = {
+ TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, 0,
};
- scoped_ptr<uint16[]> ciphers(new uint16[num_ciphers]);
- memcpy(ciphers.get(), ssl_ciphers, sizeof(uint16)*num_ciphers);
+ scoped_ptr<uint16_t[]> ciphers(new uint16_t[num_ciphers]);
+ memcpy(ciphers.get(), ssl_ciphers, sizeof(uint16_t) * num_ciphers);
if (CiphersRemove(chacha_ciphers, ciphers.get(), num_ciphers) &&
CiphersRemove(aes_gcm_ciphers, ciphers.get(), num_ciphers)) {
CiphersCompact(ciphers.get(), num_ciphers);
- const uint16* preference_ciphers = chacha_ciphers;
- const uint16* other_ciphers = aes_gcm_ciphers;
+ const uint16_t* preference_ciphers = chacha_ciphers;
+ const uint16_t* other_ciphers = aes_gcm_ciphers;
base::CPU cpu;
if (cpu.has_aesni() && cpu.has_avx()) {
diff --git a/net/socket/server_socket.cc b/net/socket/server_socket.cc
index 7cf6c64..50722a9 100644
--- a/net/socket/server_socket.cc
+++ b/net/socket/server_socket.cc
@@ -17,7 +17,7 @@
}
int ServerSocket::ListenWithAddressAndPort(const std::string& address_string,
- uint16 port,
+ uint16_t port,
int backlog) {
IPAddressNumber address_number;
if (!ParseIPLiteralToNumber(address_string, &address_number)) {
diff --git a/net/socket/server_socket.h b/net/socket/server_socket.h
index 828b399..4189433 100644
--- a/net/socket/server_socket.h
+++ b/net/socket/server_socket.h
@@ -5,9 +5,11 @@
#ifndef NET_SOCKET_SERVER_SOCKET_H_
#define NET_SOCKET_SERVER_SOCKET_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
@@ -31,7 +33,7 @@
// Subclasses may override this function if |address_string| is in a different
// format, for example, unix domain socket path.
virtual int ListenWithAddressAndPort(const std::string& address_string,
- uint16 port,
+ uint16_t port,
int backlog);
// Gets current address the socket is bound to.
diff --git a/net/socket/socket.h b/net/socket/socket.h
index 5d9af81..cda5406 100644
--- a/net/socket/socket.h
+++ b/net/socket/socket.h
@@ -5,6 +5,8 @@
#ifndef NET_SOCKET_SOCKET_H_
#define NET_SOCKET_SOCKET_H_
+#include <stdint.h>
+
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
@@ -49,12 +51,12 @@
// Set the receive buffer size (in bytes) for the socket.
// Note: changing this value can affect the TCP window size on some platforms.
// Returns a net error code.
- virtual int SetReceiveBufferSize(int32 size) = 0;
+ virtual int SetReceiveBufferSize(int32_t size) = 0;
// Set the send buffer size (in bytes) for the socket.
// Note: changing this value can affect the TCP window size on some platforms.
// Returns a net error code.
- virtual int SetSendBufferSize(int32 size) = 0;
+ virtual int SetSendBufferSize(int32_t size) = 0;
};
} // namespace net
diff --git a/net/socket/socket_descriptor.cc b/net/socket/socket_descriptor.cc
index 81787a2..2744d66 100644
--- a/net/socket/socket_descriptor.cc
+++ b/net/socket/socket_descriptor.cc
@@ -9,8 +9,6 @@
#include <sys/socket.h>
#endif
-#include "base/basictypes.h"
-
#if defined(OS_WIN)
#include <ws2tcpip.h>
#include "base/win/windows_version.h"
@@ -19,7 +17,7 @@
namespace net {
-PlatformSocketFactory* g_socket_factory = NULL;
+PlatformSocketFactory* g_socket_factory = nullptr;
PlatformSocketFactory::PlatformSocketFactory() {
}
@@ -34,7 +32,7 @@
SocketDescriptor CreateSocketDefault(int family, int type, int protocol) {
#if defined(OS_WIN)
EnsureWinsockInit();
- SocketDescriptor result = ::WSASocket(family, type, protocol, NULL, 0,
+ SocketDescriptor result = ::WSASocket(family, type, protocol, nullptr, 0,
WSA_FLAG_OVERLAPPED);
if (result != kInvalidSocket && family == AF_INET6 &&
base::win::OSInfo::GetInstance()->version() >= base::win::VERSION_VISTA) {
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index b9771ce..0b99c5d 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -7,7 +7,6 @@
#include <algorithm>
#include <vector>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
@@ -708,7 +707,8 @@
scoped_ptr<MockUDPClientSocket> socket(
new MockUDPClientSocket(data_provider, net_log));
if (bind_type == DatagramSocket::RANDOM_BIND)
- socket->set_source_port(static_cast<uint16>(rand_int_cb.Run(1025, 65535)));
+ socket->set_source_port(
+ static_cast<uint16_t>(rand_int_cb.Run(1025, 65535)));
udp_client_socket_ports_.push_back(socket->source_port());
return socket.Pass();
}
@@ -755,11 +755,11 @@
peer_addr_ = IPEndPoint(ip, 0);
}
-int MockClientSocket::SetReceiveBufferSize(int32 size) {
+int MockClientSocket::SetReceiveBufferSize(int32_t size) {
return OK;
}
-int MockClientSocket::SetSendBufferSize(int32 size) {
+int MockClientSocket::SetSendBufferSize(int32_t size) {
return OK;
}
@@ -1310,11 +1310,11 @@
return write_result.result;
}
-int MockUDPClientSocket::SetReceiveBufferSize(int32 size) {
+int MockUDPClientSocket::SetReceiveBufferSize(int32_t size) {
return OK;
}
-int MockUDPClientSocket::SetSendBufferSize(int32 size) {
+int MockUDPClientSocket::SetSendBufferSize(int32_t size) {
return OK;
}
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index c25221f9..a9445baa 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -5,6 +5,7 @@
#ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_
#define NET_SOCKET_SOCKET_TEST_UTIL_H_
+#include <stddef.h>
#include <stdint.h>
#include <cstring>
@@ -12,9 +13,9 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/callback.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
@@ -517,14 +518,14 @@
const SSLClientSocketContext& context) override;
void ClearSSLSessionCache() override;
- const std::vector<uint16>& udp_client_socket_ports() const {
+ const std::vector<uint16_t>& udp_client_socket_ports() const {
return udp_client_socket_ports_;
}
private:
SocketDataProviderArray<SocketDataProvider> mock_data_;
SocketDataProviderArray<SSLSocketDataProvider> mock_ssl_data_;
- std::vector<uint16> udp_client_socket_ports_;
+ std::vector<uint16_t> udp_client_socket_ports_;
DISALLOW_COPY_AND_ASSIGN(MockClientSocketFactory);
};
@@ -545,8 +546,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override = 0;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
// StreamSocket implementation.
int Connect(const CompletionCallback& callback) override = 0;
@@ -723,8 +724,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
// DatagramSocket implementation.
void Close() override;
@@ -744,8 +745,8 @@
void OnConnectComplete(const MockConnect& data) override;
void OnDataProviderDestroyed() override;
- void set_source_port(uint16 port) { source_port_ = port;}
- uint16 source_port() const { return source_port_; }
+ void set_source_port(uint16_t port) { source_port_ = port; }
+ uint16_t source_port() const { return source_port_; }
private:
int CompleteRead();
@@ -758,7 +759,7 @@
int read_offset_;
MockRead read_data_;
bool need_read_data_;
- uint16 source_port_; // Ephemeral source port.
+ uint16_t source_port_; // Ephemeral source port.
// Address of the "remote" peer we're connected to.
IPEndPoint peer_addr_;
diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc
index 0ddc4b43..10b9de7 100644
--- a/net/socket/socks5_client_socket.cc
+++ b/net/socket/socks5_client_socket.cc
@@ -4,7 +4,6 @@
#include "net/socket/socks5_client_socket.h"
-#include "base/basictypes.h"
#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/format_macros.h"
@@ -21,9 +20,9 @@
const unsigned int SOCKS5ClientSocket::kGreetReadHeaderSize = 2;
const unsigned int SOCKS5ClientSocket::kWriteHeaderSize = 10;
const unsigned int SOCKS5ClientSocket::kReadHeaderSize = 5;
-const uint8 SOCKS5ClientSocket::kSOCKS5Version = 0x05;
-const uint8 SOCKS5ClientSocket::kTunnelCommand = 0x01;
-const uint8 SOCKS5ClientSocket::kNullByte = 0x00;
+const uint8_t SOCKS5ClientSocket::kSOCKS5Version = 0x05;
+const uint8_t SOCKS5ClientSocket::kTunnelCommand = 0x01;
+const uint8_t SOCKS5ClientSocket::kNullByte = 0x00;
static_assert(sizeof(struct in_addr) == 4, "incorrect system size of IPv4");
static_assert(sizeof(struct in6_addr) == 16, "incorrect system size of IPv6");
@@ -190,11 +189,11 @@
return rv;
}
-int SOCKS5ClientSocket::SetReceiveBufferSize(int32 size) {
+int SOCKS5ClientSocket::SetReceiveBufferSize(int32_t size) {
return transport_->socket()->SetReceiveBufferSize(size);
}
-int SOCKS5ClientSocket::SetSendBufferSize(int32 size) {
+int SOCKS5ClientSocket::SetSendBufferSize(int32_t size) {
return transport_->socket()->SetSendBufferSize(size);
}
@@ -378,7 +377,7 @@
host_request_info_.hostname().size()));
handshake->append(host_request_info_.hostname());
- uint16 nw_port = base::HostToNet16(host_request_info_.port());
+ uint16_t nw_port = base::HostToNet16(host_request_info_.port());
handshake->append(reinterpret_cast<char*>(&nw_port), sizeof(nw_port));
return OK;
}
@@ -472,7 +471,7 @@
SocksEndPointAddressType address_type =
static_cast<SocksEndPointAddressType>(buffer_[3]);
if (address_type == kEndPointDomain)
- read_header_size += static_cast<uint8>(buffer_[4]);
+ read_header_size += static_cast<uint8_t>(buffer_[4]);
else if (address_type == kEndPointResolvedIPv4)
read_header_size += sizeof(struct in_addr) - 1;
else if (address_type == kEndPointResolvedIPv6)
diff --git a/net/socket/socks5_client_socket.h b/net/socket/socks5_client_socket.h
index 643241ff..a5438b6 100644
--- a/net/socket/socks5_client_socket.h
+++ b/net/socket/socks5_client_socket.h
@@ -5,11 +5,12 @@
#ifndef NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_
#define NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_
+#include <stddef.h>
#include <stdint.h>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/address_list.h"
@@ -69,8 +70,8 @@
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
int GetPeerAddress(IPEndPoint* address) const override;
int GetLocalAddress(IPEndPoint* address) const override;
@@ -98,9 +99,9 @@
static const unsigned int kGreetReadHeaderSize;
static const unsigned int kWriteHeaderSize;
static const unsigned int kReadHeaderSize;
- static const uint8 kSOCKS5Version;
- static const uint8 kTunnelCommand;
- static const uint8 kNullByte;
+ static const uint8_t kSOCKS5Version;
+ static const uint8_t kTunnelCommand;
+ static const uint8_t kNullByte;
void DoCallback(int result);
void OnIOComplete(int result);
diff --git a/net/socket/socks5_client_socket_unittest.cc b/net/socket/socks5_client_socket_unittest.cc
index 5fa5bf8e..8919b3a 100644
--- a/net/socket/socks5_client_socket_unittest.cc
+++ b/net/socket/socks5_client_socket_unittest.cc
@@ -8,6 +8,7 @@
#include <iterator>
#include <map>
+#include "base/macros.h"
#include "base/sys_byteorder.h"
#include "net/base/address_list.h"
#include "net/base/test_completion_callback.h"
@@ -45,7 +46,7 @@
void SetUp() override;
protected:
- const uint16 kNwPort;
+ const uint16_t kNwPort;
TestNetLog net_log_;
scoped_ptr<SOCKS5ClientSocket> user_sock_;
AddressList address_list_;
diff --git a/net/socket/socks_client_socket.cc b/net/socket/socks_client_socket.cc
index fab09206..678af10 100644
--- a/net/socket/socks_client_socket.cc
+++ b/net/socket/socks_client_socket.cc
@@ -4,7 +4,6 @@
#include "net/socket/socks_client_socket.h"
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
@@ -27,31 +26,31 @@
static const unsigned int kReadHeaderSize = 8;
// Server Response codes for SOCKS.
-static const uint8 kServerResponseOk = 0x5A;
-static const uint8 kServerResponseRejected = 0x5B;
-static const uint8 kServerResponseNotReachable = 0x5C;
-static const uint8 kServerResponseMismatchedUserId = 0x5D;
+static const uint8_t kServerResponseOk = 0x5A;
+static const uint8_t kServerResponseRejected = 0x5B;
+static const uint8_t kServerResponseNotReachable = 0x5C;
+static const uint8_t kServerResponseMismatchedUserId = 0x5D;
-static const uint8 kSOCKSVersion4 = 0x04;
-static const uint8 kSOCKSStreamRequest = 0x01;
+static const uint8_t kSOCKSVersion4 = 0x04;
+static const uint8_t kSOCKSStreamRequest = 0x01;
// A struct holding the essential details of the SOCKS4 Server Request.
// The port in the header is stored in network byte order.
struct SOCKS4ServerRequest {
- uint8 version;
- uint8 command;
- uint16 nw_port;
- uint8 ip[4];
+ uint8_t version;
+ uint8_t command;
+ uint16_t nw_port;
+ uint8_t ip[4];
};
static_assert(sizeof(SOCKS4ServerRequest) == kWriteHeaderSize,
"socks4 server request struct has incorrect size");
// A struct holding details of the SOCKS4 Server Response.
struct SOCKS4ServerResponse {
- uint8 reserved_null;
- uint8 code;
- uint16 port;
- uint8 ip[4];
+ uint8_t reserved_null;
+ uint8_t code;
+ uint16_t port;
+ uint8_t ip[4];
};
static_assert(sizeof(SOCKS4ServerResponse) == kReadHeaderSize,
"socks4 server response struct has incorrect size");
@@ -218,11 +217,11 @@
return rv;
}
-int SOCKSClientSocket::SetReceiveBufferSize(int32 size) {
+int SOCKSClientSocket::SetReceiveBufferSize(int32_t size) {
return transport_->socket()->SetReceiveBufferSize(size);
}
-int SOCKSClientSocket::SetSendBufferSize(int32 size) {
+int SOCKSClientSocket::SetSendBufferSize(int32_t size) {
return transport_->socket()->SetSendBufferSize(size);
}
diff --git a/net/socket/socks_client_socket.h b/net/socket/socks_client_socket.h
index 4360e2de..8d5accd 100644
--- a/net/socket/socks_client_socket.h
+++ b/net/socket/socks_client_socket.h
@@ -5,12 +5,13 @@
#ifndef NET_SOCKET_SOCKS_CLIENT_SOCKET_H_
#define NET_SOCKET_SOCKS_CLIENT_SOCKET_H_
+#include <stddef.h>
#include <stdint.h>
#include <string>
-#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/address_list.h"
@@ -67,8 +68,8 @@
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
int GetPeerAddress(IPEndPoint* address) const override;
int GetLocalAddress(IPEndPoint* address) const override;
diff --git a/net/socket/socks_client_socket_pool.h b/net/socket/socks_client_socket_pool.h
index 77dbb4988a..8aaf726c 100644
--- a/net/socket/socks_client_socket_pool.h
+++ b/net/socket/socks_client_socket_pool.h
@@ -7,8 +7,8 @@
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
diff --git a/net/socket/socks_client_socket_unittest.cc b/net/socket/socks_client_socket_unittest.cc
index 27b4c70..4d2711a 100644
--- a/net/socket/socks_client_socket_unittest.cc
+++ b/net/socket/socks_client_socket_unittest.cc
@@ -4,6 +4,7 @@
#include "net/socket/socks_client_socket.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/address_list.h"
#include "net/base/test_completion_callback.h"
diff --git a/net/socket/ssl_client_socket.cc b/net/socket/ssl_client_socket.cc
index ccd1f86..9b5a0a9 100644
--- a/net/socket/ssl_client_socket.cc
+++ b/net/socket/ssl_client_socket.cc
@@ -181,8 +181,8 @@
// static
bool SSLClientSocket::HasCipherAdequateForHTTP2(
- const std::vector<uint16>& cipher_suites) {
- for (uint16 cipher : cipher_suites) {
+ const std::vector<uint16_t>& cipher_suites) {
+ for (uint16_t cipher : cipher_suites) {
if (IsTLSCipherSuiteAllowedByHTTP2(cipher))
return true;
}
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h
index c8bfa8e..138ede84 100644
--- a/net/socket/ssl_client_socket.h
+++ b/net/socket/ssl_client_socket.h
@@ -5,6 +5,8 @@
#ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_
#define NET_SOCKET_SSL_CLIENT_SOCKET_H_
+#include <stdint.h>
+
#include <string>
#include "base/gtest_prod_util.h"
@@ -181,7 +183,7 @@
// Section 9.2 of the HTTP/2 specification. Note that the server might still
// pick an inadequate cipher suite.
static bool HasCipherAdequateForHTTP2(
- const std::vector<uint16>& cipher_suites);
+ const std::vector<uint16_t>& cipher_suites);
// Determine if the TLS version required by Section 9.2 of the HTTP/2
// specification is enabled. Note that the server might still pick an
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index 273d665..2830fd1 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -70,6 +70,7 @@
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
@@ -2066,7 +2067,7 @@
}
void SSLClientSocketNSS::Core::UpdateNextProto() {
- uint8 buf[256];
+ uint8_t buf[256];
SSLNextProtoState state;
unsigned buf_len;
@@ -2661,11 +2662,11 @@
return rv;
}
-int SSLClientSocketNSS::SetReceiveBufferSize(int32 size) {
+int SSLClientSocketNSS::SetReceiveBufferSize(int32_t size) {
return transport_->socket()->SetReceiveBufferSize(size);
}
-int SSLClientSocketNSS::SetSendBufferSize(int32 size) {
+int SSLClientSocketNSS::SetSendBufferSize(int32_t size) {
return transport_->socket()->SetSendBufferSize(size);
}
@@ -2772,7 +2773,7 @@
}
}
- for (std::vector<uint16>::const_iterator it =
+ for (std::vector<uint16_t>::const_iterator it =
ssl_config_.disabled_cipher_suites.begin();
it != ssl_config_.disabled_cipher_suites.end(); ++it) {
// This will fail if the specified cipher is not implemented by NSS, but
diff --git a/net/socket/ssl_client_socket_nss.h b/net/socket/ssl_client_socket_nss.h
index c2393e2..307dc77b 100644
--- a/net/socket/ssl_client_socket_nss.h
+++ b/net/socket/ssl_client_socket_nss.h
@@ -94,8 +94,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
// SSLClientSocket implementation.
ChannelIDService* GetChannelIDService() const override;
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index 871e0e3..6620f28 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -19,6 +19,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/lazy_instance.h"
+#include "base/macros.h"
#include "base/memory/singleton.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
@@ -99,7 +100,7 @@
using ScopedX509Stack = crypto::ScopedOpenSSL<STACK_OF(X509), FreeX509Stack>;
// Used for encoding the |connection_status| field of an SSLInfo object.
-int EncodeSSLConnectionStatus(uint16 cipher_suite,
+int EncodeSSLConnectionStatus(uint16_t cipher_suite,
int compression,
int version) {
return cipher_suite |
@@ -765,7 +766,7 @@
SSL_SESSION_get_key_exchange_info(SSL_get_session(ssl_));
ssl_info->connection_status = EncodeSSLConnectionStatus(
- static_cast<uint16>(SSL_CIPHER_get_id(cipher)), 0 /* no compression */,
+ static_cast<uint16_t>(SSL_CIPHER_get_id(cipher)), 0 /* no compression */,
GetNetSSLVersion(ssl_));
if (!SSL_get_secure_renegotiation_support(ssl_))
@@ -833,11 +834,11 @@
return rv;
}
-int SSLClientSocketOpenSSL::SetReceiveBufferSize(int32 size) {
+int SSLClientSocketOpenSSL::SetReceiveBufferSize(int32_t size) {
return transport_->socket()->SetReceiveBufferSize(size);
}
-int SSLClientSocketOpenSSL::SetSendBufferSize(int32 size) {
+int SSLClientSocketOpenSSL::SetSendBufferSize(int32_t size) {
return transport_->socket()->SetSendBufferSize(size);
}
@@ -987,10 +988,10 @@
// Get list of ciphers that are enabled.
STACK_OF(SSL_CIPHER)* enabled_ciphers = SSL_get_ciphers(ssl_);
DCHECK(enabled_ciphers);
- std::vector<uint16> enabled_ciphers_vector;
+ std::vector<uint16_t> enabled_ciphers_vector;
for (size_t i = 0; i < sk_SSL_CIPHER_num(enabled_ciphers); ++i) {
const SSL_CIPHER* cipher = sk_SSL_CIPHER_value(enabled_ciphers, i);
- const uint16 id = static_cast<uint16>(SSL_CIPHER_get_id(cipher));
+ const uint16_t id = static_cast<uint16_t>(SSL_CIPHER_get_id(cipher));
enabled_ciphers_vector.push_back(id);
}
@@ -1938,7 +1939,7 @@
const unsigned char* in,
unsigned int inlen) {
if (ssl_config_.npn_protos.empty()) {
- *out = reinterpret_cast<uint8*>(
+ *out = reinterpret_cast<uint8_t*>(
const_cast<char*>(kDefaultSupportedNPNProtocol));
*outlen = arraysize(kDefaultSupportedNPNProtocol) - 1;
npn_status_ = kNextProtoUnsupported;
diff --git a/net/socket/ssl_client_socket_openssl.h b/net/socket/ssl_client_socket_openssl.h
index c200c31..6dabb6a5 100644
--- a/net/socket/ssl_client_socket_openssl.h
+++ b/net/socket/ssl_client_socket_openssl.h
@@ -7,6 +7,7 @@
#include <openssl/base.h>
#include <openssl/ssl.h>
+#include <stddef.h>
#include <stdint.h>
#include <string>
@@ -106,8 +107,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
private:
class PeerCertificateChain;
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index b16eeedd..0fdfc406 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -372,7 +372,7 @@
ssl_info.connection_status),
SSL_CONNECTION_VERSION_MAX);
- uint16 cipher_suite =
+ uint16_t cipher_suite =
SSLConnectionStatusToCipherSuite(ssl_info.connection_status);
UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_CipherSuite", cipher_suite);
diff --git a/net/socket/ssl_client_socket_pool.h b/net/socket/ssl_client_socket_pool.h
index 2e4b20c..5b259eb 100644
--- a/net/socket/ssl_client_socket_pool.h
+++ b/net/socket/ssl_client_socket_pool.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc
index e496539..df3c44b 100644
--- a/net/socket/ssl_client_socket_unittest.cc
+++ b/net/socket/ssl_client_socket_unittest.cc
@@ -6,6 +6,7 @@
#include "base/callback_helpers.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
@@ -120,10 +121,10 @@
const CompletionCallback& callback) override {
return transport_->Write(buf, buf_len, callback);
}
- int SetReceiveBufferSize(int32 size) override {
+ int SetReceiveBufferSize(int32_t size) override {
return transport_->SetReceiveBufferSize(size);
}
- int SetSendBufferSize(int32 size) override {
+ int SetSendBufferSize(int32_t size) override {
return transport_->SetSendBufferSize(size);
}
@@ -1917,7 +1918,7 @@
// Rather than exhaustively disabling every AES_128_CBC ciphersuite defined at
// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml, only
// disabling those cipher suites that the test server actually implements.
- const uint16 kCiphersToDisable[] = {
+ const uint16_t kCiphersToDisable[] = {
0x002f, // TLS_RSA_WITH_AES_128_CBC_SHA
0x0033, // TLS_DHE_RSA_WITH_AES_128_CBC_SHA
0xc013, // TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
diff --git a/net/socket/ssl_server_socket.h b/net/socket/ssl_server_socket.h
index ceb9c0a..d0e6513 100644
--- a/net/socket/ssl_server_socket.h
+++ b/net/socket/ssl_server_socket.h
@@ -5,7 +5,6 @@
#ifndef NET_SOCKET_SSL_SERVER_SOCKET_H_
#define NET_SOCKET_SSL_SERVER_SOCKET_H_
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
diff --git a/net/socket/ssl_server_socket_nss.cc b/net/socket/ssl_server_socket_nss.cc
index 3ed4da19..7fa31c7 100644
--- a/net/socket/ssl_server_socket_nss.cc
+++ b/net/socket/ssl_server_socket_nss.cc
@@ -108,7 +108,7 @@
next_handshake_state_(STATE_NONE),
completed_handshake_(false) {
// TODO(hclam): Need a better way to clone a key.
- std::vector<uint8> key_bytes;
+ std::vector<uint8_t> key_bytes;
CHECK(key->ExportPrivateKey(&key_bytes));
key_.reset(crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes));
CHECK(key_.get());
@@ -239,11 +239,11 @@
return rv;
}
-int SSLServerSocketNSS::SetReceiveBufferSize(int32 size) {
+int SSLServerSocketNSS::SetReceiveBufferSize(int32_t size) {
return transport_socket_->SetReceiveBufferSize(size);
}
-int SSLServerSocketNSS::SetSendBufferSize(int32 size) {
+int SSLServerSocketNSS::SetSendBufferSize(int32_t size) {
return transport_socket_->SetSendBufferSize(size);
}
@@ -384,7 +384,7 @@
}
}
- for (std::vector<uint16>::const_iterator it =
+ for (std::vector<uint16_t>::const_iterator it =
ssl_config_.disabled_cipher_suites.begin();
it != ssl_config_.disabled_cipher_suites.end(); ++it) {
// This will fail if the specified cipher is not implemented by NSS, but
@@ -456,7 +456,7 @@
}
// Get a key of SECKEYPrivateKey* structure.
- std::vector<uint8> key_vector;
+ std::vector<uint8_t> key_vector;
if (!key_->ExportPrivateKey(&key_vector)) {
CERT_DestroyCertificate(cert);
return ERR_UNEXPECTED;
diff --git a/net/socket/ssl_server_socket_nss.h b/net/socket/ssl_server_socket_nss.h
index 73a659e5..b26b9c32 100644
--- a/net/socket/ssl_server_socket_nss.h
+++ b/net/socket/ssl_server_socket_nss.h
@@ -11,6 +11,7 @@
#include <nss.h>
#include <stdint.h>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
#include "net/base/host_port_pair.h"
@@ -49,8 +50,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
// StreamSocket implementation.
int Connect(const CompletionCallback& callback) override;
diff --git a/net/socket/ssl_server_socket_openssl.cc b/net/socket/ssl_server_socket_openssl.cc
index fe3a369..54858585 100644
--- a/net/socket/ssl_server_socket_openssl.cc
+++ b/net/socket/ssl_server_socket_openssl.cc
@@ -54,7 +54,7 @@
next_handshake_state_(STATE_NONE),
completed_handshake_(false) {
// TODO(byungchul): Need a better way to clone a key.
- std::vector<uint8> key_bytes;
+ std::vector<uint8_t> key_bytes;
CHECK(key->ExportPrivateKey(&key_bytes));
key_.reset(crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes));
CHECK(key_.get());
@@ -174,11 +174,11 @@
return rv;
}
-int SSLServerSocketOpenSSL::SetReceiveBufferSize(int32 size) {
+int SSLServerSocketOpenSSL::SetReceiveBufferSize(int32_t size) {
return transport_socket_->SetReceiveBufferSize(size);
}
-int SSLServerSocketOpenSSL::SetSendBufferSize(int32 size) {
+int SSLServerSocketOpenSSL::SetSendBufferSize(int32_t size) {
return transport_socket_->SetSendBufferSize(size);
}
diff --git a/net/socket/ssl_server_socket_openssl.h b/net/socket/ssl_server_socket_openssl.h
index c64f070..95dc2f1 100644
--- a/net/socket/ssl_server_socket_openssl.h
+++ b/net/socket/ssl_server_socket_openssl.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
#include "net/base/io_buffer.h"
@@ -52,8 +53,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
// StreamSocket implementation.
int Connect(const CompletionCallback& callback) override;
diff --git a/net/socket/ssl_server_socket_unittest.cc b/net/socket/ssl_server_socket_unittest.cc
index 548f7c6c..c6937b9 100644
--- a/net/socket/ssl_server_socket_unittest.cc
+++ b/net/socket/ssl_server_socket_unittest.cc
@@ -25,6 +25,7 @@
#include "base/files/file_util.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
@@ -191,9 +192,9 @@
return outgoing_->Write(buf, buf_len, callback);
}
- int SetReceiveBufferSize(int32 size) override { return OK; }
+ int SetReceiveBufferSize(int32_t size) override { return OK; }
- int SetSendBufferSize(int32 size) override { return OK; }
+ int SetSendBufferSize(int32_t size) override { return OK; }
int Connect(const CompletionCallback& callback) override { return OK; }
@@ -325,10 +326,10 @@
base::FilePath key_path = certs_dir.AppendASCII("unittest.key.bin");
std::string key_string;
ASSERT_TRUE(base::ReadFileToString(key_path, &key_string));
- std::vector<uint8> key_vector(
- reinterpret_cast<const uint8*>(key_string.data()),
- reinterpret_cast<const uint8*>(key_string.data() +
- key_string.length()));
+ std::vector<uint8_t> key_vector(
+ reinterpret_cast<const uint8_t*>(key_string.data()),
+ reinterpret_cast<const uint8_t*>(key_string.data() +
+ key_string.length()));
scoped_ptr<crypto::RSAPrivateKey> private_key(
crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector));
diff --git a/net/socket/ssl_socket.h b/net/socket/ssl_socket.h
index 0dc817b..5f60e80 100644
--- a/net/socket/ssl_socket.h
+++ b/net/socket/ssl_socket.h
@@ -5,7 +5,6 @@
#ifndef NET_SOCKET_SSL_SOCKET_H_
#define NET_SOCKET_SSL_SOCKET_H_
-#include "base/basictypes.h"
#include "base/strings/string_piece.h"
#include "net/socket/stream_socket.h"
diff --git a/net/socket/stream_socket.h b/net/socket/stream_socket.h
index ebd43e1..e2f9d3c 100644
--- a/net/socket/stream_socket.h
+++ b/net/socket/stream_socket.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include "base/macros.h"
#include "net/log/net_log.h"
#include "net/socket/connection_attempts.h"
#include "net/socket/next_proto.h"
diff --git a/net/socket/tcp_client_socket.cc b/net/socket/tcp_client_socket.cc
index d0a5700..5dbae5a 100644
--- a/net/socket/tcp_client_socket.cc
+++ b/net/socket/tcp_client_socket.cc
@@ -292,11 +292,11 @@
return result;
}
-int TCPClientSocket::SetReceiveBufferSize(int32 size) {
+int TCPClientSocket::SetReceiveBufferSize(int32_t size) {
return socket_->SetReceiveBufferSize(size);
}
-int TCPClientSocket::SetSendBufferSize(int32 size) {
+int TCPClientSocket::SetSendBufferSize(int32_t size) {
return socket_->SetSendBufferSize(size);
}
diff --git a/net/socket/tcp_client_socket.h b/net/socket/tcp_client_socket.h
index 8872cb8..73ee62bf 100644
--- a/net/socket/tcp_client_socket.h
+++ b/net/socket/tcp_client_socket.h
@@ -7,8 +7,8 @@
#include <stdint.h>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/address_list.h"
#include "net/base/completion_callback.h"
@@ -66,8 +66,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
virtual bool SetKeepAlive(bool enable, int delay);
virtual bool SetNoDelay(bool no_delay);
diff --git a/net/socket/tcp_server_socket.h b/net/socket/tcp_server_socket.h
index 52d9b55..ea2021c 100644
--- a/net/socket/tcp_server_socket.h
+++ b/net/socket/tcp_server_socket.h
@@ -5,8 +5,8 @@
#ifndef NET_SOCKET_TCP_SERVER_SOCKET_H_
#define NET_SOCKET_TCP_SERVER_SOCKET_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_export.h"
diff --git a/net/socket/tcp_server_socket_unittest.cc b/net/socket/tcp_server_socket_unittest.cc
index 19c715bf..133c807 100644
--- a/net/socket/tcp_server_socket_unittest.cc
+++ b/net/socket/tcp_server_socket_unittest.cc
@@ -51,7 +51,7 @@
}
void ParseAddress(const std::string& ip_str,
- uint16 port,
+ uint16_t port,
IPEndPoint* address) {
IPAddressNumber ip_number;
bool rv = ParseIPLiteralToNumber(ip_str, &ip_number);
diff --git a/net/socket/tcp_socket_posix.cc b/net/socket/tcp_socket_posix.cc
index e432894..9996e86 100644
--- a/net/socket/tcp_socket_posix.cc
+++ b/net/socket/tcp_socket_posix.cc
@@ -404,14 +404,14 @@
return OK;
}
-int TCPSocketPosix::SetReceiveBufferSize(int32 size) {
+int TCPSocketPosix::SetReceiveBufferSize(int32_t size) {
DCHECK(socket_);
int rv = setsockopt(socket_->socket_fd(), SOL_SOCKET, SO_RCVBUF,
reinterpret_cast<const char*>(&size), sizeof(size));
return (rv == 0) ? OK : MapSystemError(errno);
}
-int TCPSocketPosix::SetSendBufferSize(int32 size) {
+int TCPSocketPosix::SetSendBufferSize(int32_t size) {
DCHECK(socket_);
int rv = setsockopt(socket_->socket_fd(), SOL_SOCKET, SO_SNDBUF,
reinterpret_cast<const char*>(&size), sizeof(size));
diff --git a/net/socket/tcp_socket_posix.h b/net/socket/tcp_socket_posix.h
index 3e6f322..8d53caf 100644
--- a/net/socket/tcp_socket_posix.h
+++ b/net/socket/tcp_socket_posix.h
@@ -5,9 +5,11 @@
#ifndef NET_SOCKET_TCP_SOCKET_POSIX_H_
#define NET_SOCKET_TCP_SOCKET_POSIX_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
#include "base/callback.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "net/base/address_family.h"
@@ -59,8 +61,8 @@
// - SetKeepAlive(true, 45).
void SetDefaultOptionsForClient();
int SetAddressReuse(bool allow);
- int SetReceiveBufferSize(int32 size);
- int SetSendBufferSize(int32 size);
+ int SetReceiveBufferSize(int32_t size);
+ int SetSendBufferSize(int32_t size);
bool SetKeepAlive(bool enable, int delay);
bool SetNoDelay(bool no_delay);
diff --git a/net/socket/tcp_socket_unittest.cc b/net/socket/tcp_socket_unittest.cc
index 374621e..d9d13c5 100644
--- a/net/socket/tcp_socket_unittest.cc
+++ b/net/socket/tcp_socket_unittest.cc
@@ -9,7 +9,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/address_list.h"
@@ -59,7 +58,7 @@
}
void ParseAddress(const std::string& ip_str,
- uint16 port,
+ uint16_t port,
IPEndPoint* address) {
IPAddressNumber ip_number;
bool rv = ParseIPLiteralToNumber(ip_str, &ip_number);
diff --git a/net/socket/tcp_socket_win.cc b/net/socket/tcp_socket_win.cc
index 028e830..fdf1dfa 100644
--- a/net/socket/tcp_socket_win.cc
+++ b/net/socket/tcp_socket_win.cc
@@ -11,6 +11,7 @@
#include "base/callback_helpers.h"
#include "base/files/file_util.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/profiler/scoped_tracker.h"
#include "base/win/windows_version.h"
#include "net/base/address_list.h"
@@ -32,7 +33,7 @@
const int kTCPKeepAliveSeconds = 45;
-int SetSocketReceiveBufferSize(SOCKET socket, int32 size) {
+int SetSocketReceiveBufferSize(SOCKET socket, int32_t size) {
int rv = setsockopt(socket, SOL_SOCKET, SO_RCVBUF,
reinterpret_cast<const char*>(&size), sizeof(size));
int net_error = (rv == 0) ? OK : MapSystemError(WSAGetLastError());
@@ -40,7 +41,7 @@
return net_error;
}
-int SetSocketSendBufferSize(SOCKET socket, int32 size) {
+int SetSocketSendBufferSize(SOCKET socket, int32_t size) {
int rv = setsockopt(socket, SOL_SOCKET, SO_SNDBUF,
reinterpret_cast<const char*>(&size), sizeof(size));
int net_error = (rv == 0) ? OK : MapSystemError(WSAGetLastError());
@@ -590,7 +591,7 @@
// Since Vista's auto-tune is better than any static value we can could set,
// only change these on pre-vista machines.
if (base::win::GetVersion() < base::win::VERSION_VISTA) {
- const int32 kSocketBufferSize = 64 * 1024;
+ const int32_t kSocketBufferSize = 64 * 1024;
SetSocketReceiveBufferSize(socket_, kSocketBufferSize);
SetSocketSendBufferSize(socket_, kSocketBufferSize);
}
@@ -625,12 +626,12 @@
return OK;
}
-int TCPSocketWin::SetReceiveBufferSize(int32 size) {
+int TCPSocketWin::SetReceiveBufferSize(int32_t size) {
DCHECK(CalledOnValidThread());
return SetSocketReceiveBufferSize(socket_, size);
}
-int TCPSocketWin::SetSendBufferSize(int32 size) {
+int TCPSocketWin::SetSendBufferSize(int32_t size) {
DCHECK(CalledOnValidThread());
return SetSocketSendBufferSize(socket_, size);
}
diff --git a/net/socket/tcp_socket_win.h b/net/socket/tcp_socket_win.h
index 07c93df..f24ffb8 100644
--- a/net/socket/tcp_socket_win.h
+++ b/net/socket/tcp_socket_win.h
@@ -5,10 +5,11 @@
#ifndef NET_SOCKET_TCP_SOCKET_WIN_H_
#define NET_SOCKET_TCP_SOCKET_WIN_H_
+#include <stdint.h>
#include <winsock2.h>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
@@ -68,8 +69,8 @@
// - SetKeepAlive(true, 45).
void SetDefaultOptionsForClient();
int SetExclusiveAddrUse();
- int SetReceiveBufferSize(int32 size);
- int SetSendBufferSize(int32 size);
+ int SetReceiveBufferSize(int32_t size);
+ int SetSendBufferSize(int32_t size);
bool SetKeepAlive(bool enable, int delay);
bool SetNoDelay(bool no_delay);
diff --git a/net/socket/transport_client_socket_pool.cc b/net/socket/transport_client_socket_pool.cc
index aaf54c5f..e8c9f85 100644
--- a/net/socket/transport_client_socket_pool.cc
+++ b/net/socket/transport_client_socket_pool.cc
@@ -282,7 +282,7 @@
if (last_connect_time.is_null()) {
interval_between_connects_ = CONNECT_INTERVAL_GT_20MS;
} else {
- int64 interval = (now - last_connect_time).InMilliseconds();
+ int64_t interval = (now - last_connect_time).InMilliseconds();
if (interval <= 10)
interval_between_connects_ = CONNECT_INTERVAL_LE_10MS;
else if (interval <= 20)
diff --git a/net/socket/transport_client_socket_pool.h b/net/socket/transport_client_socket_pool.h
index 036fd9f..07a67b5 100644
--- a/net/socket/transport_client_socket_pool.h
+++ b/net/socket/transport_client_socket_pool.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
diff --git a/net/socket/transport_client_socket_pool_test_util.cc b/net/socket/transport_client_socket_pool_test_util.cc
index 5e5f07486..c4378cd 100644
--- a/net/socket/transport_client_socket_pool_test_util.cc
+++ b/net/socket/transport_client_socket_pool_test_util.cc
@@ -10,6 +10,7 @@
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
@@ -95,8 +96,8 @@
const CompletionCallback& callback) override {
return ERR_FAILED;
}
- int SetReceiveBufferSize(int32 size) override { return OK; }
- int SetSendBufferSize(int32 size) override { return OK; }
+ int SetReceiveBufferSize(int32_t size) override { return OK; }
+ int SetSendBufferSize(int32_t size) override { return OK; }
private:
bool connected_;
@@ -163,8 +164,8 @@
const CompletionCallback& callback) override {
return ERR_FAILED;
}
- int SetReceiveBufferSize(int32 size) override { return OK; }
- int SetSendBufferSize(int32 size) override { return OK; }
+ int SetReceiveBufferSize(int32_t size) override { return OK; }
+ int SetSendBufferSize(int32_t size) override { return OK; }
private:
const AddressList addrlist_;
@@ -293,8 +294,8 @@
const CompletionCallback& callback) override {
return ERR_FAILED;
}
- int SetReceiveBufferSize(int32 size) override { return OK; }
- int SetSendBufferSize(int32 size) override { return OK; }
+ int SetReceiveBufferSize(int32_t size) override { return OK; }
+ int SetSendBufferSize(int32_t size) override { return OK; }
private:
void DoCallback() {
diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc
index 5224e4ca..dab0d076 100644
--- a/net/socket/transport_client_socket_pool_unittest.cc
+++ b/net/socket/transport_client_socket_pool_unittest.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/threading/platform_thread.h"
#include "net/base/ip_endpoint.h"
diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc
index 9ab358c..ef5291d 100644
--- a/net/socket/transport_client_socket_unittest.cc
+++ b/net/socket/transport_client_socket_unittest.cc
@@ -4,7 +4,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -58,8 +57,8 @@
}
int DrainClientSocket(IOBuffer* buf,
- uint32 buf_len,
- uint32 bytes_to_read,
+ uint32_t buf_len,
+ uint32_t bytes_to_read,
TestCompletionCallback* callback);
// Establishes a connection to the server.
@@ -82,7 +81,7 @@
protected:
base::RunLoop connect_loop_;
- uint16 listen_port_;
+ uint16_t listen_port_;
TestNetLog net_log_;
ClientSocketFactory* const socket_factory_;
scoped_ptr<StreamSocket> sock_;
@@ -125,11 +124,11 @@
int TransportClientSocketTest::DrainClientSocket(
IOBuffer* buf,
- uint32 buf_len,
- uint32 bytes_to_read,
+ uint32_t buf_len,
+ uint32_t bytes_to_read,
TestCompletionCallback* callback) {
int rv = OK;
- uint32 bytes_read = 0;
+ uint32_t bytes_read = 0;
while (bytes_read < bytes_to_read) {
rv = sock_->Read(buf, buf_len, callback->callback());
@@ -260,7 +259,7 @@
TEST_P(TransportClientSocketTest, IsConnected) {
scoped_refptr<IOBuffer> buf(new IOBuffer(4096));
TestCompletionCallback callback;
- uint32 bytes_read;
+ uint32_t bytes_read;
EXPECT_FALSE(sock_->IsConnected());
EXPECT_FALSE(sock_->IsConnectedAndIdle());
@@ -325,7 +324,7 @@
SendRequestAndResponse();
scoped_refptr<IOBuffer> buf(new IOBuffer(4096));
- uint32 bytes_read =
+ uint32_t bytes_read =
DrainClientSocket(buf.get(), 4096, strlen(kServerReply), &callback);
ASSERT_EQ(bytes_read, strlen(kServerReply));
ASSERT_EQ(std::string(kServerReply), std::string(buf->data(), bytes_read));
@@ -346,7 +345,7 @@
SendRequestAndResponse();
scoped_refptr<IOBuffer> buf(new IOBuffer(1));
- uint32 bytes_read = 0;
+ uint32_t bytes_read = 0;
while (bytes_read < strlen(kServerReply)) {
int rv = sock_->Read(buf.get(), 1, callback.callback());
EXPECT_TRUE(rv >= 0 || rv == ERR_IO_PENDING);
diff --git a/net/socket/unix_domain_client_socket_posix.cc b/net/socket/unix_domain_client_socket_posix.cc
index d8cbfaf..8b15e73 100644
--- a/net/socket/unix_domain_client_socket_posix.cc
+++ b/net/socket/unix_domain_client_socket_posix.cc
@@ -169,12 +169,12 @@
return socket_->Write(buf, buf_len, callback);
}
-int UnixDomainClientSocket::SetReceiveBufferSize(int32 size) {
+int UnixDomainClientSocket::SetReceiveBufferSize(int32_t size) {
NOTIMPLEMENTED();
return ERR_NOT_IMPLEMENTED;
}
-int UnixDomainClientSocket::SetSendBufferSize(int32 size) {
+int UnixDomainClientSocket::SetSendBufferSize(int32_t size) {
NOTIMPLEMENTED();
return ERR_NOT_IMPLEMENTED;
}
diff --git a/net/socket/unix_domain_client_socket_posix.h b/net/socket/unix_domain_client_socket_posix.h
index b978e13..260b3b9 100644
--- a/net/socket/unix_domain_client_socket_posix.h
+++ b/net/socket/unix_domain_client_socket_posix.h
@@ -9,7 +9,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
@@ -69,8 +68,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
// Releases ownership of underlying SocketDescriptor to caller.
// Internal state is reset so that this object can be used again.
diff --git a/net/socket/unix_domain_server_socket_posix.cc b/net/socket/unix_domain_server_socket_posix.cc
index 00f7c4e..efe1f108 100644
--- a/net/socket/unix_domain_server_socket_posix.cc
+++ b/net/socket/unix_domain_server_socket_posix.cc
@@ -68,7 +68,7 @@
int UnixDomainServerSocket::ListenWithAddressAndPort(
const std::string& unix_domain_path,
- uint16 port_unused,
+ uint16_t port_unused,
int backlog) {
DCHECK(!listen_socket_);
diff --git a/net/socket/unix_domain_server_socket_posix.h b/net/socket/unix_domain_server_socket_posix.h
index 7dd5c1a..55d2708 100644
--- a/net/socket/unix_domain_server_socket_posix.h
+++ b/net/socket/unix_domain_server_socket_posix.h
@@ -5,11 +5,11 @@
#ifndef NET_SOCKET_UNIX_DOMAIN_SERVER_SOCKET_POSIX_H_
#define NET_SOCKET_UNIX_DOMAIN_SERVER_SOCKET_POSIX_H_
+#include <stdint.h>
#include <sys/types.h>
#include <string>
-#include "base/basictypes.h"
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
@@ -53,7 +53,7 @@
// ServerSocket implementation.
int Listen(const IPEndPoint& address, int backlog) override;
int ListenWithAddressAndPort(const std::string& unix_domain_path,
- uint16 port_unused,
+ uint16_t port_unused,
int backlog) override;
int GetLocalAddress(IPEndPoint* address) const override;
int Accept(scoped_ptr<StreamSocket>* socket,
diff --git a/net/socket/websocket_endpoint_lock_manager.h b/net/socket/websocket_endpoint_lock_manager.h
index f3887b8c..dfbc308 100644
--- a/net/socket/websocket_endpoint_lock_manager.h
+++ b/net/socket/websocket_endpoint_lock_manager.h
@@ -5,6 +5,8 @@
#ifndef NET_SOCKET_WEBSOCKET_ENDPOINT_LOCK_MANAGER_H_
#define NET_SOCKET_WEBSOCKET_ENDPOINT_LOCK_MANAGER_H_
+#include <stddef.h>
+
#include <map>
#include "base/containers/linked_list.h"
diff --git a/net/socket/websocket_endpoint_lock_manager_unittest.cc b/net/socket/websocket_endpoint_lock_manager_unittest.cc
index 20127bf0b7..6808d373 100644
--- a/net/socket/websocket_endpoint_lock_manager_unittest.cc
+++ b/net/socket/websocket_endpoint_lock_manager_unittest.cc
@@ -5,6 +5,7 @@
#include "net/socket/websocket_endpoint_lock_manager.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/time/time.h"
@@ -81,9 +82,9 @@
return ERR_FAILED;
}
- int SetReceiveBufferSize(int32 size) override { return ERR_FAILED; }
+ int SetReceiveBufferSize(int32_t size) override { return ERR_FAILED; }
- int SetSendBufferSize(int32 size) override { return ERR_FAILED; }
+ int SetSendBufferSize(int32_t size) override { return ERR_FAILED; }
private:
BoundNetLog bound_net_log_;
diff --git a/net/socket/websocket_transport_client_socket_pool.h b/net/socket/websocket_transport_client_socket_pool.h
index 4eed5981..c0f1351 100644
--- a/net/socket/websocket_transport_client_socket_pool.h
+++ b/net/socket/websocket_transport_client_socket_pool.h
@@ -10,7 +10,7 @@
#include <set>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/socket/websocket_transport_connect_sub_job.h b/net/socket/websocket_transport_connect_sub_job.h
index 5709a46..d74a37eb 100644
--- a/net/socket/websocket_transport_connect_sub_job.h
+++ b/net/socket/websocket_transport_connect_sub_job.h
@@ -5,6 +5,8 @@
#ifndef NET_SOCKET_WEBSOCKET_TRANSPORT_CONNECT_SUB_JOB_H_
#define NET_SOCKET_WEBSOCKET_TRANSPORT_CONNECT_SUB_JOB_H_
+#include <stddef.h>
+
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
diff --git a/net/spdy/buffered_spdy_framer.cc b/net/spdy/buffered_spdy_framer.cc
index c5c33d5c..2372aff1 100644
--- a/net/spdy/buffered_spdy_framer.cc
+++ b/net/spdy/buffered_spdy_framer.cc
@@ -217,8 +217,8 @@
}
void BufferedSpdyFramer::OnSetting(SpdySettingsIds id,
- uint8 flags,
- uint32 value) {
+ uint8_t flags,
+ uint32_t value) {
visitor_->OnSetting(id, flags, value);
}
@@ -411,7 +411,7 @@
// SpdyWindowUpdateIR).
SpdyFrame* BufferedSpdyFramer::CreateWindowUpdate(
SpdyStreamId stream_id,
- uint32 delta_window_size) const {
+ uint32_t delta_window_size) const {
SpdyWindowUpdateIR update_ir(stream_id, delta_window_size);
return spdy_framer_.SerializeWindowUpdate(update_ir);
}
@@ -419,7 +419,7 @@
// TODO(jgraettinger): Eliminate uses of this method (prefer SpdyDataIR).
SpdyFrame* BufferedSpdyFramer::CreateDataFrame(SpdyStreamId stream_id,
const char* data,
- uint32 len,
+ uint32_t len,
SpdyDataFlags flags) {
SpdyDataIR data_ir(stream_id,
base::StringPiece(data, len));
diff --git a/net/spdy/buffered_spdy_framer.h b/net/spdy/buffered_spdy_framer.h
index e75c99f8..e3521db 100644
--- a/net/spdy/buffered_spdy_framer.h
+++ b/net/spdy/buffered_spdy_framer.h
@@ -5,9 +5,12 @@
#ifndef NET_SPDY_BUFFERED_SPDY_FRAMER_H_
#define NET_SPDY_BUFFERED_SPDY_FRAMER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/socket/next_proto.h"
@@ -97,7 +100,7 @@
// Called when an individual setting within a SETTINGS frame has been parsed
// and validated.
- virtual void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) = 0;
+ virtual void OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) = 0;
// Called when a SETTINGS frame is received with the ACK flag set.
virtual void OnSettingsAck() {}
@@ -184,7 +187,7 @@
SpdyStreamId stream_id) override;
void OnHeaderFrameEnd(SpdyStreamId stream_id, bool end_headers) override;
void OnSettings(bool clear_persisted) override;
- void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override;
+ void OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) override;
void OnSettingsAck() override;
void OnSettingsEnd() override;
void OnPing(SpdyPingId unique_id, bool is_ack) override;
@@ -229,12 +232,11 @@
SpdyControlFlags flags,
SpdyPriority priority,
const SpdyHeaderBlock* headers);
- SpdyFrame* CreateWindowUpdate(
- SpdyStreamId stream_id,
- uint32 delta_window_size) const;
+ SpdyFrame* CreateWindowUpdate(SpdyStreamId stream_id,
+ uint32_t delta_window_size) const;
SpdyFrame* CreateDataFrame(SpdyStreamId stream_id,
const char* data,
- uint32 len,
+ uint32_t len,
SpdyDataFlags flags);
SpdyFrame* CreatePushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
diff --git a/net/spdy/buffered_spdy_framer_unittest.cc b/net/spdy/buffered_spdy_framer_unittest.cc
index efd977a..fd61298e 100644
--- a/net/spdy/buffered_spdy_framer_unittest.cc
+++ b/net/spdy/buffered_spdy_framer_unittest.cc
@@ -100,7 +100,7 @@
void OnSettings(bool clear_persisted) override {}
- void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {
+ void OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) override {
setting_count_++;
}
diff --git a/net/spdy/fuzzing/hpack_fuzz_mutator.cc b/net/spdy/fuzzing/hpack_fuzz_mutator.cc
index 6301070..c0e76d2 100644
--- a/net/spdy/fuzzing/hpack_fuzz_mutator.cc
+++ b/net/spdy/fuzzing/hpack_fuzz_mutator.cc
@@ -65,9 +65,8 @@
StringPiece block;
while (HpackFuzzUtil::NextHeaderBlock(&input, &block)) {
HpackFuzzUtil::FlipBits(
- reinterpret_cast<uint8*>(const_cast<char*>(block.data())),
- block.size(),
- flip_ratio);
+ reinterpret_cast<uint8_t*>(const_cast<char*>(block.data())),
+ block.size(), flip_ratio);
string prefix = HpackFuzzUtil::HeaderBlockPrefix(block.size());
diff --git a/net/spdy/fuzzing/hpack_fuzz_util.cc b/net/spdy/fuzzing/hpack_fuzz_util.cc
index fc9a84a5..7bf5fcd 100644
--- a/net/spdy/fuzzing/hpack_fuzz_util.cc
+++ b/net/spdy/fuzzing/hpack_fuzz_util.cc
@@ -117,13 +117,13 @@
// ClusterFuzz may truncate input files if the fuzzer ran out of allocated
// disk space. Be tolerant of these.
CHECK_LE(input->offset, input->input.size());
- if (input->remaining() < sizeof(uint32)) {
+ if (input->remaining() < sizeof(uint32_t)) {
return false;
}
size_t length =
- base::NetToHost32(*reinterpret_cast<const uint32*>(input->ptr()));
- input->offset += sizeof(uint32);
+ base::NetToHost32(*reinterpret_cast<const uint32_t*>(input->ptr()));
+ input->offset += sizeof(uint32_t);
if (input->remaining() < length) {
return false;
@@ -135,8 +135,8 @@
// static
string HpackFuzzUtil::HeaderBlockPrefix(size_t block_size) {
- uint32 length = base::HostToNet32(static_cast<uint32>(block_size));
- return string(reinterpret_cast<char*>(&length), sizeof(uint32));
+ uint32_t length = base::HostToNet32(static_cast<uint32_t>(block_size));
+ return string(reinterpret_cast<char*>(&length), sizeof(uint32_t));
}
// static
@@ -176,14 +176,15 @@
}
// static
-void HpackFuzzUtil::FlipBits(uint8* buffer, size_t buffer_length,
+void HpackFuzzUtil::FlipBits(uint8_t* buffer,
+ size_t buffer_length,
size_t flip_per_thousand) {
- uint64 buffer_bit_length = buffer_length * 8u;
- uint64 bits_to_flip = flip_per_thousand * (1 + buffer_bit_length / 1024);
+ uint64_t buffer_bit_length = buffer_length * 8u;
+ uint64_t bits_to_flip = flip_per_thousand * (1 + buffer_bit_length / 1024);
// Iteratively identify & flip offsets in the buffer bit-sequence.
- for (uint64 i = 0; i != bits_to_flip; ++i) {
- uint64 bit_offset = base::RandUint64() % buffer_bit_length;
+ for (uint64_t i = 0; i != bits_to_flip; ++i) {
+ uint64_t bit_offset = base::RandUint64() % buffer_bit_length;
buffer[bit_offset / 8u] ^= (1 << (bit_offset % 8u));
}
}
diff --git a/net/spdy/fuzzing/hpack_fuzz_util.h b/net/spdy/fuzzing/hpack_fuzz_util.h
index a15a3fd..3ee64e6 100644
--- a/net/spdy/fuzzing/hpack_fuzz_util.h
+++ b/net/spdy/fuzzing/hpack_fuzz_util.h
@@ -5,6 +5,9 @@
#ifndef NET_SPDY_FUZZING_HPACK_FUZZ_UTIL_H_
#define NET_SPDY_FUZZING_HPACK_FUZZ_UTIL_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
@@ -82,7 +85,7 @@
// Flips random bits within |buffer|. The total number of flips is
// |flip_per_thousand| bits for every 1,024 bytes of |buffer_length|,
// rounding up.
- static void FlipBits(uint8* buffer,
+ static void FlipBits(uint8_t* buffer,
size_t buffer_length,
size_t flip_per_thousand);
};
diff --git a/net/spdy/fuzzing/hpack_fuzz_util_test.cc b/net/spdy/fuzzing/hpack_fuzz_util_test.cc
index 8dc9863..ecbcb6b2 100644
--- a/net/spdy/fuzzing/hpack_fuzz_util_test.cc
+++ b/net/spdy/fuzzing/hpack_fuzz_util_test.cc
@@ -140,9 +140,8 @@
string unmodified(buffer, arraysize(buffer) - 1);
EXPECT_EQ(unmodified, buffer);
- HpackFuzzUtil::FlipBits(reinterpret_cast<uint8*>(buffer),
- arraysize(buffer) - 1,
- 1);
+ HpackFuzzUtil::FlipBits(reinterpret_cast<uint8_t*>(buffer),
+ arraysize(buffer) - 1, 1);
EXPECT_NE(unmodified, buffer);
}
diff --git a/net/spdy/hpack/hpack_constants.h b/net/spdy/hpack/hpack_constants.h
index 57db72c..bc9b39be 100644
--- a/net/spdy/hpack/hpack_constants.h
+++ b/net/spdy/hpack/hpack_constants.h
@@ -5,9 +5,11 @@
#ifndef NET_SPDY_HPACK_CONSTANTS_H_
#define NET_SPDY_HPACK_CONSTANTS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <vector>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
// All section references below are to
@@ -18,15 +20,15 @@
// An HpackPrefix signifies |bits| stored in the top |bit_size| bits
// of an octet.
struct HpackPrefix {
- uint8 bits;
+ uint8_t bits;
size_t bit_size;
};
// Represents a symbol and its Huffman code (stored in most-significant bits).
struct HpackHuffmanSymbol {
- uint32 code;
- uint8 length;
- uint16 id;
+ uint32_t code;
+ uint8_t length;
+ uint16_t id;
};
// An entry in the static table. Must be a POD in order to avoid static
@@ -42,16 +44,16 @@
class HpackStaticTable;
// Defined in RFC 7540 section 6.5.2.
-const uint32 kDefaultHeaderTableSizeSetting = 4096;
+const uint32_t kDefaultHeaderTableSizeSetting = 4096;
// Largest string literal an HpackDecoder/HpackEncoder will attempt to process
// before returning an error.
-const uint32 kDefaultMaxStringLiteralSize = 16 * 1024;
+const uint32_t kDefaultMaxStringLiteralSize = 16 * 1024;
// Maximum amount of encoded header buffer HpackDecoder will retain before
// returning an error.
// TODO(jgraettinger): Remove with SpdyHeadersHandlerInterface switch.
-const uint32 kMaxDecodeBufferSize = 32 * 1024;
+const uint32_t kMaxDecodeBufferSize = 32 * 1024;
// 6.2: Flag for a string literal that is stored unmodified (i.e.,
// without Huffman encoding).
diff --git a/net/spdy/hpack/hpack_decoder.cc b/net/spdy/hpack/hpack_decoder.cc
index 54f07f7..ab5c7838 100644
--- a/net/spdy/hpack/hpack_decoder.cc
+++ b/net/spdy/hpack/hpack_decoder.cc
@@ -6,7 +6,6 @@
#include <utility>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/spdy/hpack/hpack_constants.h"
#include "net/spdy/hpack/hpack_output_stream.h"
@@ -131,7 +130,7 @@
bool HpackDecoder::DecodeNextHeaderTableSizeUpdate(
HpackInputStream* input_stream) {
- uint32 size = 0;
+ uint32_t size = 0;
if (!input_stream->DecodeNextUint32(&size)) {
return false;
}
@@ -143,7 +142,7 @@
}
bool HpackDecoder::DecodeNextIndexedHeader(HpackInputStream* input_stream) {
- uint32 index = 0;
+ uint32_t index = 0;
if (!input_stream->DecodeNextUint32(&index)) {
return false;
}
@@ -182,7 +181,7 @@
bool HpackDecoder::DecodeNextName(HpackInputStream* input_stream,
StringPiece* next_name) {
- uint32 index_or_zero = 0;
+ uint32_t index_or_zero = 0;
if (!input_stream->DecodeNextUint32(&index_or_zero)) {
return false;
}
diff --git a/net/spdy/hpack/hpack_decoder.h b/net/spdy/hpack/hpack_decoder.h
index a2ab7488..85c7f2b5 100644
--- a/net/spdy/hpack/hpack_decoder.h
+++ b/net/spdy/hpack/hpack_decoder.h
@@ -5,11 +5,13 @@
#ifndef NET_SPDY_HPACK_DECODER_H_
#define NET_SPDY_HPACK_DECODER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -91,7 +93,7 @@
bool HandleHeaderRepresentation(base::StringPiece name,
base::StringPiece value);
- const uint32 max_string_literal_size_;
+ const uint32_t max_string_literal_size_;
HpackHeaderTable header_table_;
// TODO(jgraettinger): Buffer for headers data, and storage for the last-
diff --git a/net/spdy/hpack/hpack_decoder_test.cc b/net/spdy/hpack/hpack_decoder_test.cc
index ac371df2c..bb21457d 100644
--- a/net/spdy/hpack/hpack_decoder_test.cc
+++ b/net/spdy/hpack/hpack_decoder_test.cc
@@ -7,7 +7,6 @@
#include <map>
#include <string>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/strings/string_piece.h"
#include "net/spdy/hpack/hpack_encoder.h"
diff --git a/net/spdy/hpack/hpack_encoder.h b/net/spdy/hpack/hpack_encoder.h
index 8b0865f..cd6558bb 100644
--- a/net/spdy/hpack/hpack_encoder.h
+++ b/net/spdy/hpack/hpack_encoder.h
@@ -5,12 +5,13 @@
#ifndef NET_SPDY_HPACK_ENCODER_H_
#define NET_SPDY_HPACK_ENCODER_H_
+#include <stddef.h>
+
#include <map>
#include <string>
#include <utility>
#include <vector>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
diff --git a/net/spdy/hpack/hpack_encoder_test.cc b/net/spdy/hpack/hpack_encoder_test.cc
index 441d724..10fd608 100644
--- a/net/spdy/hpack/hpack_encoder_test.cc
+++ b/net/spdy/hpack/hpack_encoder_test.cc
@@ -132,7 +132,7 @@
expected_.AppendUint32(value.size());
expected_.AppendBytes(value);
}
- void ExpectHeaderTableSizeUpdate(uint32 size) {
+ void ExpectHeaderTableSizeUpdate(uint32_t size) {
expected_.AppendPrefix(kHeaderTableSizeUpdateOpcode);
expected_.AppendUint32(size);
}
diff --git a/net/spdy/hpack/hpack_entry.h b/net/spdy/hpack/hpack_entry.h
index d3d2c618..b094810 100644
--- a/net/spdy/hpack/hpack_entry.h
+++ b/net/spdy/hpack/hpack_entry.h
@@ -5,9 +5,10 @@
#ifndef NET_SPDY_HPACK_ENTRY_H_
#define NET_SPDY_HPACK_ENTRY_H_
+#include <stddef.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
diff --git a/net/spdy/hpack/hpack_header_table.h b/net/spdy/hpack/hpack_header_table.h
index 881bb7cf..be0ac0b 100644
--- a/net/spdy/hpack/hpack_header_table.h
+++ b/net/spdy/hpack/hpack_header_table.h
@@ -9,7 +9,6 @@
#include <deque>
#include <set>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/spdy/hpack/hpack_entry.h"
diff --git a/net/spdy/hpack/hpack_header_table_test.cc b/net/spdy/hpack/hpack_header_table_test.cc
index 86b688b..1d9071d 100644
--- a/net/spdy/hpack/hpack_header_table_test.cc
+++ b/net/spdy/hpack/hpack_header_table_test.cc
@@ -9,7 +9,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "net/spdy/hpack/hpack_constants.h"
#include "net/spdy/hpack/hpack_entry.h"
@@ -75,7 +74,7 @@
HpackHeaderTableTest() : table_(), peer_(&table_) {}
// Returns an entry whose Size() is equal to the given one.
- static HpackEntry MakeEntryOfSize(uint32 size) {
+ static HpackEntry MakeEntryOfSize(uint32_t size) {
EXPECT_GE(size, HpackEntry::kSizeOverhead);
string name((size - HpackEntry::kSizeOverhead) / 2, 'n');
string value(size - HpackEntry::kSizeOverhead - name.size(), 'v');
@@ -86,10 +85,10 @@
// Returns a vector of entries whose total size is equal to the given
// one.
- static HpackEntryVector MakeEntriesOfTotalSize(uint32 total_size) {
+ static HpackEntryVector MakeEntriesOfTotalSize(uint32_t total_size) {
EXPECT_GE(total_size, HpackEntry::kSizeOverhead);
- uint32 entry_size = HpackEntry::kSizeOverhead;
- uint32 remaining_size = total_size;
+ uint32_t entry_size = HpackEntry::kSizeOverhead;
+ uint32_t remaining_size = total_size;
HpackEntryVector entries;
while (remaining_size > 0) {
EXPECT_LE(entry_size, remaining_size);
diff --git a/net/spdy/hpack/hpack_huffman_table.cc b/net/spdy/hpack/hpack_huffman_table.cc
index 8815e60..b56c58ec 100644
--- a/net/spdy/hpack/hpack_huffman_table.cc
+++ b/net/spdy/hpack/hpack_huffman_table.cc
@@ -20,9 +20,9 @@
namespace {
// How many bits to index in the root decode table.
-const uint8 kDecodeTableRootBits = 9;
+const uint8_t kDecodeTableRootBits = 9;
// Maximum number of bits to index in successive decode tables.
-const uint8 kDecodeTableBranchBits = 6;
+const uint8_t kDecodeTableBranchBits = 6;
bool SymbolLengthAndIdCompare(const HpackHuffmanSymbol& a,
const HpackHuffmanSymbol& b) {
@@ -39,9 +39,9 @@
HpackHuffmanTable::DecodeEntry::DecodeEntry()
: next_table_index(0), length(0), symbol_id(0) {}
-HpackHuffmanTable::DecodeEntry::DecodeEntry(uint8 next_table_index,
- uint8 length,
- uint16 symbol_id)
+HpackHuffmanTable::DecodeEntry::DecodeEntry(uint8_t next_table_index,
+ uint8_t length,
+ uint16_t symbol_id)
: next_table_index(next_table_index),
length(length),
symbol_id(symbol_id) {}
@@ -56,11 +56,11 @@
bool HpackHuffmanTable::Initialize(const HpackHuffmanSymbol* input_symbols,
size_t symbol_count) {
CHECK(!IsInitialized());
- DCHECK(base::IsValueInRangeForNumericType<uint16>(symbol_count));
+ DCHECK(base::IsValueInRangeForNumericType<uint16_t>(symbol_count));
std::vector<Symbol> symbols(symbol_count);
// Validate symbol id sequence, and copy into |symbols|.
- for (uint16 i = 0; i < symbol_count; i++) {
+ for (uint16_t i = 0; i < symbol_count; i++) {
if (i != input_symbols[i].id) {
failed_symbol_id_ = i;
return false;
@@ -75,7 +75,7 @@
}
for (size_t i = 1; i != symbols.size(); i++) {
unsigned code_shift = 32 - symbols[i - 1].length;
- uint32 code = symbols[i - 1].code + (1 << code_shift);
+ uint32_t code = symbols[i - 1].code + (1 << code_shift);
if (code != symbols[i].code) {
failed_symbol_id_ = symbols[i].id;
@@ -94,7 +94,7 @@
// of bytes.
return false;
}
- pad_bits_ = static_cast<uint8>(symbols.back().code >> 24);
+ pad_bits_ = static_cast<uint8_t>(symbols.back().code >> 24);
BuildDecodeTables(symbols);
// Order on symbol ID ascending.
@@ -122,18 +122,18 @@
// that entry without fear of introducing unneccesary branches later.
for (std::vector<Symbol>::const_reverse_iterator it = symbols.rbegin();
it != symbols.rend(); ++it) {
- uint8 table_index = 0;
+ uint8_t table_index = 0;
while (true) {
const DecodeTable table = decode_tables_[table_index];
// Mask and shift the portion of the code being indexed into low bits.
- uint32 index = (it->code << table.prefix_length);
+ uint32_t index = (it->code << table.prefix_length);
index = index >> (32 - table.indexed_length);
CHECK_LT(index, table.size());
DecodeEntry entry = Entry(table, index);
- uint8 total_indexed = table.prefix_length + table.indexed_length;
+ uint8_t total_indexed = table.prefix_length + table.indexed_length;
if (total_indexed >= it->length) {
// We're writing a terminal entry.
entry.length = it->length;
@@ -149,8 +149,8 @@
entry.length = it->length;
entry.next_table_index =
AddDecodeTable(total_indexed, // Becomes the new table prefix.
- std::min<uint8>(kDecodeTableBranchBits,
- entry.length - total_indexed));
+ std::min<uint8_t>(kDecodeTableBranchBits,
+ entry.length - total_indexed));
SetEntry(table, index, entry);
}
CHECK_NE(entry.next_table_index, table_index);
@@ -160,7 +160,7 @@
// Fill shorter table entries into the additional entry spots they map to.
for (size_t i = 0; i != decode_tables_.size(); i++) {
const DecodeTable& table = decode_tables_[i];
- uint8 total_indexed = table.prefix_length + table.indexed_length;
+ uint8_t total_indexed = table.prefix_length + table.indexed_length;
size_t j = 0;
while (j != table.size()) {
@@ -183,7 +183,7 @@
}
}
-uint8 HpackHuffmanTable::AddDecodeTable(uint8 prefix, uint8 indexed) {
+uint8_t HpackHuffmanTable::AddDecodeTable(uint8_t prefix, uint8_t indexed) {
CHECK_LT(decode_tables_.size(), 255u);
{
DecodeTable table;
@@ -193,19 +193,19 @@
decode_tables_.push_back(table);
}
decode_entries_.resize(decode_entries_.size() + (size_t(1) << indexed));
- return static_cast<uint8>(decode_tables_.size() - 1);
+ return static_cast<uint8_t>(decode_tables_.size() - 1);
}
const HpackHuffmanTable::DecodeEntry& HpackHuffmanTable::Entry(
const DecodeTable& table,
- uint32 index) const {
+ uint32_t index) const {
DCHECK_LT(index, table.size());
DCHECK_LT(table.entries_offset + index, decode_entries_.size());
return decode_entries_[table.entries_offset + index];
}
void HpackHuffmanTable::SetEntry(const DecodeTable& table,
- uint32 index,
+ uint32_t index,
const DecodeEntry& entry) {
CHECK_LT(index, table.size());
CHECK_LT(table.entries_offset + index, decode_entries_.size());
@@ -220,28 +220,28 @@
HpackOutputStream* out) const {
size_t bit_remnant = 0;
for (size_t i = 0; i != in.size(); i++) {
- uint16 symbol_id = static_cast<uint8>(in[i]);
+ uint16_t symbol_id = static_cast<uint8_t>(in[i]);
CHECK_GT(code_by_id_.size(), symbol_id);
// Load, and shift code to low bits.
unsigned length = length_by_id_[symbol_id];
- uint32 code = code_by_id_[symbol_id] >> (32 - length);
+ uint32_t code = code_by_id_[symbol_id] >> (32 - length);
bit_remnant = (bit_remnant + length) % 8;
if (length > 24) {
- out->AppendBits(static_cast<uint8>(code >> 24), length - 24);
+ out->AppendBits(static_cast<uint8_t>(code >> 24), length - 24);
length = 24;
}
if (length > 16) {
- out->AppendBits(static_cast<uint8>(code >> 16), length - 16);
+ out->AppendBits(static_cast<uint8_t>(code >> 16), length - 16);
length = 16;
}
if (length > 8) {
- out->AppendBits(static_cast<uint8>(code >> 8), length - 8);
+ out->AppendBits(static_cast<uint8_t>(code >> 8), length - 8);
length = 8;
}
- out->AppendBits(static_cast<uint8>(code), length);
+ out->AppendBits(static_cast<uint8_t>(code), length);
}
if (bit_remnant != 0) {
// Pad current byte as required.
@@ -252,7 +252,7 @@
size_t HpackHuffmanTable::EncodedSize(StringPiece in) const {
size_t bit_count = 0;
for (size_t i = 0; i != in.size(); i++) {
- uint16 symbol_id = static_cast<uint8>(in[i]);
+ uint16_t symbol_id = static_cast<uint8_t>(in[i]);
CHECK_GT(code_by_id_.size(), symbol_id);
bit_count += length_by_id_[symbol_id];
@@ -273,13 +273,13 @@
out->clear();
// Current input, stored in the high |bits_available| bits of |bits|.
- uint32 bits = 0;
+ uint32_t bits = 0;
size_t bits_available = 0;
bool peeked_success = in->PeekBits(&bits_available, &bits);
while (true) {
const DecodeTable* table = &decode_tables_[0];
- uint32 index = bits >> (32 - kDecodeTableRootBits);
+ uint32_t index = bits >> (32 - kDecodeTableRootBits);
for (int i = 0; i != kDecodeIterations; i++) {
DCHECK_LT(index, table->size());
diff --git a/net/spdy/hpack/hpack_huffman_table.h b/net/spdy/hpack/hpack_huffman_table.h
index 1904a7b..5662715 100644
--- a/net/spdy/hpack/hpack_huffman_table.h
+++ b/net/spdy/hpack/hpack_huffman_table.h
@@ -5,11 +5,12 @@
#ifndef NET_SPDY_HPACK_HUFFMAN_TABLE_H_
#define NET_SPDY_HPACK_HUFFMAN_TABLE_H_
+#include <stdint.h>
+
#include <cstddef>
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/spdy/hpack/hpack_constants.h"
@@ -38,22 +39,22 @@
// with successive portions of the prefix.
struct NET_EXPORT_PRIVATE DecodeEntry {
DecodeEntry();
- DecodeEntry(uint8 next_table_index, uint8 length, uint16 symbol_id);
+ DecodeEntry(uint8_t next_table_index, uint8_t length, uint16_t symbol_id);
// The next table to consult. If this is a terminal,
// |next_table_index| will be self-referential.
- uint8 next_table_index;
+ uint8_t next_table_index;
// Bit-length of terminal code, if this is a terminal. Length of the
// longest code having this prefix, if non-terminal.
- uint8 length;
+ uint8_t length;
// Set only for terminal entries.
- uint16 symbol_id;
+ uint16_t symbol_id;
};
struct NET_EXPORT_PRIVATE DecodeTable {
// Number of bits indexed by the chain leading to this table.
- uint8 prefix_length;
+ uint8_t prefix_length;
// Number of additional prefix bits this table indexes.
- uint8 indexed_length;
+ uint8_t indexed_length;
// Entries are represented as a length |size()| slice into
// |decode_entries_| beginning at |entries_offset|.
size_t entries_offset;
@@ -68,7 +69,7 @@
// code as determined by the given symbols. Must be called exactly once.
// Returns false if the input symbols define an invalid coding, and true
// otherwise. Symbols must be presented in ascending ID order with no gaps,
- // and |symbol_count| must fit in a uint16.
+ // and |symbol_count| must fit in a uint16_t.
bool Initialize(const Symbol* input_symbols, size_t symbol_count);
// Returns whether Initialize() has been successfully called.
@@ -99,12 +100,12 @@
// Adds a new DecodeTable with the argument prefix & indexed length.
// Returns the new table index.
- uint8 AddDecodeTable(uint8 prefix, uint8 indexed);
+ uint8_t AddDecodeTable(uint8_t prefix, uint8_t indexed);
- const DecodeEntry& Entry(const DecodeTable& table, uint32 index) const;
+ const DecodeEntry& Entry(const DecodeTable& table, uint32_t index) const;
void SetEntry(const DecodeTable& table,
- uint32 index,
+ uint32_t index,
const DecodeEntry& entry);
std::vector<DecodeTable> decode_tables_;
@@ -112,15 +113,15 @@
// Symbol code and code length, in ascending symbol ID order.
// Codes are stored in the most-significant bits of the word.
- std::vector<uint32> code_by_id_;
- std::vector<uint8> length_by_id_;
+ std::vector<uint32_t> code_by_id_;
+ std::vector<uint8_t> length_by_id_;
// The first 8 bits of the longest code. Applied when generating padding bits.
- uint8 pad_bits_;
+ uint8_t pad_bits_;
// If initialization fails, preserve the symbol ID which failed validation
// for examination in tests.
- uint16 failed_symbol_id_;
+ uint16_t failed_symbol_id_;
};
} // namespace net
diff --git a/net/spdy/hpack/hpack_input_stream.cc b/net/spdy/hpack/hpack_input_stream.cc
index 8b6e69e..f1869285 100644
--- a/net/spdy/hpack/hpack_input_stream.cc
+++ b/net/spdy/hpack/hpack_input_stream.cc
@@ -6,7 +6,6 @@
#include <algorithm>
-#include "base/basictypes.h"
#include "base/logging.h"
namespace net {
@@ -14,7 +13,7 @@
using base::StringPiece;
using std::string;
-HpackInputStream::HpackInputStream(uint32 max_string_literal_size,
+HpackInputStream::HpackInputStream(uint32_t max_string_literal_size,
StringPiece buffer)
: max_string_literal_size_(max_string_literal_size),
buffer_(buffer),
@@ -30,7 +29,7 @@
DCHECK_GT(prefix.bit_size, 0u);
DCHECK_LE(prefix.bit_size, 8u);
- uint32 peeked = 0;
+ uint32_t peeked = 0;
size_t peeked_count = 0;
if (!PeekBits(&peeked_count, &peeked)) {
@@ -44,7 +43,7 @@
return false;
}
-bool HpackInputStream::PeekNextOctet(uint8* next_octet) {
+bool HpackInputStream::PeekNextOctet(uint8_t* next_octet) {
if ((bit_offset_ > 0) || buffer_.empty()) {
return false;
}
@@ -53,7 +52,7 @@
return true;
}
-bool HpackInputStream::DecodeNextOctet(uint8* next_octet) {
+bool HpackInputStream::DecodeNextOctet(uint8_t* next_octet) {
if (!PeekNextOctet(next_octet)) {
return false;
}
@@ -62,7 +61,7 @@
return true;
}
-bool HpackInputStream::DecodeNextUint32(uint32* I) {
+bool HpackInputStream::DecodeNextUint32(uint32_t* I) {
size_t N = 8 - bit_offset_;
DCHECK_GT(N, 0u);
DCHECK_LE(N, 8u);
@@ -71,8 +70,8 @@
*I = 0;
- uint8 next_marker = (1 << N) - 1;
- uint8 next_octet = 0;
+ uint8_t next_marker = (1 << N) - 1;
+ uint8_t next_octet = 0;
if (!DecodeNextOctet(&next_octet)) {
return false;
}
@@ -81,13 +80,13 @@
bool has_more = (*I == next_marker);
size_t shift = 0;
while (has_more && (shift < 32)) {
- uint8 next_octet = 0;
+ uint8_t next_octet = 0;
if (!DecodeNextOctet(&next_octet)) {
return false;
}
has_more = (next_octet & 0x80) != 0;
next_octet &= 0x7f;
- uint32 addend = next_octet << shift;
+ uint32_t addend = next_octet << shift;
// Check for overflow.
if ((addend >> shift) != next_octet) {
return false;
@@ -100,7 +99,7 @@
}
bool HpackInputStream::DecodeNextIdentityString(StringPiece* str) {
- uint32 size = 0;
+ uint32_t size = 0;
if (!DecodeNextUint32(&size)) {
return false;
}
@@ -120,7 +119,7 @@
bool HpackInputStream::DecodeNextHuffmanString(const HpackHuffmanTable& table,
string* str) {
- uint32 encoded_size = 0;
+ uint32_t encoded_size = 0;
if (!DecodeNextUint32(&encoded_size)) {
return false;
}
@@ -137,7 +136,7 @@
return table.DecodeString(&bounded_reader, max_string_literal_size_, str);
}
-bool HpackInputStream::PeekBits(size_t* peeked_count, uint32* out) const {
+bool HpackInputStream::PeekBits(size_t* peeked_count, uint32_t* out) const {
size_t byte_offset = (bit_offset_ + *peeked_count) / 8;
size_t bit_offset = (bit_offset_ + *peeked_count) % 8;
@@ -148,7 +147,7 @@
// and the remaining unfilled bits of |out|.
size_t bits_to_read = std::min(32 - *peeked_count, 8 - bit_offset);
- uint32 new_bits = static_cast<uint32>(buffer_[byte_offset]);
+ uint32_t new_bits = static_cast<uint32_t>(buffer_[byte_offset]);
// Shift byte remainder to most-signifcant bits of |new_bits|.
// This drops the leading |bit_offset| bits of the byte.
new_bits = new_bits << (24 + bit_offset);
diff --git a/net/spdy/hpack/hpack_input_stream.h b/net/spdy/hpack/hpack_input_stream.h
index 2f929ee..e7787f7 100644
--- a/net/spdy/hpack/hpack_input_stream.h
+++ b/net/spdy/hpack/hpack_input_stream.h
@@ -5,9 +5,11 @@
#ifndef NET_SPDY_HPACK_INPUT_STREAM_H_
#define NET_SPDY_HPACK_INPUT_STREAM_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -25,7 +27,7 @@
public:
// |max_string_literal_size| is the largest that any one string
// literal (header name or header value) can be.
- HpackInputStream(uint32 max_string_literal_size, base::StringPiece buffer);
+ HpackInputStream(uint32_t max_string_literal_size, base::StringPiece buffer);
~HpackInputStream();
// Returns whether or not there is more data to process.
@@ -38,7 +40,7 @@
// The Decode* functions return true and fill in their arguments if
// decoding was successful, or false if an error was encountered.
- bool DecodeNextUint32(uint32* I);
+ bool DecodeNextUint32(uint32_t* I);
bool DecodeNextIdentityString(base::StringPiece* str);
bool DecodeNextHuffmanString(const HpackHuffmanTable& table,
std::string* str);
@@ -48,7 +50,7 @@
// previously peeked. PeekBits() will fill some number of remaining bits,
// returning the new total number via |peeked_count|. Returns true if one
// or more additional bits could be peeked, and false otherwise.
- bool PeekBits(size_t* peeked_count, uint32* out) const;
+ bool PeekBits(size_t* peeked_count, uint32_t* out) const;
// Consumes |count| bits of input. Generally paired with PeekBits().
void ConsumeBits(size_t count);
@@ -62,13 +64,13 @@
void SetBitOffsetForTest(size_t bit_offset) { bit_offset_ = bit_offset; }
private:
- const uint32 max_string_literal_size_;
+ const uint32_t max_string_literal_size_;
base::StringPiece buffer_;
size_t bit_offset_;
- bool PeekNextOctet(uint8* next_octet);
+ bool PeekNextOctet(uint8_t* next_octet);
- bool DecodeNextOctet(uint8* next_octet);
+ bool DecodeNextOctet(uint8_t* next_octet);
DISALLOW_COPY_AND_ASSIGN(HpackInputStream);
};
diff --git a/net/spdy/hpack/hpack_input_stream_test.cc b/net/spdy/hpack/hpack_input_stream_test.cc
index 3468516a..6c4108f 100644
--- a/net/spdy/hpack/hpack_input_stream_test.cc
+++ b/net/spdy/hpack/hpack_input_stream_test.cc
@@ -45,30 +45,30 @@
const char kDecodedHuffmanFixture[] =
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1";
-// Utility function to decode an assumed-valid uint32 with an N-bit
+// Utility function to decode an assumed-valid uint32_t with an N-bit
// prefix.
-uint32 DecodeValidUint32(uint8 N, StringPiece str) {
+uint32_t DecodeValidUint32(uint8_t N, StringPiece str) {
EXPECT_GT(N, 0);
EXPECT_LE(N, 8);
HpackInputStream input_stream(kLiteralBound, str);
input_stream.SetBitOffsetForTest(8 - N);
- uint32 I;
+ uint32_t I;
EXPECT_TRUE(input_stream.DecodeNextUint32(&I));
return I;
}
-// Utility function to decode an assumed-invalid uint32 with an N-bit
+// Utility function to decode an assumed-invalid uint32_t with an N-bit
// prefix.
-void ExpectDecodeUint32Invalid(uint8 N, StringPiece str) {
+void ExpectDecodeUint32Invalid(uint8_t N, StringPiece str) {
EXPECT_GT(N, 0);
EXPECT_LE(N, 8);
HpackInputStream input_stream(kLiteralBound, str);
input_stream.SetBitOffsetForTest(8 - N);
- uint32 I;
+ uint32_t I;
EXPECT_FALSE(input_stream.DecodeNextUint32(&I));
}
-uint32 bits32(const string& bitstring) {
+uint32_t bits32(const string& bitstring) {
return std::bitset<32>(bitstring).to_ulong();
}
@@ -147,7 +147,7 @@
ExpectDecodeUint32Invalid(8, "\xff\xff\xff\xff\xff\xff");
}
-// There are no valid uint32 encodings that are greater than six
+// There are no valid uint32_t encodings that are greater than six
// bytes.
TEST_F(HpackInputStreamTest, SevenByteIntegersEightBitPrefix) {
ExpectDecodeUint32Invalid(8, "\xff\x80\x80\x80\x80\x80\x00");
@@ -459,7 +459,7 @@
ExpectDecodeUint32Invalid(1, "\xff\xfe\xff\xff\xff\xff");
}
-// There are no valid uint32 encodings that are greater than six
+// There are no valid uint32_t encodings that are greater than six
// bytes.
TEST_F(HpackInputStreamTest, SevenByteIntegersOneToSevenBitPrefixes) {
ExpectDecodeUint32Invalid(7, "\x7f\x80\x80\x80\x80\x80\x00");
@@ -550,7 +550,7 @@
TEST_F(HpackInputStreamTest, PeekBitsAndConsume) {
HpackInputStream input_stream(kLiteralBound, "\xad\xab\xad\xab\xad");
- uint32 bits = 0;
+ uint32_t bits = 0;
size_t peeked_count = 0;
// Read 0xad.
diff --git a/net/spdy/hpack/hpack_output_stream.cc b/net/spdy/hpack/hpack_output_stream.cc
index d2342b1..18aa4e6 100644
--- a/net/spdy/hpack/hpack_output_stream.cc
+++ b/net/spdy/hpack/hpack_output_stream.cc
@@ -15,7 +15,7 @@
HpackOutputStream::~HpackOutputStream() {}
-void HpackOutputStream::AppendBits(uint8 bits, size_t bit_size) {
+void HpackOutputStream::AppendBits(uint8_t bits, size_t bit_size) {
DCHECK_GT(bit_size, 0u);
DCHECK_LE(bit_size, 8u);
DCHECK_EQ(bits >> bit_size, 0);
@@ -46,12 +46,12 @@
buffer_.append(buffer.data(), buffer.size());
}
-void HpackOutputStream::AppendUint32(uint32 I) {
+void HpackOutputStream::AppendUint32(uint32_t I) {
// The algorithm below is adapted from the pseudocode in 6.1.
size_t N = 8 - bit_offset_;
- uint8 max_first_byte = static_cast<uint8>((1 << N) - 1);
+ uint8_t max_first_byte = static_cast<uint8_t>((1 << N) - 1);
if (I < max_first_byte) {
- AppendBits(static_cast<uint8>(I), N);
+ AppendBits(static_cast<uint8_t>(I), N);
} else {
AppendBits(max_first_byte, N);
I -= max_first_byte;
@@ -59,7 +59,7 @@
buffer_.append(1, (I & 0x7f) | 0x80);
I >>= 7;
}
- AppendBits(static_cast<uint8>(I), 8);
+ AppendBits(static_cast<uint8_t>(I), 8);
}
}
diff --git a/net/spdy/hpack/hpack_output_stream.h b/net/spdy/hpack/hpack_output_stream.h
index 5063900..0c5a013a 100644
--- a/net/spdy/hpack/hpack_output_stream.h
+++ b/net/spdy/hpack/hpack_output_stream.h
@@ -5,10 +5,12 @@
#ifndef NET_SPDY_HPACK_OUTPUT_STREAM_H_
#define NET_SPDY_HPACK_OUTPUT_STREAM_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
#include <string>
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -30,7 +32,7 @@
//
// |bit_size| must be > 0 and <= 8. |bits| must not have any bits
// set other than the lower |bit_size| bits.
- void AppendBits(uint8 bits, size_t bit_size);
+ void AppendBits(uint8_t bits, size_t bit_size);
// Simply forwards to AppendBits(prefix.bits, prefix.bit-size).
void AppendPrefix(HpackPrefix prefix);
@@ -45,7 +47,7 @@
//
// It is guaranteed that the internal buffer will end on a byte
// boundary after this function is called.
- void AppendUint32(uint32 I);
+ void AppendUint32(uint32_t I);
// Swaps the interal buffer with |output|.
void TakeString(std::string* output);
diff --git a/net/spdy/hpack/hpack_output_stream_test.cc b/net/spdy/hpack/hpack_output_stream_test.cc
index 48b5dcc..939dd9d 100644
--- a/net/spdy/hpack/hpack_output_stream_test.cc
+++ b/net/spdy/hpack/hpack_output_stream_test.cc
@@ -6,7 +6,6 @@
#include <cstddef>
-#include "base/basictypes.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
@@ -47,7 +46,7 @@
// Utility function to return I as a string encoded with an N-bit
// prefix.
-string EncodeUint32(uint8 N, uint32 I) {
+string EncodeUint32(uint8_t N, uint32_t I) {
HpackOutputStream output_stream;
if (N < 8) {
output_stream.AppendBits(0x00, 8 - N);
diff --git a/net/spdy/hpack/hpack_static_table.h b/net/spdy/hpack/hpack_static_table.h
index e7e0fd4..e7616b3 100644
--- a/net/spdy/hpack/hpack_static_table.h
+++ b/net/spdy/hpack/hpack_static_table.h
@@ -5,6 +5,8 @@
#ifndef NET_SPDY_HPACK_STATIC_TABLE_H_
#define NET_SPDY_HPACK_STATIC_TABLE_H_
+#include <stddef.h>
+
#include "net/spdy/hpack/hpack_header_table.h"
namespace net {
diff --git a/net/spdy/mock_spdy_framer_visitor.h b/net/spdy/mock_spdy_framer_visitor.h
index 2c08392..85bf5ba 100644
--- a/net/spdy/mock_spdy_framer_visitor.h
+++ b/net/spdy/mock_spdy_framer_visitor.h
@@ -5,6 +5,9 @@
#ifndef NET_SPDY_MOCK_SPDY_FRAMER_VISITOR_H_
#define NET_SPDY_MOCK_SPDY_FRAMER_VISITOR_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include "base/strings/string_piece.h"
#include "net/spdy/spdy_framer.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -41,7 +44,8 @@
MOCK_METHOD2(OnRstStream, void(SpdyStreamId stream_id,
SpdyRstStreamStatus status));
MOCK_METHOD1(OnSettings, void(bool clear_persisted));
- MOCK_METHOD3(OnSetting, void(SpdySettingsIds id, uint8 flags, uint32 value));
+ MOCK_METHOD3(OnSetting,
+ void(SpdySettingsIds id, uint8_t flags, uint32_t value));
MOCK_METHOD2(OnPing, void(SpdyPingId unique_id, bool is_ack));
MOCK_METHOD0(OnSettingsEnd, void());
MOCK_METHOD2(OnGoAway, void(SpdyStreamId last_accepted_stream_id,
@@ -69,7 +73,7 @@
MOCK_METHOD4(OnPriority,
void(SpdyStreamId stream_id,
SpdyStreamId parent_stream_id,
- uint8 weight,
+ uint8_t weight,
bool exclusive));
MOCK_METHOD2(OnUnknownFrame, bool(SpdyStreamId stream_id, int frame_type));
};
diff --git a/net/spdy/priority_write_scheduler.h b/net/spdy/priority_write_scheduler.h
index ab5da01..dd16b41 100644
--- a/net/spdy/priority_write_scheduler.h
+++ b/net/spdy/priority_write_scheduler.h
@@ -5,6 +5,8 @@
#ifndef NET_SPDY_PRIORITY_WRITE_SCHEDULER_H_
#define NET_SPDY_PRIORITY_WRITE_SCHEDULER_H_
+#include <stddef.h>
+
#include <algorithm>
#include <deque>
#include <unordered_map>
diff --git a/net/spdy/spdy_alt_svc_wire_format.cc b/net/spdy/spdy_alt_svc_wire_format.cc
index f2f5ab7a..ba32160 100644
--- a/net/spdy/spdy_alt_svc_wire_format.cc
+++ b/net/spdy/spdy_alt_svc_wire_format.cc
@@ -41,8 +41,8 @@
SpdyAltSvcWireFormat::AlternativeService::AlternativeService(
const std::string& protocol_id,
const std::string& host,
- uint16 port,
- uint32 max_age,
+ uint16_t port,
+ uint32_t max_age,
double probability,
VersionVector version)
: protocol_id(protocol_id),
@@ -103,13 +103,13 @@
}
DCHECK_EQ('"', *c);
std::string host;
- uint16 port;
+ uint16_t port;
if (!ParseAltAuthority(alt_authority_begin, c, &host, &port)) {
return false;
}
++c;
// Parse parameters.
- uint32 max_age = 86400;
+ uint32_t max_age = 86400;
double probability = 1.0;
VersionVector version;
StringPiece::const_iterator parameters_end = std::find(c, value.end(), ',');
@@ -174,7 +174,7 @@
while (v_end < c - 1 && *v_end != ',') {
++v_end;
}
- uint16 v;
+ uint16_t v;
if (!ParsePositiveInteger16(v_begin, v_end, &v)) {
return false;
}
@@ -312,7 +312,7 @@
bool SpdyAltSvcWireFormat::ParseAltAuthority(StringPiece::const_iterator c,
StringPiece::const_iterator end,
std::string* host,
- uint16* port) {
+ uint16_t* port) {
host->clear();
for (; c != end && *c != ':'; ++c) {
if (*c == '"') {
@@ -339,16 +339,16 @@
bool SpdyAltSvcWireFormat::ParsePositiveInteger16(
StringPiece::const_iterator c,
StringPiece::const_iterator end,
- uint16* value) {
- return ParsePositiveIntegerImpl<uint16>(c, end, value);
+ uint16_t* value) {
+ return ParsePositiveIntegerImpl<uint16_t>(c, end, value);
}
// static
bool SpdyAltSvcWireFormat::ParsePositiveInteger32(
StringPiece::const_iterator c,
StringPiece::const_iterator end,
- uint32* value) {
- return ParsePositiveIntegerImpl<uint32>(c, end, value);
+ uint32_t* value) {
+ return ParsePositiveIntegerImpl<uint32_t>(c, end, value);
}
// Probability is a decimal fraction between 0.0 and 1.0, inclusive, with
diff --git a/net/spdy/spdy_alt_svc_wire_format.h b/net/spdy/spdy_alt_svc_wire_format.h
index 85dd0d3b..28b4572 100644
--- a/net/spdy/spdy_alt_svc_wire_format.h
+++ b/net/spdy/spdy_alt_svc_wire_format.h
@@ -10,9 +10,10 @@
#ifndef NET_SPDY_SPDY_ALT_SVC_WIRE_FORMAT_H_
#define NET_SPDY_SPDY_ALT_SVC_WIRE_FORMAT_H_
+#include <stdint.h>
+
#include <vector>
-#include "base/basictypes.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -24,16 +25,16 @@
class NET_EXPORT_PRIVATE SpdyAltSvcWireFormat {
public:
- using VersionVector = std::vector<uint16>;
+ using VersionVector = std::vector<uint16_t>;
struct NET_EXPORT_PRIVATE AlternativeService {
std::string protocol_id;
std::string host;
// Default is 0: invalid port.
- uint16 port = 0;
+ uint16_t port = 0;
// Default is one day.
- uint32 max_age = 86400;
+ uint32_t max_age = 86400;
// Default is always use.
double probability = 1.0;
// Default is empty: unspecified version.
@@ -42,8 +43,8 @@
AlternativeService();
AlternativeService(const std::string& protocol_id,
const std::string& host,
- uint16 port,
- uint32 max_age,
+ uint16_t port,
+ uint32_t max_age,
double probability,
VersionVector version);
~AlternativeService();
@@ -74,13 +75,13 @@
static bool ParseAltAuthority(base::StringPiece::const_iterator c,
base::StringPiece::const_iterator end,
std::string* host,
- uint16* port);
+ uint16_t* port);
static bool ParsePositiveInteger16(base::StringPiece::const_iterator c,
base::StringPiece::const_iterator end,
- uint16* value);
+ uint16_t* value);
static bool ParsePositiveInteger32(base::StringPiece::const_iterator c,
base::StringPiece::const_iterator end,
- uint32* value);
+ uint32_t* value);
static bool ParseProbability(base::StringPiece::const_iterator c,
base::StringPiece::const_iterator end,
double* probability);
diff --git a/net/spdy/spdy_alt_svc_wire_format_test.cc b/net/spdy/spdy_alt_svc_wire_format_test.cc
index f6db9f5..565194f 100644
--- a/net/spdy/spdy_alt_svc_wire_format_test.cc
+++ b/net/spdy/spdy_alt_svc_wire_format_test.cc
@@ -30,17 +30,17 @@
static bool ParseAltAuthority(StringPiece::const_iterator c,
StringPiece::const_iterator end,
std::string* host,
- uint16* port) {
+ uint16_t* port) {
return SpdyAltSvcWireFormat::ParseAltAuthority(c, end, host, port);
}
static bool ParsePositiveInteger16(StringPiece::const_iterator c,
StringPiece::const_iterator end,
- uint16* max_age) {
+ uint16_t* max_age) {
return SpdyAltSvcWireFormat::ParsePositiveInteger16(c, end, max_age);
}
static bool ParsePositiveInteger32(StringPiece::const_iterator c,
StringPiece::const_iterator end,
- uint32* max_age) {
+ uint32_t* max_age) {
return SpdyAltSvcWireFormat::ParsePositiveInteger32(c, end, max_age);
}
static bool ParseProbability(StringPiece::const_iterator c,
@@ -431,7 +431,7 @@
TEST(SpdyAltSvcWireFormatTest, ParseAltAuthorityValid) {
StringPiece input(":42");
std::string host;
- uint16 port;
+ uint16_t port;
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParseAltAuthority(
input.begin(), input.end(), &host, &port));
EXPECT_TRUE(host.empty());
@@ -452,7 +452,7 @@
for (const char* invalid_input : invalid_input_array) {
StringPiece input(invalid_input);
std::string host;
- uint16 port;
+ uint16_t port;
EXPECT_FALSE(test::SpdyAltSvcWireFormatPeer::ParseAltAuthority(
input.begin(), input.end(), &host, &port))
<< input;
@@ -462,7 +462,7 @@
// Test ParseInteger() on valid input.
TEST(SpdyAltSvcWireFormatTest, ParseIntegerValid) {
StringPiece input("3");
- uint16 value;
+ uint16_t value;
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value));
EXPECT_EQ(3, value);
@@ -479,7 +479,7 @@
const char* invalid_input_array[] = {"", " ", "a", "0", "00", "1 ", "12b"};
for (const char* invalid_input : invalid_input_array) {
StringPiece input(invalid_input);
- uint16 value;
+ uint16_t value;
EXPECT_FALSE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value))
<< input;
@@ -488,14 +488,14 @@
// Test ParseIntegerValid() around overflow limit.
TEST(SpdyAltSvcWireFormatTest, ParseIntegerOverflow) {
- // Largest possible uint16 value.
+ // Largest possible uint16_t value.
StringPiece input("65535");
- uint16 value16;
+ uint16_t value16;
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value16));
EXPECT_EQ(65535, value16);
- // Overflow uint16, ParsePositiveInteger16() should return false.
+ // Overflow uint16_t, ParsePositiveInteger16() should return false.
input = StringPiece("65536");
ASSERT_FALSE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value16));
@@ -506,14 +506,14 @@
ASSERT_FALSE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value16));
- // Largest possible uint32 value.
+ // Largest possible uint32_t value.
input = StringPiece("4294967295");
- uint32 value32;
+ uint32_t value32;
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger32(
input.begin(), input.end(), &value32));
EXPECT_EQ(4294967295, value32);
- // Overflow uint32, ParsePositiveInteger32() should return false.
+ // Overflow uint32_t, ParsePositiveInteger32() should return false.
input = StringPiece("4294967296");
ASSERT_FALSE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger32(
input.begin(), input.end(), &value32));
diff --git a/net/spdy/spdy_buffer.cc b/net/spdy/spdy_buffer.cc
index f7cd3786..4482f99 100644
--- a/net/spdy/spdy_buffer.cc
+++ b/net/spdy/spdy_buffer.cc
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "net/base/io_buffer.h"
#include "net/spdy/spdy_protocol.h"
diff --git a/net/spdy/spdy_buffer.h b/net/spdy/spdy_buffer.h
index 60bdab7..94ee97f 100644
--- a/net/spdy/spdy_buffer.h
+++ b/net/spdy/spdy_buffer.h
@@ -8,8 +8,8 @@
#include <cstddef>
#include <vector>
-#include "base/basictypes.h"
#include "base/callback_forward.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/spdy/spdy_buffer_producer.h b/net/spdy/spdy_buffer_producer.h
index d098bb9a..849ecd2 100644
--- a/net/spdy/spdy_buffer_producer.h
+++ b/net/spdy/spdy_buffer_producer.h
@@ -5,8 +5,8 @@
#ifndef NET_SPDY_SPDY_BUFFER_PRODUCER_H_
#define NET_SPDY_SPDY_BUFFER_PRODUCER_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/spdy/spdy_buffer_unittest.cc b/net/spdy/spdy_buffer_unittest.cc
index 7c14ee9..4200916 100644
--- a/net/spdy/spdy_buffer_unittest.cc
+++ b/net/spdy/spdy_buffer_unittest.cc
@@ -8,7 +8,6 @@
#include <cstring>
#include <string>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
diff --git a/net/spdy/spdy_frame_builder.cc b/net/spdy/spdy_frame_builder.cc
index 3d8d2e5..fb8cdcc 100644
--- a/net/spdy/spdy_frame_builder.cc
+++ b/net/spdy/spdy_frame_builder.cc
@@ -16,15 +16,15 @@
// A special structure for the 8 bit flags and 24 bit length fields.
union FlagsAndLength {
- uint8 flags[4]; // 8 bits
- uint32 length; // 24 bits
+ uint8_t flags[4]; // 8 bits
+ uint32_t length; // 24 bits
};
// Creates a FlagsAndLength.
-FlagsAndLength CreateFlagsAndLength(uint8 flags, size_t length) {
+FlagsAndLength CreateFlagsAndLength(uint8_t flags, size_t length) {
DCHECK_EQ(0u, length & ~static_cast<size_t>(kLengthMask));
FlagsAndLength flags_length;
- flags_length.length = base::HostToNet32(static_cast<uint32>(length));
+ flags_length.length = base::HostToNet32(static_cast<uint32_t>(length));
DCHECK_EQ(0, flags & ~kControlFlagsMask);
flags_length.flags[0] = flags;
return flags_length;
@@ -61,7 +61,7 @@
bool SpdyFrameBuilder::WriteControlFrameHeader(const SpdyFramer& framer,
SpdyFrameType type,
- uint8 flags) {
+ uint8_t flags) {
DCHECK_GE(SPDY3, version_);
DCHECK(SpdyConstants::IsValidFrameType(
version_, SpdyConstants::SerializeFrameType(version_, type)));
@@ -79,7 +79,7 @@
bool SpdyFrameBuilder::WriteDataFrameHeader(const SpdyFramer& framer,
SpdyStreamId stream_id,
- uint8 flags) {
+ uint8_t flags) {
if (version_ > SPDY3) {
return BeginNewFrame(framer, DATA, flags, stream_id);
}
@@ -89,7 +89,7 @@
size_t length_field = capacity_ - framer.GetDataFrameMinimumSize();
DCHECK_EQ(0u, length_field & ~static_cast<size_t>(kLengthMask));
FlagsAndLength flags_length;
- flags_length.length = base::HostToNet32(static_cast<uint32>(length_field));
+ flags_length.length = base::HostToNet32(static_cast<uint32_t>(length_field));
DCHECK_EQ(0, flags & ~kDataFlagsMask);
flags_length.flags[0] = flags;
success &= WriteBytes(&flags_length, sizeof(flags_length));
@@ -99,7 +99,7 @@
bool SpdyFrameBuilder::BeginNewFrame(const SpdyFramer& framer,
SpdyFrameType type,
- uint8 flags,
+ uint8_t flags,
SpdyStreamId stream_id) {
DCHECK(SpdyConstants::IsValidFrameType(
version_, SpdyConstants::SerializeFrameType(version_, type)));
@@ -136,11 +136,11 @@
return false;
}
- if (!WriteUInt16(static_cast<uint16>(value.size()))) {
+ if (!WriteUInt16(static_cast<uint16_t>(value.size()))) {
return false;
}
- return WriteBytes(value.data(), static_cast<uint16>(value.size()));
+ return WriteBytes(value.data(), static_cast<uint16_t>(value.size()));
}
bool SpdyFrameBuilder::WriteStringPiece32(const base::StringPiece& value) {
@@ -151,7 +151,7 @@
return WriteBytes(value.data(), value.size());
}
-bool SpdyFrameBuilder::WriteBytes(const void* data, uint32 data_len) {
+bool SpdyFrameBuilder::WriteBytes(const void* data, uint32_t data_len) {
if (!CanWrite(data_len)) {
return false;
}
@@ -197,8 +197,7 @@
return success;
}
-bool SpdyFrameBuilder::OverwriteFlags(const SpdyFramer& framer,
- uint8 flags) {
+bool SpdyFrameBuilder::OverwriteFlags(const SpdyFramer& framer, uint8_t flags) {
DCHECK_GT(framer.protocol_version(), SPDY3);
bool success = false;
const size_t old_length = length_;
diff --git a/net/spdy/spdy_frame_builder.h b/net/spdy/spdy_frame_builder.h
index a91659e..8d75aef7 100644
--- a/net/spdy/spdy_frame_builder.h
+++ b/net/spdy/spdy_frame_builder.h
@@ -5,9 +5,11 @@
#ifndef NET_SPDY_SPDY_FRAME_BUILDER_H_
#define NET_SPDY_SPDY_FRAME_BUILDER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "base/sys_byteorder.h"
@@ -54,13 +56,13 @@
// Used only for SPDY versions <4.
bool WriteControlFrameHeader(const SpdyFramer& framer,
SpdyFrameType type,
- uint8 flags);
+ uint8_t flags);
// Populates this frame with a SPDY data frame header using version-specific
// information from the |framer| and length information from capacity_.
bool WriteDataFrameHeader(const SpdyFramer& framer,
SpdyStreamId stream_id,
- uint8 flags);
+ uint8_t flags);
// Populates this frame with a SPDY4/HTTP2 frame prefix using
// version-specific information from the |framer| and length information from
@@ -68,7 +70,7 @@
// Used only for SPDY versions >=4.
bool BeginNewFrame(const SpdyFramer& framer,
SpdyFrameType type,
- uint8 flags,
+ uint8_t flags,
SpdyStreamId stream_id);
// Takes the buffer from the SpdyFrameBuilder.
@@ -88,31 +90,29 @@
// Methods for adding to the payload. These values are appended to the end
// of the SpdyFrameBuilder payload. Note - binary integers are converted from
// host to network form.
- bool WriteUInt8(uint8 value) {
- return WriteBytes(&value, sizeof(value));
- }
- bool WriteUInt16(uint16 value) {
+ bool WriteUInt8(uint8_t value) { return WriteBytes(&value, sizeof(value)); }
+ bool WriteUInt16(uint16_t value) {
value = base::HostToNet16(value);
return WriteBytes(&value, sizeof(value));
}
- bool WriteUInt24(uint32 value) {
+ bool WriteUInt24(uint32_t value) {
value = base::HostToNet32(value);
return WriteBytes(reinterpret_cast<char*>(&value) + 1,
sizeof(value) - 1);
}
- bool WriteUInt32(uint32 value) {
+ bool WriteUInt32(uint32_t value) {
value = base::HostToNet32(value);
return WriteBytes(&value, sizeof(value));
}
- bool WriteUInt64(uint64 value) {
- uint32 upper = base::HostToNet32(static_cast<uint32>(value >> 32));
- uint32 lower = base::HostToNet32(static_cast<uint32>(value));
+ bool WriteUInt64(uint64_t value) {
+ uint32_t upper = base::HostToNet32(static_cast<uint32_t>(value >> 32));
+ uint32_t lower = base::HostToNet32(static_cast<uint32_t>(value));
return (WriteBytes(&upper, sizeof(upper)) &&
WriteBytes(&lower, sizeof(lower)));
}
bool WriteStringPiece16(const base::StringPiece& value);
bool WriteStringPiece32(const base::StringPiece& value);
- bool WriteBytes(const void* data, uint32 data_len);
+ bool WriteBytes(const void* data, uint32_t data_len);
// Update (in-place) the length field in the frame being built to reflect the
// current actual length of bytes written to said frame through this builder.
@@ -131,7 +131,7 @@
// Update (in-place) the flags field in the frame being built to reflect the
// given flags value.
// Used only for SPDY versions >=4.
- bool OverwriteFlags(const SpdyFramer& framer, uint8 flags);
+ bool OverwriteFlags(const SpdyFramer& framer, uint8_t flags);
private:
// Checks to make sure that there is an appropriate amount of space for a
diff --git a/net/spdy/spdy_frame_reader.cc b/net/spdy/spdy_frame_reader.cc
index be972ec..4727caa 100644
--- a/net/spdy/spdy_frame_reader.cc
+++ b/net/spdy/spdy_frame_reader.cc
@@ -16,15 +16,15 @@
ofs_(0) {
}
-bool SpdyFrameReader::ReadUInt8(uint8* result) {
- // Make sure that we have the whole uint8.
+bool SpdyFrameReader::ReadUInt8(uint8_t* result) {
+ // Make sure that we have the whole uint8_t.
if (!CanRead(1)) {
OnFailure();
return false;
}
// Read into result.
- *result = *reinterpret_cast<const uint8*>(data_ + ofs_);
+ *result = *reinterpret_cast<const uint8_t*>(data_ + ofs_);
// Iterate.
ofs_ += 1;
@@ -32,15 +32,16 @@
return true;
}
-bool SpdyFrameReader::ReadUInt16(uint16* result) {
- // Make sure that we have the whole uint16.
+bool SpdyFrameReader::ReadUInt16(uint16_t* result) {
+ // Make sure that we have the whole uint16_t.
if (!CanRead(2)) {
OnFailure();
return false;
}
// Read into result.
- *result = base::NetToHost16(*(reinterpret_cast<const uint16*>(data_ + ofs_)));
+ *result =
+ base::NetToHost16(*(reinterpret_cast<const uint16_t*>(data_ + ofs_)));
// Iterate.
ofs_ += 2;
@@ -48,15 +49,16 @@
return true;
}
-bool SpdyFrameReader::ReadUInt32(uint32* result) {
- // Make sure that we have the whole uint32.
+bool SpdyFrameReader::ReadUInt32(uint32_t* result) {
+ // Make sure that we have the whole uint32_t.
if (!CanRead(4)) {
OnFailure();
return false;
}
// Read into result.
- *result = base::NetToHost32(*(reinterpret_cast<const uint32*>(data_ + ofs_)));
+ *result =
+ base::NetToHost32(*(reinterpret_cast<const uint32_t*>(data_ + ofs_)));
// Iterate.
ofs_ += 4;
@@ -64,18 +66,18 @@
return true;
}
-bool SpdyFrameReader::ReadUInt64(uint64* result) {
- // Make sure that we have the whole uint64.
+bool SpdyFrameReader::ReadUInt64(uint64_t* result) {
+ // Make sure that we have the whole uint64_t.
if (!CanRead(8)) {
OnFailure();
return false;
}
// Read into result. Network byte order is big-endian.
- uint64 upper =
- base::NetToHost32(*(reinterpret_cast<const uint32*>(data_ + ofs_)));
- uint64 lower =
- base::NetToHost32(*(reinterpret_cast<const uint32*>(data_ + ofs_ + 4)));
+ uint64_t upper =
+ base::NetToHost32(*(reinterpret_cast<const uint32_t*>(data_ + ofs_)));
+ uint64_t lower =
+ base::NetToHost32(*(reinterpret_cast<const uint32_t*>(data_ + ofs_ + 4)));
*result = (upper << 32) + lower;
// Iterate.
@@ -84,7 +86,7 @@
return true;
}
-bool SpdyFrameReader::ReadUInt31(uint32* result) {
+bool SpdyFrameReader::ReadUInt31(uint32_t* result) {
bool success = ReadUInt32(result);
// Zero out highest-order bit.
@@ -95,7 +97,7 @@
return success;
}
-bool SpdyFrameReader::ReadUInt24(uint32* result) {
+bool SpdyFrameReader::ReadUInt24(uint32_t* result) {
// Make sure that we have the whole uint24.
if (!CanRead(3)) {
OnFailure();
@@ -115,7 +117,7 @@
bool SpdyFrameReader::ReadStringPiece16(base::StringPiece* result) {
// Read resultant length.
- uint16 result_len;
+ uint16_t result_len;
if (!ReadUInt16(&result_len)) {
// OnFailure() already called.
return false;
@@ -138,7 +140,7 @@
bool SpdyFrameReader::ReadStringPiece32(base::StringPiece* result) {
// Read resultant length.
- uint32 result_len;
+ uint32_t result_len;
if (!ReadUInt32(&result_len)) {
// OnFailure() already called.
return false;
diff --git a/net/spdy/spdy_frame_reader.h b/net/spdy/spdy_frame_reader.h
index d30ae93..c1752180 100644
--- a/net/spdy/spdy_frame_reader.h
+++ b/net/spdy/spdy_frame_reader.h
@@ -5,7 +5,9 @@
#ifndef NET_SPDY_SPDY_FRAME_READER_H_
#define NET_SPDY_SPDY_FRAME_READER_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+#include <stdint.h>
+
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -36,34 +38,34 @@
// Reads an 8-bit unsigned integer into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadUInt8(uint8* result);
+ bool ReadUInt8(uint8_t* result);
// Reads a 16-bit unsigned integer into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadUInt16(uint16* result);
+ bool ReadUInt16(uint16_t* result);
// Reads a 32-bit unsigned integer into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadUInt32(uint32* result);
+ bool ReadUInt32(uint32_t* result);
// Reads a 64-bit unsigned integer into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadUInt64(uint64* result);
+ bool ReadUInt64(uint64_t* result);
// Reads a 31-bit unsigned integer into the given output parameter. This is
// equivalent to ReadUInt32() above except that the highest-order bit is
// discarded.
// Forwards the internal iterator (by 4B) on success.
// Returns true on success, false otherwise.
- bool ReadUInt31(uint32* result);
+ bool ReadUInt31(uint32_t* result);
// Reads a 24-bit unsigned integer into the given output parameter.
// Forwards the internal iterator (by 3B) on success.
// Returns true on success, false otherwise.
- bool ReadUInt24(uint32* result);
+ bool ReadUInt24(uint32_t* result);
// Reads a string prefixed with 16-bit length into the given output parameter.
//
diff --git a/net/spdy/spdy_frame_reader_test.cc b/net/spdy/spdy_frame_reader_test.cc
index 867d97c17..ca178de 100644
--- a/net/spdy/spdy_frame_reader_test.cc
+++ b/net/spdy/spdy_frame_reader_test.cc
@@ -14,7 +14,7 @@
TEST(SpdyFrameReaderTest, ReadUInt16) {
// Frame data in network byte order.
- const uint16 kFrameData[] = {
+ const uint16_t kFrameData[] = {
base::HostToNet16(1), base::HostToNet16(1 << 15),
};
@@ -22,7 +22,7 @@
sizeof(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- uint16 uint16_val;
+ uint16_t uint16_val;
EXPECT_TRUE(frame_reader.ReadUInt16(&uint16_val));
EXPECT_FALSE(frame_reader.IsDoneReading());
EXPECT_EQ(1, uint16_val);
@@ -34,15 +34,15 @@
TEST(SpdyFrameReaderTest, ReadUInt32) {
// Frame data in network byte order.
- const uint32 kFrameData[] = {
+ const uint32_t kFrameData[] = {
base::HostToNet32(1), base::HostToNet32(0x80000000),
};
- SpdyFrameReader frame_reader(reinterpret_cast<const char *>(kFrameData),
- arraysize(kFrameData) * sizeof(uint32));
+ SpdyFrameReader frame_reader(reinterpret_cast<const char*>(kFrameData),
+ arraysize(kFrameData) * sizeof(uint32_t));
EXPECT_FALSE(frame_reader.IsDoneReading());
- uint32 uint32_val;
+ uint32_t uint32_val;
EXPECT_TRUE(frame_reader.ReadUInt32(&uint32_val));
EXPECT_FALSE(frame_reader.IsDoneReading());
EXPECT_EQ(1u, uint32_val);
@@ -55,13 +55,11 @@
TEST(SpdyFrameReaderTest, ReadStringPiece16) {
// Frame data in network byte order.
const char kFrameData[] = {
- 0x00, 0x02, // uint16(2)
- 0x48, 0x69, // "Hi"
- 0x00, 0x10, // uint16(16)
- 0x54, 0x65, 0x73, 0x74,
- 0x69, 0x6e, 0x67, 0x2c,
- 0x20, 0x31, 0x2c, 0x20,
- 0x32, 0x2c, 0x20, 0x33, // "Testing, 1, 2, 3"
+ 0x00, 0x02, // uint16_t(2)
+ 0x48, 0x69, // "Hi"
+ 0x00, 0x10, // uint16_t(16)
+ 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2c,
+ 0x20, 0x31, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x33, // "Testing, 1, 2, 3"
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
@@ -80,13 +78,11 @@
TEST(SpdyFrameReaderTest, ReadStringPiece32) {
// Frame data in network byte order.
const char kFrameData[] = {
- 0x00, 0x00, 0x00, 0x03, // uint32(3)
- 0x66, 0x6f, 0x6f, // "foo"
- 0x00, 0x00, 0x00, 0x10, // uint32(16)
- 0x54, 0x65, 0x73, 0x74,
- 0x69, 0x6e, 0x67, 0x2c,
- 0x20, 0x34, 0x2c, 0x20,
- 0x35, 0x2c, 0x20, 0x36, // "Testing, 4, 5, 6"
+ 0x00, 0x00, 0x00, 0x03, // uint32_t(3)
+ 0x66, 0x6f, 0x6f, // "foo"
+ 0x00, 0x00, 0x00, 0x10, // uint32_t(16)
+ 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2c,
+ 0x20, 0x34, 0x2c, 0x20, 0x35, 0x2c, 0x20, 0x36, // "Testing, 4, 5, 6"
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
@@ -105,31 +101,32 @@
TEST(SpdyFrameReaderTest, ReadUInt16WithBufferTooSmall) {
// Frame data in network byte order.
const char kFrameData[] = {
- 0x00, // part of a uint16
+ 0x00, // part of a uint16_t
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- uint16 uint16_val;
+ uint16_t uint16_val;
EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val));
}
TEST(SpdyFrameReaderTest, ReadUInt32WithBufferTooSmall) {
// Frame data in network byte order.
const char kFrameData[] = {
- 0x00, 0x00, 0x00, // part of a uint32
+ 0x00, 0x00, 0x00, // part of a uint32_t
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- uint32 uint32_val;
+ uint32_t uint32_val;
EXPECT_FALSE(frame_reader.ReadUInt32(&uint32_val));
- // Also make sure that trying to read a uint16, which technically could work,
+ // Also make sure that trying to read a uint16_t, which technically could
+ // work,
// fails immediately due to previously encountered failed read.
- uint16 uint16_val;
+ uint16_t uint16_val;
EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val));
}
@@ -137,8 +134,8 @@
TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferTooSmall) {
// Frame data in network byte order.
const char kFrameData[] = {
- 0x00, 0x03, // uint16(3)
- 0x48, 0x69, // "Hi"
+ 0x00, 0x03, // uint16_t(3)
+ 0x48, 0x69, // "Hi"
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
@@ -147,9 +144,10 @@
base::StringPiece stringpiece_val;
EXPECT_FALSE(frame_reader.ReadStringPiece16(&stringpiece_val));
- // Also make sure that trying to read a uint16, which technically could work,
+ // Also make sure that trying to read a uint16_t, which technically could
+ // work,
// fails immediately due to previously encountered failed read.
- uint16 uint16_val;
+ uint16_t uint16_val;
EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val));
}
@@ -157,7 +155,7 @@
TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferWayTooSmall) {
// Frame data in network byte order.
const char kFrameData[] = {
- 0x00, // part of a uint16
+ 0x00, // part of a uint16_t
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
@@ -166,9 +164,10 @@
base::StringPiece stringpiece_val;
EXPECT_FALSE(frame_reader.ReadStringPiece16(&stringpiece_val));
- // Also make sure that trying to read a uint16, which technically could work,
+ // Also make sure that trying to read a uint16_t, which technically could
+ // work,
// fails immediately due to previously encountered failed read.
- uint16 uint16_val;
+ uint16_t uint16_val;
EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val));
}
@@ -176,8 +175,8 @@
TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferTooSmall) {
// Frame data in network byte order.
const char kFrameData[] = {
- 0x00, 0x00, 0x00, 0x03, // uint32(3)
- 0x48, 0x69, // "Hi"
+ 0x00, 0x00, 0x00, 0x03, // uint32_t(3)
+ 0x48, 0x69, // "Hi"
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
@@ -186,9 +185,10 @@
base::StringPiece stringpiece_val;
EXPECT_FALSE(frame_reader.ReadStringPiece32(&stringpiece_val));
- // Also make sure that trying to read a uint16, which technically could work,
+ // Also make sure that trying to read a uint16_t, which technically could
+ // work,
// fails immediately due to previously encountered failed read.
- uint16 uint16_val;
+ uint16_t uint16_val;
EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val));
}
@@ -196,7 +196,7 @@
TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferWayTooSmall) {
// Frame data in network byte order.
const char kFrameData[] = {
- 0x00, 0x00, 0x00, // part of a uint32
+ 0x00, 0x00, 0x00, // part of a uint32_t
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
@@ -205,9 +205,10 @@
base::StringPiece stringpiece_val;
EXPECT_FALSE(frame_reader.ReadStringPiece32(&stringpiece_val));
- // Also make sure that trying to read a uint16, which technically could work,
+ // Also make sure that trying to read a uint16_t, which technically could
+ // work,
// fails immediately due to previously encountered failed read.
- uint16 uint16_val;
+ uint16_t uint16_val;
EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val));
}
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 9532664d..08f32dd3 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -61,18 +61,18 @@
// Pack parent stream ID and exclusive flag into the format used by HTTP/2
// headers and priority frames.
-uint32 PackStreamDependencyValues(bool exclusive,
- SpdyStreamId parent_stream_id) {
+uint32_t PackStreamDependencyValues(bool exclusive,
+ SpdyStreamId parent_stream_id) {
// Make sure the highest-order bit in the parent stream id is zeroed out.
- uint32 parent = parent_stream_id & 0x7fffffff;
+ uint32_t parent = parent_stream_id & 0x7fffffff;
// Set the one-bit exclusivity flag.
- uint32 e_bit = exclusive ? 0x80000000 : 0;
+ uint32_t e_bit = exclusive ? 0x80000000 : 0;
return parent | e_bit;
}
// Unpack parent stream ID and exclusive flag from the format used by HTTP/2
// headers and priority frames.
-void UnpackStreamDependencyValues(uint32 packed,
+void UnpackStreamDependencyValues(uint32_t packed,
bool* exclusive,
SpdyStreamId* parent_stream_id) {
*exclusive = (packed >> 31) != 0;
@@ -94,7 +94,7 @@
base::LazyInstance<DictionaryIds>::Leaky g_dictionary_ids;
// Used to indicate no flags in a SPDY flags field.
-const uint8 kNoFlags = 0;
+const uint8_t kNoFlags = 0;
// Wire sizes of priority payloads.
const size_t kPriorityDependencyPayloadSize = 4;
@@ -135,8 +135,8 @@
} while (false)
#endif
-SettingsFlagsAndId SettingsFlagsAndId::FromWireFormat(
- SpdyMajorVersion version, uint32 wire) {
+SettingsFlagsAndId SettingsFlagsAndId::FromWireFormat(SpdyMajorVersion version,
+ uint32_t wire) {
if (version < SPDY3) {
ConvertFlagsAndIdForSpdy2(&wire);
}
@@ -144,14 +144,13 @@
base::NetToHost32(wire) & 0x00ffffff);
}
-SettingsFlagsAndId::SettingsFlagsAndId(uint8 flags, uint32 id)
+SettingsFlagsAndId::SettingsFlagsAndId(uint8_t flags, uint32_t id)
: flags_(flags), id_(id & 0x00ffffff) {
LOG_IF(DFATAL, id > (1u << 24)) << "SPDY setting ID too large: " << id;
}
-uint32 SettingsFlagsAndId::GetWireFormat(SpdyMajorVersion version)
- const {
- uint32 wire =
+uint32_t SettingsFlagsAndId::GetWireFormat(SpdyMajorVersion version) const {
+ uint32_t wire =
base::HostToNet32(id_ & 0x00ffffff) | base::HostToNet32(flags_ << 24);
if (version < SPDY3) {
ConvertFlagsAndIdForSpdy2(&wire);
@@ -164,8 +163,8 @@
// little-endian and big-endian hosts.
// This method is also bidirectional (can be used to translate SPDY 2 to SPDY 3
// as well as vice versa).
-void SettingsFlagsAndId::ConvertFlagsAndIdForSpdy2(uint32* val) {
- uint8* wire_array = reinterpret_cast<uint8*>(val);
+void SettingsFlagsAndId::ConvertFlagsAndIdForSpdy2(uint32_t* val) {
+ uint8_t* wire_array = reinterpret_cast<uint8_t*>(val);
std::swap(wire_array[0], wire_array[3]);
std::swap(wire_array[1], wire_array[2]);
}
@@ -743,7 +742,7 @@
// correct value if this is a valid control frame.
current_frame_type_ = DATA;
if (protocol_version() <= SPDY3) {
- uint16 version = 0;
+ uint16_t version = 0;
bool successful_read = reader.ReadUInt16(&version);
DCHECK(successful_read);
is_control_frame = (version & kControlFlagMask) != 0;
@@ -763,7 +762,7 @@
}
// We check control_frame_type_field's validity in
// ProcessControlFrameHeader().
- uint16 control_frame_type_field_uint16;
+ uint16_t control_frame_type_field_uint16;
successful_read = reader.ReadUInt16(&control_frame_type_field_uint16);
control_frame_type_field = control_frame_type_field_uint16;
} else {
@@ -775,17 +774,17 @@
successful_read = reader.ReadUInt8(¤t_frame_flags_);
DCHECK(successful_read);
- uint32 length_field = 0;
+ uint32_t length_field = 0;
successful_read = reader.ReadUInt24(&length_field);
DCHECK(successful_read);
remaining_data_length_ = length_field;
current_frame_length_ = remaining_data_length_ + reader.GetBytesConsumed();
} else {
- uint32 length_field = 0;
+ uint32_t length_field = 0;
bool successful_read = reader.ReadUInt24(&length_field);
DCHECK(successful_read);
- uint8 control_frame_type_field_uint8;
+ uint8_t control_frame_type_field_uint8;
successful_read = reader.ReadUInt8(&control_frame_type_field_uint8);
DCHECK(successful_read);
// We check control_frame_type_field's validity in
@@ -853,7 +852,7 @@
<< "DATA frame too large for SPDY >= 4.";
}
- uint8 valid_data_flags = 0;
+ uint8_t valid_data_flags = 0;
if (protocol_version() > SPDY3) {
valid_data_flags =
DATA_FLAG_FIN | DATA_FLAG_END_SEGMENT | DATA_FLAG_PADDED;
@@ -1116,7 +1115,7 @@
return;
}
// Determine the frame size without variable-length data.
- int32 frame_size_without_variable_data;
+ int32_t frame_size_without_variable_data;
switch (current_frame_type_) {
case SYN_STREAM:
syn_frame_processed_ = true;
@@ -1174,7 +1173,7 @@
// remainder of the control frame's header before we can parse the header
// block. The start of the header block varies with the control type.
DCHECK_GE(frame_size_without_variable_data,
- static_cast<int32>(current_frame_buffer_.len()));
+ static_cast<int32_t>(current_frame_buffer_.len()));
remaining_control_header_ =
frame_size_without_variable_data - current_frame_buffer_.len();
@@ -1199,8 +1198,8 @@
size_t SpdyFramer::GetSerializedLength(
const SpdyMajorVersion spdy_version,
const SpdyHeaderBlock* headers) {
- const size_t num_name_value_pairs_size
- = (spdy_version < SPDY3) ? sizeof(uint16) : sizeof(uint32);
+ const size_t num_name_value_pairs_size =
+ (spdy_version < SPDY3) ? sizeof(uint16_t) : sizeof(uint32_t);
const size_t length_of_name_size = num_name_value_pairs_size;
const size_t length_of_value_size = num_name_value_pairs_size;
@@ -1218,7 +1217,7 @@
const SpdyMajorVersion spdy_version,
const SpdyHeaderBlock* headers) {
if (spdy_version < SPDY3) {
- frame->WriteUInt16(static_cast<uint16>(headers->size()));
+ frame->WriteUInt16(static_cast<uint16_t>(headers->size()));
} else {
frame->WriteUInt32(headers->size());
}
@@ -1508,7 +1507,7 @@
}
if (protocol_version() > SPDY3 &&
current_frame_flags_ & HEADERS_FLAG_PADDED) {
- uint8 pad_payload_len = 0;
+ uint8_t pad_payload_len = 0;
DCHECK_EQ(remaining_padding_payload_length_, 0u);
successful_read = reader.ReadUInt8(&pad_payload_len);
DCHECK(successful_read);
@@ -1517,16 +1516,16 @@
const bool has_priority =
(current_frame_flags_ & HEADERS_FLAG_PRIORITY) != 0;
SpdyPriority priority = 0;
- uint32 parent_stream_id = 0;
+ uint32_t parent_stream_id = 0;
bool exclusive = false;
if (protocol_version() > SPDY3 && has_priority) {
- uint32 stream_dependency;
+ uint32_t stream_dependency;
successful_read = reader.ReadUInt32(&stream_dependency);
DCHECK(successful_read);
UnpackStreamDependencyValues(stream_dependency, &exclusive,
&parent_stream_id);
- uint8 weight = 0;
+ uint8_t weight = 0;
successful_read = reader.ReadUInt8(&weight);
if (successful_read) {
priority = MapWeightToPriority(weight);
@@ -1565,7 +1564,7 @@
if (protocol_version() > SPDY3 &&
current_frame_flags_ & PUSH_PROMISE_FLAG_PADDED) {
DCHECK_EQ(remaining_padding_payload_length_, 0u);
- uint8 pad_payload_len = 0;
+ uint8_t pad_payload_len = 0;
successful_read = reader.ReadUInt8(&pad_payload_len);
DCHECK(successful_read);
remaining_padding_payload_length_ = pad_payload_len;
@@ -1793,21 +1792,22 @@
bool SpdyFramer::ProcessSetting(const char* data) {
int id_field;
SpdySettingsIds id;
- uint8 flags = 0;
- uint32 value;
+ uint8_t flags = 0;
+ uint32_t value;
// Extract fields.
// Maintain behavior of old SPDY 2 bug with byte ordering of flags/id.
if (protocol_version() <= SPDY3) {
- const uint32 id_and_flags_wire = *(reinterpret_cast<const uint32*>(data));
+ const uint32_t id_and_flags_wire =
+ *(reinterpret_cast<const uint32_t*>(data));
SettingsFlagsAndId id_and_flags =
SettingsFlagsAndId::FromWireFormat(protocol_version(), id_and_flags_wire);
id_field = id_and_flags.id();
flags = id_and_flags.flags();
- value = base::NetToHost32(*(reinterpret_cast<const uint32*>(data + 4)));
+ value = base::NetToHost32(*(reinterpret_cast<const uint32_t*>(data + 4)));
} else {
- id_field = base::NetToHost16(*(reinterpret_cast<const uint16*>(data)));
- value = base::NetToHost32(*(reinterpret_cast<const uint32*>(data + 2)));
+ id_field = base::NetToHost16(*(reinterpret_cast<const uint16_t*>(data)));
+ value = base::NetToHost32(*(reinterpret_cast<const uint32_t*>(data + 2)));
}
// Validate id.
@@ -1834,7 +1834,7 @@
settings_scratch_.last_setting_id = id;
// Validate flags.
- uint8 kFlagsMask = SETTINGS_FLAG_PLEASE_PERSIST | SETTINGS_FLAG_PERSISTED;
+ uint8_t kFlagsMask = SETTINGS_FLAG_PLEASE_PERSIST | SETTINGS_FLAG_PERSISTED;
if ((flags & ~(kFlagsMask)) != 0) {
DLOG(WARNING) << "Unknown SETTINGS flags provided for id " << id << ": "
<< flags;
@@ -1865,7 +1865,7 @@
(current_frame_flags_ & PING_FLAG_ACK);
bool successful_read = true;
if (protocol_version() <= SPDY3) {
- uint32 id32 = 0;
+ uint32_t id32 = 0;
successful_read = reader.ReadUInt32(&id32);
id = id32;
} else {
@@ -1877,7 +1877,7 @@
}
break;
case WINDOW_UPDATE: {
- uint32 delta_window_size = 0;
+ uint32_t delta_window_size = 0;
bool successful_read = true;
if (protocol_version() <= SPDY3) {
successful_read = reader.ReadUInt31(¤t_frame_stream_id_);
@@ -1898,10 +1898,10 @@
break;
case PRIORITY: {
DCHECK_LT(SPDY3, protocol_version());
- uint32 stream_dependency;
- uint32 parent_stream_id;
+ uint32_t stream_dependency;
+ uint32_t parent_stream_id;
bool exclusive;
- uint8 weight;
+ uint8_t weight;
bool successful_read = reader.ReadUInt32(&stream_dependency);
DCHECK(successful_read);
UnpackStreamDependencyValues(stream_dependency, &exclusive,
@@ -1954,7 +1954,7 @@
// In SPDYv3 and up, frames also specify a status code - parse it out.
SpdyGoAwayStatus status = GOAWAY_OK;
if (protocol_version() >= SPDY3) {
- uint32 status_raw = GOAWAY_OK;
+ uint32_t status_raw = GOAWAY_OK;
successful_read = reader.ReadUInt32(&status_raw);
DCHECK(successful_read);
if (SpdyConstants::IsValidGoAwayStatus(protocol_version(),
@@ -2021,7 +2021,7 @@
}
SpdyRstStreamStatus status = RST_STREAM_INVALID;
- uint32 status_raw = status;
+ uint32_t status_raw = status;
bool successful_read = reader.ReadUInt32(&status_raw);
DCHECK(successful_read);
if (SpdyConstants::IsValidRstStreamStatus(protocol_version(),
@@ -2112,7 +2112,8 @@
static_assert(kPadLengthFieldSize == 1,
"Unexpected pad length field size.");
- remaining_padding_payload_length_ = *reinterpret_cast<const uint8*>(data);
+ remaining_padding_payload_length_ =
+ *reinterpret_cast<const uint8_t*>(data);
++data;
--len;
--remaining_data_length_;
@@ -2207,9 +2208,9 @@
SpdyFrameReader reader(header_data, header_length);
// Read number of headers.
- uint32 num_headers;
+ uint32_t num_headers;
if (protocol_version() <= SPDY2) {
- uint16 temp;
+ uint16_t temp;
if (!reader.ReadUInt16(&temp)) {
DVLOG(1) << "Unable to read number of headers.";
return false;
@@ -2223,7 +2224,7 @@
}
// Read each header.
- for (uint32 index = 0; index < num_headers; ++index) {
+ for (uint32_t index = 0; index < num_headers; ++index) {
base::StringPiece temp;
// Read header name.
@@ -2266,7 +2267,7 @@
SpdySerializedFrame* SpdyFramer::SerializeData(
const SpdyDataIR& data_ir) const {
- uint8 flags = DATA_FLAG_NONE;
+ uint8_t flags = DATA_FLAG_NONE;
if (data_ir.fin()) {
flags = DATA_FLAG_FIN;
}
@@ -2305,7 +2306,7 @@
SpdySerializedFrame* SpdyFramer::SerializeDataFrameHeaderWithPaddingLengthField(
const SpdyDataIR& data_ir) const {
- uint8 flags = DATA_FLAG_NONE;
+ uint8_t flags = DATA_FLAG_NONE;
if (data_ir.fin()) {
flags = DATA_FLAG_FIN;
}
@@ -2338,7 +2339,7 @@
SpdySerializedFrame* SpdyFramer::SerializeSynStream(
const SpdySynStreamIR& syn_stream) {
DCHECK_GE(SPDY3, protocol_version());
- uint8 flags = 0;
+ uint8_t flags = 0;
if (syn_stream.fin()) {
flags |= CONTROL_FLAG_FIN;
}
@@ -2348,7 +2349,7 @@
}
// Sanitize priority.
- uint8 priority = syn_stream.priority();
+ uint8_t priority = syn_stream.priority();
if (priority > GetLowestPriority()) {
DLOG(DFATAL) << "Priority out-of-bounds.";
priority = GetLowestPriority();
@@ -2382,7 +2383,7 @@
SpdySerializedFrame* SpdyFramer::SerializeSynReply(
const SpdySynReplyIR& syn_reply) {
DCHECK_GE(SPDY3, protocol_version());
- uint8 flags = 0;
+ uint8_t flags = 0;
if (syn_reply.fin()) {
flags |= CONTROL_FLAG_FIN;
}
@@ -2446,7 +2447,7 @@
SpdySerializedFrame* SpdyFramer::SerializeSettings(
const SpdySettingsIR& settings) const {
- uint8 flags = 0;
+ uint8_t flags = 0;
if (protocol_version() <= SPDY3) {
if (settings.clear_settings()) {
@@ -2486,7 +2487,7 @@
SpdyConstants::SerializeSettingId(protocol_version(), it->first);
DCHECK_GE(setting_id, 0);
if (protocol_version() <= SPDY3) {
- uint8 setting_flags = 0;
+ uint8_t setting_flags = 0;
if (it->second.persist_value) {
setting_flags |= SETTINGS_FLAG_PLEASE_PERSIST;
}
@@ -2494,10 +2495,11 @@
setting_flags |= SETTINGS_FLAG_PERSISTED;
}
SettingsFlagsAndId flags_and_id(setting_flags, setting_id);
- uint32 id_and_flags_wire = flags_and_id.GetWireFormat(protocol_version());
+ uint32_t id_and_flags_wire =
+ flags_and_id.GetWireFormat(protocol_version());
builder.WriteBytes(&id_and_flags_wire, 4);
} else {
- builder.WriteUInt16(static_cast<uint16>(setting_id));
+ builder.WriteUInt16(static_cast<uint16_t>(setting_id));
}
builder.WriteUInt32(it->second.value);
}
@@ -2509,9 +2511,9 @@
SpdyFrameBuilder builder(GetPingSize(), protocol_version());
if (protocol_version() <= SPDY3) {
builder.WriteControlFrameHeader(*this, PING, kNoFlags);
- builder.WriteUInt32(static_cast<uint32>(ping.id()));
+ builder.WriteUInt32(static_cast<uint32_t>(ping.id()));
} else {
- uint8 flags = 0;
+ uint8_t flags = 0;
if (ping.is_ack()) {
flags |= PING_FLAG_ACK;
}
@@ -2561,7 +2563,7 @@
SpdySerializedFrame* SpdyFramer::SerializeHeaders(
const SpdyHeadersIR& headers) {
- uint8 flags = 0;
+ uint8_t flags = 0;
if (headers.fin()) {
flags |= CONTROL_FLAG_FIN;
}
@@ -2690,7 +2692,7 @@
SpdyFrame* SpdyFramer::SerializePushPromise(
const SpdyPushPromiseIR& push_promise) {
DCHECK_LT(SPDY3, protocol_version());
- uint8 flags = 0;
+ uint8_t flags = 0;
// This will get overwritten if we overflow into a CONTINUATION frame.
flags |= PUSH_PROMISE_FLAG_END_PUSH_PROMISE;
// The size of this frame, including variable-length name-value block.
@@ -2762,7 +2764,7 @@
SpdyFrame* SpdyFramer::SerializeContinuation(
const SpdyContinuationIR& continuation) {
CHECK_LT(SPDY3, protocol_version());
- uint8 flags = 0;
+ uint8_t flags = 0;
if (continuation.end_headers()) {
flags |= HEADERS_FLAG_END_HEADERS;
}
@@ -2913,8 +2915,8 @@
SpdyStreamId stream_id,
SpdyFrameType type,
int padding_payload_len) {
- uint8 end_flag = 0;
- uint8 flags = 0;
+ uint8_t end_flag = 0;
+ uint8_t flags = 0;
if (type == HEADERS) {
end_flag = HEADERS_FLAG_END_HEADERS;
} else if (type == PUSH_PROMISE) {
@@ -3037,12 +3039,12 @@
return hpack_decoder_.get();
}
-uint8 SpdyFramer::MapPriorityToWeight(SpdyPriority priority) {
+uint8_t SpdyFramer::MapPriorityToWeight(SpdyPriority priority) {
const float kSteps = 255.9f / 7.f;
- return static_cast<uint8>(kSteps * (7.f - priority));
+ return static_cast<uint8_t>(kSteps * (7.f - priority));
}
-SpdyPriority SpdyFramer::MapWeightToPriority(uint8 weight) {
+SpdyPriority SpdyFramer::MapWeightToPriority(uint8_t weight) {
const float kSteps = 255.9f / 7.f;
return static_cast<SpdyPriority>(7.f - weight / kSteps);
}
@@ -3139,7 +3141,7 @@
return read_successfully;
}
-void SpdyFramer::UpdateHeaderEncoderTableSize(uint32 value) {
+void SpdyFramer::UpdateHeaderEncoderTableSize(uint32_t value) {
GetHpackEncoder()->ApplyHeaderTableSizeSetting(value);
}
@@ -3156,7 +3158,7 @@
const SpdyHeaderBlock& header_block) const {
// Serialize number of headers.
if (protocol_version() <= SPDY2) {
- builder->WriteUInt16(static_cast<uint16>(header_block.size()));
+ builder->WriteUInt16(static_cast<uint16_t>(header_block.size()));
} else {
builder->WriteUInt32(header_block.size());
}
diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h
index 8e2ce1c..35bfafb 100644
--- a/net/spdy/spdy_framer.h
+++ b/net/spdy/spdy_framer.h
@@ -5,6 +5,9 @@
#ifndef NET_SPDY_SPDY_FRAMER_H_
#define NET_SPDY_SPDY_FRAMER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
#include <memory>
#include <string>
@@ -48,27 +51,27 @@
class NET_EXPORT_PRIVATE SettingsFlagsAndId {
public:
static SettingsFlagsAndId FromWireFormat(SpdyMajorVersion version,
- uint32 wire);
+ uint32_t wire);
SettingsFlagsAndId() : flags_(0), id_(0) {}
// TODO(hkhalil): restrict to enums instead of free-form ints.
- SettingsFlagsAndId(uint8 flags, uint32 id);
+ SettingsFlagsAndId(uint8_t flags, uint32_t id);
- uint32 GetWireFormat(SpdyMajorVersion version) const;
+ uint32_t GetWireFormat(SpdyMajorVersion version) const;
- uint32 id() const { return id_; }
- uint8 flags() const { return flags_; }
+ uint32_t id() const { return id_; }
+ uint8_t flags() const { return flags_; }
private:
- static void ConvertFlagsAndIdForSpdy2(uint32* val);
+ static void ConvertFlagsAndIdForSpdy2(uint32_t* val);
- uint8 flags_;
- uint32 id_;
+ uint8_t flags_;
+ uint32_t id_;
};
// SettingsMap has unique (flags, value) pair for given SpdySettingsIds ID.
-typedef std::pair<SpdySettingsFlags, uint32> SettingsFlagsAndValue;
+typedef std::pair<SpdySettingsFlags, uint32_t> SettingsFlagsAndValue;
typedef std::map<SpdySettingsIds, SettingsFlagsAndValue> SettingsMap;
// SpdyFramerVisitorInterface is a set of callbacks for the SpdyFramer.
@@ -174,7 +177,7 @@
// Called when a complete setting within a SETTINGS frame has been parsed and
// validated.
- virtual void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) = 0;
+ virtual void OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) = 0;
// Called when a SETTINGS frame is received with the ACK flag set.
virtual void OnSettingsAck() {}
@@ -260,7 +263,7 @@
// Called when a PRIORITY frame is received.
virtual void OnPriority(SpdyStreamId stream_id,
SpdyStreamId parent_stream_id,
- uint8 weight,
+ uint8_t weight,
bool exclusive) {}
// Called when a frame type we don't recognize is received.
@@ -553,8 +556,8 @@
// Interpolates SpdyPriority values into SPDY4/HTTP2 priority weights,
// and vice versa.
- static uint8 MapPriorityToWeight(SpdyPriority priority);
- static SpdyPriority MapWeightToPriority(uint8 weight);
+ static uint8_t MapPriorityToWeight(SpdyPriority priority);
+ static SpdyPriority MapWeightToPriority(uint8_t weight);
// Deliver the given control frame's compressed headers block to the visitor
// in decompressed form, in chunks. Returns true if the visitor has
@@ -565,7 +568,7 @@
size_t len);
// Updates the maximum size of the header encoder compression table.
- void UpdateHeaderEncoderTableSize(uint32 value);
+ void UpdateHeaderEncoderTableSize(uint32_t value);
// Returns the maximum size of the header encoder compression table.
size_t header_encoder_table_size() const;
@@ -732,7 +735,7 @@
SpdyFrameType current_frame_type_;
// The total length of the frame currently being read, including frame header.
- uint32 current_frame_length_;
+ uint32_t current_frame_length_;
// The stream ID field of the frame currently being read, if applicable.
SpdyStreamId current_frame_stream_id_;
@@ -766,7 +769,7 @@
const SpdyMajorVersion protocol_version_;
// The flags field of the frame currently being read.
- uint8 current_frame_flags_;
+ uint8_t current_frame_flags_;
// Determines whether HPACK or gzip compression is used.
bool enable_compression_;
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc
index 2758b5e..3c56be9 100644
--- a/net/spdy/spdy_framer_test.cc
+++ b/net/spdy/spdy_framer_test.cc
@@ -14,6 +14,7 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/spdy/hpack/hpack_constants.h"
#include "net/spdy/mock_spdy_framer_visitor.h"
@@ -159,7 +160,7 @@
SpdyRstStreamStatus status) override {
LOG(FATAL);
}
- void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {
+ void OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) override {
LOG(FATAL);
}
void OnPing(SpdyPingId unique_id, bool is_ack) override { LOG(FATAL); }
@@ -213,7 +214,7 @@
void OnPriority(SpdyStreamId stream_id,
SpdyStreamId parent_stream_id,
- uint8 weight,
+ uint8_t weight,
bool exclusive) override {
// Do nothing.
}
@@ -403,7 +404,7 @@
return true;
}
- void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {
+ void OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) override {
++setting_count_;
}
@@ -476,7 +477,7 @@
void OnPriority(SpdyStreamId stream_id,
SpdyStreamId parent_stream_id,
- uint8 weight,
+ uint8_t weight,
bool exclusive) override {
++priority_count_;
}
@@ -622,18 +623,18 @@
}
SpdyFrameType frame_type;
if (framer.protocol_version() > SPDY3) {
- uint8 serialized_type;
+ uint8_t serialized_type;
reader.ReadUInt8(&serialized_type);
frame_type = SpdyConstants::ParseFrameType(framer.protocol_version(),
serialized_type);
DCHECK_EQ(HEADERS, frame_type);
- uint8 flags;
+ uint8_t flags;
reader.ReadUInt8(&flags);
if (flags & HEADERS_FLAG_PRIORITY) {
frame_type = SYN_STREAM;
}
} else {
- uint16 serialized_type;
+ uint16_t serialized_type;
reader.ReadUInt16(&serialized_type);
frame_type = SpdyConstants::ParseFrameType(framer.protocol_version(),
serialized_type);
@@ -2540,7 +2541,7 @@
0x0b, 0x0c, 0x0d,
};
- uint32 kValue = 0x0a0b0c0d;
+ uint32_t kValue = 0x0a0b0c0d;
SpdySettingsIR settings_ir;
SpdySettingsFlags kFlags = static_cast<SpdySettingsFlags>(0x01);
@@ -4897,7 +4898,7 @@
return;
}
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -4938,10 +4939,10 @@
return;
}
- uint8 valid_data_flags = DATA_FLAG_FIN | DATA_FLAG_END_SEGMENT |
- DATA_FLAG_PADDED;
+ uint8_t valid_data_flags =
+ DATA_FLAG_FIN | DATA_FLAG_END_SEGMENT | DATA_FLAG_PADDED;
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -4988,7 +4989,7 @@
// SYN_STREAM not supported in SPDY>3
return;
}
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5042,7 +5043,7 @@
// SYN_REPLY not supported in SPDY>3
return;
}
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5081,7 +5082,7 @@
}
TEST_P(SpdyFramerTest, RstStreamFrameFlags) {
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5115,7 +5116,7 @@
TEST_P(SpdyFramerTest, SettingsFrameFlagsOldFormat) {
if (spdy_version_ > SPDY3) { return; }
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5157,7 +5158,7 @@
TEST_P(SpdyFramerTest, SettingsFrameFlags) {
if (spdy_version_ <= SPDY3) { return; }
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5199,7 +5200,7 @@
}
TEST_P(SpdyFramerTest, GoawayFrameFlags) {
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5232,7 +5233,7 @@
}
TEST_P(SpdyFramerTest, HeadersFrameFlags) {
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5249,7 +5250,7 @@
}
headers_ir.SetHeader("foo", "bar");
scoped_ptr<SpdyFrame> frame(framer.SerializeHeaders(headers_ir));
- uint8 set_flags = flags;
+ uint8_t set_flags = flags;
if (IsHttp2()) {
// TODO(jgraettinger): Add padding to SpdyHeadersIR,
// and implement framing.
@@ -5321,7 +5322,7 @@
}
TEST_P(SpdyFramerTest, PingFrameFlags) {
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5357,7 +5358,7 @@
}
TEST_P(SpdyFramerTest, WindowUpdateFrameFlags) {
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5394,7 +5395,7 @@
return;
}
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5443,7 +5444,7 @@
return;
}
- uint8 flags = 0;
+ uint8_t flags = 0;
do {
SCOPED_TRACE(testing::Message() << "Flags " << flags);
@@ -5532,9 +5533,9 @@
}
TEST_P(SpdyFramerTest, SettingsFlagsAndId) {
- const uint32 kId = 0x020304;
- const uint32 kFlags = 0x01;
- const uint32 kWireFormat =
+ const uint32_t kId = 0x020304;
+ const uint32_t kFlags = 0x01;
+ const uint32_t kWireFormat =
base::HostToNet32(IsSpdy2() ? 0x04030201 : 0x01020304);
SettingsFlagsAndId id_and_flags =
diff --git a/net/spdy/spdy_header_block.cc b/net/spdy/spdy_header_block.cc
index 5e607e7..4287433 100644
--- a/net/spdy/spdy_header_block.cc
+++ b/net/spdy/spdy_header_block.cc
@@ -10,6 +10,7 @@
#include <vector>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/values.h"
#include "net/http/http_log_util.h"
diff --git a/net/spdy/spdy_header_block.h b/net/spdy/spdy_header_block.h
index 8688044..2c57d413 100644
--- a/net/spdy/spdy_header_block.h
+++ b/net/spdy/spdy_header_block.h
@@ -5,6 +5,8 @@
#ifndef NET_SPDY_SPDY_HEADER_BLOCK_H_
#define NET_SPDY_SPDY_HEADER_BLOCK_H_
+#include <stddef.h>
+
#include <map>
#include <memory>
#include <string>
diff --git a/net/spdy/spdy_headers_block_parser.h b/net/spdy/spdy_headers_block_parser.h
index 66a6b81..6f1dd67 100644
--- a/net/spdy/spdy_headers_block_parser.h
+++ b/net/spdy/spdy_headers_block_parser.h
@@ -5,6 +5,9 @@
#ifndef NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_
#define NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
diff --git a/net/spdy/spdy_headers_handler_interface.h b/net/spdy/spdy_headers_handler_interface.h
index ff5648ad..5543194 100644
--- a/net/spdy/spdy_headers_handler_interface.h
+++ b/net/spdy/spdy_headers_handler_interface.h
@@ -5,6 +5,8 @@
#ifndef NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_
#define NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_
+#include <stddef.h>
+
#include "base/strings/string_piece.h"
namespace net {
diff --git a/net/spdy/spdy_http_stream.h b/net/spdy/spdy_http_stream.h
index 43f8764..a79569a 100644
--- a/net/spdy/spdy_http_stream.h
+++ b/net/spdy/spdy_http_stream.h
@@ -9,7 +9,7 @@
#include <list>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "net/base/completion_callback.h"
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index 5852ad67..de587326 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -1126,7 +1126,7 @@
scoped_ptr<SpdyFrame> fbody3(spdy_util_.ConstructSpdyBodyFrame(5, true));
SettingsMap settings;
- const uint32 max_concurrent_streams = 1;
+ const uint32_t max_concurrent_streams = 1;
settings[SETTINGS_MAX_CONCURRENT_STREAMS] =
SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams);
scoped_ptr<SpdyFrame> settings_frame(
@@ -1262,7 +1262,7 @@
scoped_ptr<SpdyFrame> fbody3(spdy_util_.ConstructSpdyBodyFrame(7, true));
SettingsMap settings;
- const uint32 max_concurrent_streams = 1;
+ const uint32_t max_concurrent_streams = 1;
settings[SETTINGS_MAX_CONCURRENT_STREAMS] =
SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams);
scoped_ptr<SpdyFrame> settings_frame(
@@ -1401,7 +1401,7 @@
scoped_ptr<SpdyFrame> fbody2(spdy_util_.ConstructSpdyBodyFrame(3, true));
SettingsMap settings;
- const uint32 max_concurrent_streams = 1;
+ const uint32_t max_concurrent_streams = 1;
settings[SETTINGS_MAX_CONCURRENT_STREAMS] =
SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams);
scoped_ptr<SpdyFrame> settings_frame(
@@ -1531,7 +1531,7 @@
scoped_ptr<SpdyFrame> resp2(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
SettingsMap settings;
- const uint32 max_concurrent_streams = 1;
+ const uint32_t max_concurrent_streams = 1;
settings[SETTINGS_MAX_CONCURRENT_STREAMS] =
SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams);
scoped_ptr<SpdyFrame> settings_frame(
@@ -1915,7 +1915,7 @@
request.url = GURL(GetDefaultUrl());
request.upload_data_stream = &stream;
- const uint64 kContentLength = 0;
+ const uint64_t kContentLength = 0;
scoped_ptr<SpdyHeaderBlock> req_block(
spdy_util_.ConstructPostHeaderBlock(GetDefaultUrl(), kContentLength));
@@ -2255,10 +2255,9 @@
// The indicated length of this frame is longer than its actual length. When
// the session receives an empty frame after this one, it shuts down the
// session, and calls the read callback with the incomplete data.
- const uint8 kGetBodyFrame2[] = {
- 0x00, 0x00, 0x00, 0x01,
- 0x01, 0x00, 0x00, 0x07,
- 'h', 'e', 'l', 'l', 'o', '!',
+ const uint8_t kGetBodyFrame2[] = {
+ 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+ 0x07, 'h', 'e', 'l', 'l', 'o', '!',
};
scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
@@ -5752,7 +5751,7 @@
CreateMockWrite(*body_end, 2),
};
- static const int32 kDeltaWindowSize = 0xff;
+ static const int32_t kDeltaWindowSize = 0xff;
static const int kDeltaCount = 4;
scoped_ptr<SpdyFrame> window_update(
spdy_util_.ConstructSpdyWindowUpdate(1, kDeltaWindowSize));
@@ -5822,33 +5821,33 @@
// Test that received data frames and sent WINDOW_UPDATE frames change
// the recv_window_size_ correctly.
TEST_P(SpdyNetworkTransactionTest, WindowUpdateSent) {
- const int32 default_initial_window_size =
+ const int32_t default_initial_window_size =
SpdySession::GetDefaultInitialWindowSize(GetParam().protocol);
// Session level maximum window size that is more than twice the default
// initial window size so that an initial window update is sent.
- const int32 session_max_recv_window_size = 5 * 64 * 1024;
+ const int32_t session_max_recv_window_size = 5 * 64 * 1024;
ASSERT_LT(2 * default_initial_window_size, session_max_recv_window_size);
// Stream level maximum window size that is less than the session level
// maximum window size so that we test for confusion between the two.
- const int32 stream_max_recv_window_size = 4 * 64 * 1024;
+ const int32_t stream_max_recv_window_size = 4 * 64 * 1024;
ASSERT_GT(session_max_recv_window_size, stream_max_recv_window_size);
// Size of body to be sent. Has to be less than or equal to both window sizes
// so that we do not run out of receiving window. Also has to be greater than
// half of them so that it triggers both a session level and a stream level
// window update frame.
- const int32 kTargetSize = 3 * 64 * 1024;
+ const int32_t kTargetSize = 3 * 64 * 1024;
ASSERT_GE(session_max_recv_window_size, kTargetSize);
ASSERT_GE(stream_max_recv_window_size, kTargetSize);
ASSERT_LT(session_max_recv_window_size / 2, kTargetSize);
ASSERT_LT(stream_max_recv_window_size / 2, kTargetSize);
// Size of each DATA frame.
- const int32 kChunkSize = 4096;
+ const int32_t kChunkSize = 4096;
// Size of window updates.
ASSERT_EQ(0, session_max_recv_window_size / 2 % kChunkSize);
- const int32 session_window_update_delta =
+ const int32_t session_window_update_delta =
session_max_recv_window_size / 2 + kChunkSize;
ASSERT_EQ(0, stream_max_recv_window_size / 2 % kChunkSize);
- const int32 stream_window_update_delta =
+ const int32_t stream_window_update_delta =
stream_max_recv_window_size / 2 + kChunkSize;
SettingsMap initial_settings;
@@ -5978,7 +5977,7 @@
CreateMockWrite(*rst, 3),
};
- static const int32 kDeltaWindowSize = 0x7fffffff; // cause an overflow
+ static const int32_t kDeltaWindowSize = 0x7fffffff; // cause an overflow
scoped_ptr<SpdyFrame> window_update(
spdy_util_.ConstructSpdyWindowUpdate(1, kDeltaWindowSize));
MockRead reads[] = {
@@ -6033,7 +6032,7 @@
// After that, next read is artifically enforced, which causes a
// WINDOW_UPDATE to be read and I/O process resumes.
TEST_P(SpdyNetworkTransactionTest, FlowControlStallResume) {
- const int32 initial_window_size =
+ const int32_t initial_window_size =
SpdySession::GetDefaultInitialWindowSize(GetParam().protocol);
// Number of frames we need to send to zero out the window size: data
// frames plus SYN_STREAM plus the last data frame; also we need another
@@ -6139,7 +6138,7 @@
// Test we correctly handle the case where the SETTINGS frame results in
// unstalling the send window.
TEST_P(SpdyNetworkTransactionTest, FlowControlStallResumeAfterSettings) {
- const int32 initial_window_size =
+ const int32_t initial_window_size =
SpdySession::GetDefaultInitialWindowSize(GetParam().protocol);
// Number of frames we need to send to zero out the window size: data
@@ -6263,7 +6262,7 @@
// Test we correctly handle the case where the SETTINGS frame results in a
// negative send window size.
TEST_P(SpdyNetworkTransactionTest, FlowControlNegativeSendWindowSize) {
- const int32 initial_window_size =
+ const int32_t initial_window_size =
SpdySession::GetDefaultInitialWindowSize(GetParam().protocol);
// Number of frames we need to send to zero out the window size: data
// frames plus SYN_STREAM plus the last data frame; also we need another
diff --git a/net/spdy/spdy_pinnable_buffer_piece.h b/net/spdy/spdy_pinnable_buffer_piece.h
index 42bae12..d0fe866c 100644
--- a/net/spdy/spdy_pinnable_buffer_piece.h
+++ b/net/spdy/spdy_pinnable_buffer_piece.h
@@ -5,6 +5,8 @@
#ifndef NET_SPDY_SPDY_PINNABLE_BUFFER_PIECE_H_
#define NET_SPDY_SPDY_PINNABLE_BUFFER_PIECE_H_
+#include <stddef.h>
+
#include <memory>
#include "base/memory/scoped_ptr.h"
diff --git a/net/spdy/spdy_prefixed_buffer_reader.h b/net/spdy/spdy_prefixed_buffer_reader.h
index 6d27717..9e5fc91 100644
--- a/net/spdy/spdy_prefixed_buffer_reader.h
+++ b/net/spdy/spdy_prefixed_buffer_reader.h
@@ -5,6 +5,8 @@
#ifndef NET_SPDY_SPDY_PREFIXED_BUFFER_READER_H_
#define NET_SPDY_SPDY_PREFIXED_BUFFER_READER_H_
+#include <stddef.h>
+
#include "net/base/net_export.h"
#include "net/spdy/spdy_pinnable_buffer_piece.h"
diff --git a/net/spdy/spdy_priority_tree.h b/net/spdy/spdy_priority_tree.h
index 1652f77..ea09c2a 100644
--- a/net/spdy/spdy_priority_tree.h
+++ b/net/spdy/spdy_priority_tree.h
@@ -13,9 +13,9 @@
#include <utility>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
diff --git a/net/spdy/spdy_priority_tree_test.cc b/net/spdy/spdy_priority_tree_test.cc
index f9991b8..b953c01c 100644
--- a/net/spdy/spdy_priority_tree_test.cc
+++ b/net/spdy/spdy_priority_tree_test.cc
@@ -4,7 +4,6 @@
#include "net/spdy/spdy_priority_tree.h"
-#include "base/basictypes.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -44,7 +43,7 @@
class SpdyPriorityTreeTest : public ::testing::Test {
protected:
- typedef uint32 SpdyStreamId;
+ typedef uint32_t SpdyStreamId;
typedef std::pair<SpdyStreamId, float> PriorityNode;
typedef std::vector<PriorityNode> PriorityList;
diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc
index 1274f3a7..1ef08b2 100644
--- a/net/spdy/spdy_protocol.cc
+++ b/net/spdy/spdy_protocol.cc
@@ -685,18 +685,18 @@
}
size_t SpdyConstants::GetSizeOfSizeField(SpdyMajorVersion version) {
- return (version < SPDY3) ? sizeof(uint16) : sizeof(uint32);
+ return (version < SPDY3) ? sizeof(uint16_t) : sizeof(uint32_t);
}
size_t SpdyConstants::GetSettingSize(SpdyMajorVersion version) {
return version <= SPDY3 ? 8 : 6;
}
-int32 SpdyConstants::GetInitialStreamWindowSize(SpdyMajorVersion version) {
+int32_t SpdyConstants::GetInitialStreamWindowSize(SpdyMajorVersion version) {
return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1);
}
-int32 SpdyConstants::GetInitialSessionWindowSize(SpdyMajorVersion version) {
+int32_t SpdyConstants::GetInitialSessionWindowSize(SpdyMajorVersion version) {
return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1);
}
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h
index 2992711f..1a39fee 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -11,13 +11,16 @@
#ifndef NET_SPDY_SPDY_PROTOCOL_H_
#define NET_SPDY_SPDY_PROTOCOL_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <limits>
#include <map>
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "base/sys_byteorder.h"
@@ -41,23 +44,23 @@
};
// A SPDY stream id is a 31 bit entity.
-typedef uint32 SpdyStreamId;
+typedef uint32_t SpdyStreamId;
// Specifies the stream ID used to denote the current session (for
// flow control).
const SpdyStreamId kSessionFlowControlStreamId = 0;
// The maxmium possible control frame size allowed by the spec.
-const int32 kSpdyMaxControlFrameSize = (1 << 24) - 1;
+const int32_t kSpdyMaxControlFrameSize = (1 << 24) - 1;
// The maximum control frame size we accept.
-const int32 kControlFrameSizeLimit = 1 << 14;
+const int32_t kControlFrameSizeLimit = 1 << 14;
// Maximum window size for a Spdy stream or session.
-const int32 kSpdyMaximumWindowSize = 0x7FFFFFFF; // Max signed 32bit int
+const int32_t kSpdyMaximumWindowSize = 0x7FFFFFFF; // Max signed 32bit int
// Maximum padding size in octets for one DATA or HEADERS or PUSH_PROMISE frame.
-const int32 kPaddingSizePerFrame = 256;
+const int32_t kPaddingSizePerFrame = 256;
// SPDY 2 dictionary.
// This is just a hacked dictionary to use for shrinking HTTP-like headers.
@@ -417,7 +420,7 @@
// A SPDY priority is a number between 0 and 7 (inclusive).
// SPDY priority range is version-dependent. For SPDY 2 and below, priority is a
// number between 0 and 3.
-typedef uint8 SpdyPriority;
+typedef uint8_t SpdyPriority;
// Lowest and Highest here refer to SPDY priorities as described in
@@ -425,7 +428,7 @@
const SpdyPriority kV3HighestPriority = 0;
const SpdyPriority kV3LowestPriority = 7;
-typedef uint64 SpdyPingId;
+typedef uint64_t SpdyPingId;
typedef std::string SpdyProtocolId;
@@ -534,10 +537,10 @@
static size_t GetSettingSize(SpdyMajorVersion version);
// Initial window size for a stream in bytes.
- static int32 GetInitialStreamWindowSize(SpdyMajorVersion version);
+ static int32_t GetInitialStreamWindowSize(SpdyMajorVersion version);
// Initial window size for a session in bytes.
- static int32 GetInitialSessionWindowSize(SpdyMajorVersion version);
+ static int32_t GetInitialSessionWindowSize(SpdyMajorVersion version);
static SpdyMajorVersion ParseMajorVersion(int version_number);
@@ -756,7 +759,7 @@
value(0) {}
bool persist_value;
bool persisted;
- int32 value;
+ int32_t value;
};
typedef std::map<SpdySettingsIds, Value> ValueMap;
@@ -769,7 +772,7 @@
void AddSetting(SpdySettingsIds id,
bool persist_value,
bool persisted,
- int32 value) {
+ int32_t value) {
values_[id].persist_value = persist_value;
values_[id].persisted = persisted;
values_[id].value = value;
@@ -848,7 +851,7 @@
bool has_priority() const { return has_priority_; }
void set_has_priority(bool has_priority) { has_priority_ = has_priority; }
- uint32 priority() const { return priority_; }
+ uint32_t priority() const { return priority_; }
void set_priority(SpdyPriority priority) { priority_ = priority; }
SpdyStreamId parent_stream_id() const { return parent_stream_id_; }
void set_parent_stream_id(SpdyStreamId id) { parent_stream_id_ = id; }
@@ -867,7 +870,7 @@
private:
bool has_priority_ = false;
// 31-bit priority.
- uint32 priority_ = 0;
+ uint32_t priority_ = 0;
SpdyStreamId parent_stream_id_ = 0;
bool exclusive_ = false;
bool padded_ = false;
@@ -878,12 +881,12 @@
class NET_EXPORT_PRIVATE SpdyWindowUpdateIR : public SpdyFrameWithStreamIdIR {
public:
- SpdyWindowUpdateIR(SpdyStreamId stream_id, int32 delta)
+ SpdyWindowUpdateIR(SpdyStreamId stream_id, int32_t delta)
: SpdyFrameWithStreamIdIR(stream_id) {
set_delta(delta);
}
- int32 delta() const { return delta_; }
- void set_delta(int32 delta) {
+ int32_t delta() const { return delta_; }
+ void set_delta(int32_t delta) {
DCHECK_LT(0, delta);
DCHECK_LE(delta, kSpdyMaximumWindowSize);
delta_ = delta;
@@ -892,7 +895,7 @@
void Visit(SpdyFrameVisitor* visitor) const override;
private:
- int32 delta_;
+ int32_t delta_;
DISALLOW_COPY_AND_ASSIGN(SpdyWindowUpdateIR);
};
@@ -989,7 +992,7 @@
exclusive_(false) {}
SpdyPriorityIR(SpdyStreamId stream_id,
SpdyStreamId parent_stream_id,
- uint8 weight,
+ uint8_t weight,
bool exclusive)
: SpdyFrameWithStreamIdIR(stream_id),
parent_stream_id_(parent_stream_id),
@@ -997,8 +1000,8 @@
exclusive_(exclusive) {}
SpdyStreamId parent_stream_id() const { return parent_stream_id_; }
void set_parent_stream_id(SpdyStreamId id) { parent_stream_id_ = id; }
- uint8 weight() const { return weight_; }
- void set_weight(uint8 weight) { weight_ = weight; }
+ uint8_t weight() const { return weight_; }
+ void set_weight(uint8_t weight) { weight_ = weight; }
bool exclusive() const { return exclusive_; }
void set_exclusive(bool exclusive) { exclusive_ = exclusive; }
@@ -1006,7 +1009,7 @@
private:
SpdyStreamId parent_stream_id_;
- uint8 weight_;
+ uint8_t weight_;
bool exclusive_;
DISALLOW_COPY_AND_ASSIGN(SpdyPriorityIR);
};
diff --git a/net/spdy/spdy_protocol_test.cc b/net/spdy/spdy_protocol_test.cc
index 486a772..6117994a 100644
--- a/net/spdy/spdy_protocol_test.cc
+++ b/net/spdy/spdy_protocol_test.cc
@@ -6,7 +6,6 @@
#include <limits>
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/spdy/spdy_bitmasks.h"
#include "net/spdy/spdy_framer.h"
diff --git a/net/spdy/spdy_proxy_client_socket.cc b/net/spdy/spdy_proxy_client_socket.cc
index 3f611d83..5f0b1627 100644
--- a/net/spdy/spdy_proxy_client_socket.cc
+++ b/net/spdy/spdy_proxy_client_socket.cc
@@ -244,13 +244,13 @@
return ERR_IO_PENDING;
}
-int SpdyProxyClientSocket::SetReceiveBufferSize(int32 size) {
+int SpdyProxyClientSocket::SetReceiveBufferSize(int32_t size) {
// Since this StreamSocket sits on top of a shared SpdySession, it
// is not safe for callers to change this underlying socket.
return ERR_NOT_IMPLEMENTED;
}
-int SpdyProxyClientSocket::SetSendBufferSize(int32 size) {
+int SpdyProxyClientSocket::SetSendBufferSize(int32_t size) {
// Since this StreamSocket sits on top of a shared SpdySession, it
// is not safe for callers to change this underlying socket.
return ERR_NOT_IMPLEMENTED;
diff --git a/net/spdy/spdy_proxy_client_socket.h b/net/spdy/spdy_proxy_client_socket.h
index df9c21c..9dc9cff 100644
--- a/net/spdy/spdy_proxy_client_socket.h
+++ b/net/spdy/spdy_proxy_client_socket.h
@@ -5,12 +5,13 @@
#ifndef NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_
#define NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_
+#include <stddef.h>
#include <stdint.h>
#include <list>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "net/base/completion_callback.h"
@@ -85,8 +86,8 @@
int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32_t size) override;
+ int SetSendBufferSize(int32_t size) override;
int GetPeerAddress(IPEndPoint* address) const override;
int GetLocalAddress(IPEndPoint* address) const override;
diff --git a/net/spdy/spdy_proxy_client_socket_unittest.cc b/net/spdy/spdy_proxy_client_socket_unittest.cc
index 3eb6b09..2fcf3f4 100644
--- a/net/spdy/spdy_proxy_client_socket_unittest.cc
+++ b/net/spdy/spdy_proxy_client_socket_unittest.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/macros.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/address_list.h"
diff --git a/net/spdy/spdy_read_queue.h b/net/spdy/spdy_read_queue.h
index 65f3dafc..7c4172c 100644
--- a/net/spdy/spdy_read_queue.h
+++ b/net/spdy/spdy_read_queue.h
@@ -8,7 +8,7 @@
#include <cstddef>
#include <deque>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 50428ff3..4a13b641 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -8,7 +8,6 @@
#include <limits>
#include <map>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/location.h"
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 4fb7f98..b162875 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -5,6 +5,7 @@
#ifndef NET_SPDY_SPDY_SESSION_H_
#define NET_SPDY_SPDY_SESSION_H_
+#include <stddef.h>
#include <stdint.h>
#include <deque>
diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc
index eef0f9b..e8fe3fa 100644
--- a/net/spdy/spdy_session_pool.cc
+++ b/net/spdy/spdy_session_pool.cc
@@ -13,7 +13,6 @@
#include "net/http/http_server_properties.h"
#include "net/spdy/spdy_session.h"
-
namespace net {
namespace {
diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h
index 740bd5a..0b0f97ed 100644
--- a/net/spdy/spdy_session_pool.h
+++ b/net/spdy/spdy_session_pool.h
@@ -5,12 +5,14 @@
#ifndef NET_SPDY_SPDY_SESSION_POOL_H_
#define NET_SPDY_SPDY_SESSION_POOL_H_
+#include <stddef.h>
+
#include <map>
#include <set>
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "net/base/host_port_pair.h"
diff --git a/net/spdy/spdy_session_test_util.h b/net/spdy/spdy_session_test_util.h
index dcb17339..819b15c8 100644
--- a/net/spdy/spdy_session_test_util.h
+++ b/net/spdy/spdy_session_test_util.h
@@ -5,9 +5,10 @@
#ifndef NET_SPDY_SPDY_SESSION_TEST_UTIL_H_
#define NET_SPDY_SPDY_SESSION_TEST_UTIL_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/message_loop/message_loop.h"
#include "base/pending_task.h"
@@ -33,10 +34,10 @@
void DidProcessTask(const base::PendingTask& pending_task) override;
// Returns the number of tasks posted by the given function and file.
- uint16 executed_count() const { return executed_count_; }
+ uint16_t executed_count() const { return executed_count_; }
private:
- uint16 executed_count_;
+ uint16_t executed_count_;
std::string file_name_;
std::string function_name_;
};
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index f6021c6f..e2367ab 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -90,20 +90,20 @@
StallSessionSend();
}
- void UnstallSessionOnly(SpdyStream* stream, int32 delta_window_size) {
+ void UnstallSessionOnly(SpdyStream* stream, int32_t delta_window_size) {
UnstallSessionSend(delta_window_size);
}
- void UnstallStreamOnly(SpdyStream* stream, int32 delta_window_size) {
+ void UnstallStreamOnly(SpdyStream* stream, int32_t delta_window_size) {
UnstallStreamSend(stream, delta_window_size);
}
- void UnstallSessionStream(SpdyStream* stream, int32 delta_window_size) {
+ void UnstallSessionStream(SpdyStream* stream, int32_t delta_window_size) {
UnstallSessionSend(delta_window_size);
UnstallStreamSend(stream, delta_window_size);
}
- void UnstallStreamSession(SpdyStream* stream, int32 delta_window_size) {
+ void UnstallStreamSession(SpdyStream* stream, int32_t delta_window_size) {
UnstallStreamSend(stream, delta_window_size);
UnstallSessionSend(delta_window_size);
}
@@ -172,7 +172,7 @@
}
}
- void UnstallSessionSend(int32 delta_window_size) {
+ void UnstallSessionSend(int32_t delta_window_size) {
session_->IncreaseSendWindowSize(delta_window_size);
}
@@ -184,13 +184,13 @@
}
}
- void UnstallStreamSend(SpdyStream* stream, int32 delta_window_size) {
+ void UnstallStreamSend(SpdyStream* stream, int32_t delta_window_size) {
stream->IncreaseSendWindowSize(delta_window_size);
}
void RunResumeAfterUnstallTest(
const base::Callback<void(SpdyStream*)>& stall_function,
- const base::Callback<void(SpdyStream*, int32)>& unstall_function);
+ const base::Callback<void(SpdyStream*, int32_t)>& unstall_function);
// Original socket limits. Some tests set these. Safest to always restore
// them once each test has been run.
@@ -1346,7 +1346,7 @@
}
SettingsMap new_settings;
- const uint32 max_concurrent_streams = kInitialMaxConcurrentStreams + 1;
+ const uint32_t max_concurrent_streams = kInitialMaxConcurrentStreams + 1;
new_settings[kSpdySettingsIds] =
SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams);
scoped_ptr<SpdyFrame> settings_frame(
@@ -1403,12 +1403,12 @@
session_deps_.host_resolver->set_synchronous_mode(true);
SettingsMap new_settings;
- const uint32 max_concurrent_streams = kInitialMaxConcurrentStreams + 1;
+ const uint32_t max_concurrent_streams = kInitialMaxConcurrentStreams + 1;
new_settings[SETTINGS_MAX_CONCURRENT_STREAMS] =
SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams);
scoped_ptr<SpdyFrame> settings_frame(
spdy_util_.ConstructSpdySettings(new_settings));
- uint8 flags = SETTINGS_FLAG_CLEAR_PREVIOUSLY_PERSISTED_SETTINGS;
+ uint8_t flags = SETTINGS_FLAG_CLEAR_PREVIOUSLY_PERSISTED_SETTINGS;
test::SetFrameFlags(settings_frame.get(), flags, spdy_util_.spdy_version());
MockRead reads[] = {
CreateMockRead(*settings_frame, 0),
@@ -1547,7 +1547,7 @@
writes.push_back(CreateMockWrite(*settings_frame));
SettingsMap server_settings;
- const uint32 initial_max_concurrent_streams = 1;
+ const uint32_t initial_max_concurrent_streams = 1;
server_settings[SETTINGS_MAX_CONCURRENT_STREAMS] =
SettingsFlagsAndValue(SETTINGS_FLAG_PERSISTED,
initial_max_concurrent_streams);
@@ -2335,7 +2335,7 @@
// this file.
SettingsMap new_settings;
const SpdySettingsIds kSpdySettingsIds1 = SETTINGS_MAX_CONCURRENT_STREAMS;
- const uint32 max_concurrent_streams = 1;
+ const uint32_t max_concurrent_streams = 1;
new_settings[kSpdySettingsIds1] =
SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams);
@@ -3388,7 +3388,7 @@
// Set SETTINGS_INITIAL_WINDOW_SIZE to a small number so that WINDOW_UPDATE
// gets sent.
SettingsMap new_settings;
- int32 window_size = 1;
+ int32_t window_size = 1;
new_settings[SETTINGS_INITIAL_WINDOW_SIZE] =
SettingsFlagsAndValue(SETTINGS_FLAG_NONE, window_size);
@@ -3449,9 +3449,9 @@
TEST_P(SpdySessionTest, AdjustRecvWindowSize) {
session_deps_.host_resolver->set_synchronous_mode(true);
- const int32 initial_window_size =
+ const int32_t initial_window_size =
SpdySession::GetDefaultInitialWindowSize(GetProtocol());
- const int32 delta_window_size = 100;
+ const int32_t delta_window_size = 100;
MockRead reads[] = {
MockRead(ASYNC, ERR_IO_PENDING, 1), MockRead(ASYNC, 0, 2) // EOF
@@ -3516,9 +3516,9 @@
EXPECT_EQ(SpdySession::FLOW_CONTROL_STREAM_AND_SESSION,
session_->flow_control_state());
- const int32 initial_window_size =
+ const int32_t initial_window_size =
SpdySession::GetDefaultInitialWindowSize(GetProtocol());
- const int32 delta_window_size = 100;
+ const int32_t delta_window_size = 100;
EXPECT_EQ(initial_window_size, session_->session_send_window_size_);
@@ -3609,8 +3609,8 @@
// Peer sends more data than stream level receiving flow control window.
TEST_P(SpdySessionTest, StreamFlowControlTooMuchData) {
- const int32 stream_max_recv_window_size = 1024;
- const int32 data_frame_size = 2 * stream_max_recv_window_size;
+ const int32_t stream_max_recv_window_size = 1024;
+ const int32_t data_frame_size = 2 * stream_max_recv_window_size;
scoped_ptr<SpdyFrame> req(
spdy_util_.ConstructSpdyGet(nullptr, 0, false, 1, LOWEST, true));
@@ -3673,9 +3673,9 @@
// deltas in the receiving window size when checking incoming frames for flow
// control errors at session level.
TEST_P(SpdySessionTest, SessionFlowControlTooMuchDataTwoDataFrames) {
- const int32 session_max_recv_window_size = 500;
- const int32 first_data_frame_size = 200;
- const int32 second_data_frame_size = 400;
+ const int32_t session_max_recv_window_size = 500;
+ const int32_t first_data_frame_size = 200;
+ const int32_t second_data_frame_size = 400;
// First data frame should not trigger a WINDOW_UPDATE.
ASSERT_GT(session_max_recv_window_size / 2, first_data_frame_size);
@@ -3737,9 +3737,9 @@
// deltas in the receiving window size when checking incoming data frames for
// flow control errors at stream level.
TEST_P(SpdySessionTest, StreamFlowControlTooMuchDataTwoDataFrames) {
- const int32 stream_max_recv_window_size = 500;
- const int32 first_data_frame_size = 200;
- const int32 second_data_frame_size = 400;
+ const int32_t stream_max_recv_window_size = 500;
+ const int32_t first_data_frame_size = 200;
+ const int32_t second_data_frame_size = 400;
// First data frame should not trigger a WINDOW_UPDATE.
ASSERT_GT(stream_max_recv_window_size / 2, first_data_frame_size);
@@ -3841,7 +3841,7 @@
// data. The receive window should still increase to its original
// value, i.e. we shouldn't "leak" receive window bytes.
TEST_P(SpdySessionTest, SessionFlowControlNoReceiveLeaks) {
- const int32 kMsgDataSize = 100;
+ const int32_t kMsgDataSize = 100;
const std::string msg_data(kMsgDataSize, 'a');
scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost(
@@ -3888,7 +3888,7 @@
stream->SendRequestHeaders(headers.Pass(), MORE_DATA_TO_SEND));
EXPECT_TRUE(stream->HasUrlFromHeaders());
- const int32 initial_window_size =
+ const int32_t initial_window_size =
SpdySession::GetDefaultInitialWindowSize(GetProtocol());
EXPECT_EQ(initial_window_size, session_->session_recv_window_size_);
EXPECT_EQ(0, session_->session_unacked_recv_window_bytes_);
@@ -3915,7 +3915,7 @@
// can be written to the socket. The send window should then increase
// to its original value, i.e. we shouldn't "leak" send window bytes.
TEST_P(SpdySessionTest, SessionFlowControlNoSendLeaks) {
- const int32 kMsgDataSize = 100;
+ const int32_t kMsgDataSize = 100;
const std::string msg_data(kMsgDataSize, 'a');
scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost(
@@ -3954,7 +3954,7 @@
stream->SendRequestHeaders(headers.Pass(), MORE_DATA_TO_SEND));
EXPECT_TRUE(stream->HasUrlFromHeaders());
- const int32 initial_window_size =
+ const int32_t initial_window_size =
SpdySession::GetDefaultInitialWindowSize(GetProtocol());
EXPECT_EQ(initial_window_size, session_->session_send_window_size_);
@@ -3988,7 +3988,7 @@
// Send data back and forth; the send and receive windows should
// change appropriately.
TEST_P(SpdySessionTest, SessionFlowControlEndToEnd) {
- const int32 kMsgDataSize = 100;
+ const int32_t kMsgDataSize = 100;
const std::string msg_data(kMsgDataSize, 'a');
scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost(
@@ -4038,7 +4038,7 @@
stream->SendRequestHeaders(headers.Pass(), MORE_DATA_TO_SEND));
EXPECT_TRUE(stream->HasUrlFromHeaders());
- const int32 initial_window_size =
+ const int32_t initial_window_size =
SpdySession::GetDefaultInitialWindowSize(GetProtocol());
EXPECT_EQ(initial_window_size, session_->session_send_window_size_);
EXPECT_EQ(initial_window_size, session_->session_recv_window_size_);
@@ -4097,8 +4097,7 @@
// sure that a stream resumes after unstall.
void SpdySessionTest::RunResumeAfterUnstallTest(
const base::Callback<void(SpdyStream*)>& stall_function,
- const base::Callback<void(SpdyStream*, int32)>& unstall_function) {
-
+ const base::Callback<void(SpdyStream*, int32_t)>& unstall_function) {
session_deps_.host_resolver->set_synchronous_mode(true);
scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost(
@@ -5183,9 +5182,9 @@
}
TEST(CanPoolTest, CanNotPoolWithBadPins) {
- uint8 primary_pin = 1;
- uint8 backup_pin = 2;
- uint8 bad_pin = 3;
+ uint8_t primary_pin = 1;
+ uint8_t backup_pin = 2;
+ uint8_t bad_pin = 3;
TransportSecurityState tss;
test::AddPin(&tss, "mail.example.org", primary_pin, backup_pin);
@@ -5200,8 +5199,8 @@
}
TEST(CanPoolTest, CanPoolWithAcceptablePins) {
- uint8 primary_pin = 1;
- uint8 backup_pin = 2;
+ uint8_t primary_pin = 1;
+ uint8_t backup_pin = 2;
TransportSecurityState tss;
test::AddPin(&tss, "mail.example.org", primary_pin, backup_pin);
diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h
index b356aa1..4362995 100644
--- a/net/spdy/spdy_stream.h
+++ b/net/spdy/spdy_stream.h
@@ -5,12 +5,14 @@
#ifndef NET_SPDY_SPDY_STREAM_H_
#define NET_SPDY_SPDY_STREAM_H_
+#include <stddef.h>
#include <stdint.h>
#include <deque>
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index 71481b9e..8ebfddd 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -226,7 +226,7 @@
}
void OnHeaderFrameEnd(SpdyStreamId stream_id, bool end_headers) override {}
void OnSettings(bool clear_persisted) override {}
- void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {}
+ void OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) override {}
void OnPing(SpdyPingId unique_id, bool is_ack) override {}
void OnRstStream(SpdyStreamId stream_id,
SpdyRstStreamStatus status) override {}
@@ -296,10 +296,10 @@
: key_(key) {
}
-bool MockECSignatureCreator::Sign(const uint8* data,
+bool MockECSignatureCreator::Sign(const uint8_t* data,
int data_len,
- std::vector<uint8>* signature) {
- std::vector<uint8> private_key_value;
+ std::vector<uint8_t>* signature) {
+ std::vector<uint8_t> private_key_value;
key_->ExportValue(&private_key_value);
std::string head = "fakesignature";
std::string tail = "/fakesignature";
@@ -315,8 +315,8 @@
}
bool MockECSignatureCreator::DecodeSignature(
- const std::vector<uint8>& signature,
- std::vector<uint8>* out_raw_sig) {
+ const std::vector<uint8_t>& signature,
+ std::vector<uint8_t>* out_raw_sig) {
*out_raw_sig = signature;
return true;
}
@@ -726,19 +726,19 @@
scoped_ptr<SpdyHeaderBlock> SpdyTestUtil::ConstructHeadHeaderBlock(
base::StringPiece url,
- int64 content_length) const {
+ int64_t content_length) const {
return ConstructHeaderBlock("HEAD", url, nullptr);
}
scoped_ptr<SpdyHeaderBlock> SpdyTestUtil::ConstructPostHeaderBlock(
base::StringPiece url,
- int64 content_length) const {
+ int64_t content_length) const {
return ConstructHeaderBlock("POST", url, &content_length);
}
scoped_ptr<SpdyHeaderBlock> SpdyTestUtil::ConstructPutHeaderBlock(
base::StringPiece url,
- int64 content_length) const {
+ int64_t content_length) const {
return ConstructHeaderBlock("PUT", url, &content_length);
}
@@ -885,7 +885,8 @@
return new SpdyFrame(kEmptyWrite, 0, false);
}
-SpdyFrame* SpdyTestUtil::ConstructSpdyPing(uint32 ping_id, bool is_ack) const {
+SpdyFrame* SpdyTestUtil::ConstructSpdyPing(uint32_t ping_id,
+ bool is_ack) const {
SpdyPingIR ping_ir(ping_id);
ping_ir.set_is_ack(is_ack);
return CreateFramer(false)->SerializeFrame(ping_ir);
@@ -909,7 +910,8 @@
}
SpdyFrame* SpdyTestUtil::ConstructSpdyWindowUpdate(
- const SpdyStreamId stream_id, uint32 delta_window_size) const {
+ const SpdyStreamId stream_id,
+ uint32_t delta_window_size) const {
SpdyWindowUpdateIR update_ir(stream_id, delta_window_size);
return CreateFramer(false)->SerializeFrame(update_ir);
}
@@ -1185,7 +1187,7 @@
SpdyFrame* SpdyTestUtil::ConstructSpdyPost(const char* url,
SpdyStreamId stream_id,
- int64 content_length,
+ int64_t content_length,
RequestPriority priority,
const char* const extra_headers[],
int extra_header_count) {
@@ -1223,7 +1225,7 @@
SpdyFrame* SpdyTestUtil::ConstructSpdyBodyFrame(int stream_id,
const char* data,
- uint32 len,
+ uint32_t len,
bool fin) {
SpdyFramer framer(spdy_version_);
SpdyDataIR data_ir(stream_id, base::StringPiece(data, len));
@@ -1233,7 +1235,7 @@
SpdyFrame* SpdyTestUtil::ConstructSpdyBodyFrame(int stream_id,
const char* data,
- uint32 len,
+ uint32_t len,
bool fin,
int padding_length) {
SpdyFramer framer(spdy_version_);
@@ -1300,7 +1302,7 @@
scoped_ptr<SpdyHeaderBlock> SpdyTestUtil::ConstructHeaderBlock(
base::StringPiece method,
base::StringPiece url,
- int64* content_length) const {
+ int64_t* content_length) const {
std::string scheme, host, path;
ParseUrl(url.data(), &scheme, &host, &path);
scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock());
diff --git a/net/spdy/spdy_test_util_common.h b/net/spdy/spdy_test_util_common.h
index dd78283..474afd7 100644
--- a/net/spdy/spdy_test_util_common.h
+++ b/net/spdy/spdy_test_util_common.h
@@ -5,9 +5,13 @@
#ifndef NET_SPDY_SPDY_TEST_UTIL_COMMON_H_
#define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "crypto/ec_private_key.h"
@@ -129,7 +133,7 @@
bool compressed;
SpdyRstStreamStatus status;
const char* data;
- uint32 data_length;
+ uint32_t data_length;
SpdyDataFlags data_flags;
};
@@ -139,11 +143,11 @@
explicit MockECSignatureCreator(crypto::ECPrivateKey* key);
// crypto::ECSignatureCreator
- bool Sign(const uint8* data,
+ bool Sign(const uint8_t* data,
int data_len,
- std::vector<uint8>* signature) override;
- bool DecodeSignature(const std::vector<uint8>& signature,
- std::vector<uint8>* out_raw_sig) override;
+ std::vector<uint8_t>* signature) override;
+ bool DecodeSignature(const std::vector<uint8_t>& signature,
+ std::vector<uint8_t>* out_raw_sig) override;
private:
crypto::ECPrivateKey* key_;
@@ -291,13 +295,13 @@
base::StringPiece url) const;
scoped_ptr<SpdyHeaderBlock> ConstructHeadHeaderBlock(
base::StringPiece url,
- int64 content_length) const;
+ int64_t content_length) const;
scoped_ptr<SpdyHeaderBlock> ConstructPostHeaderBlock(
base::StringPiece url,
- int64 content_length) const;
+ int64_t content_length) const;
scoped_ptr<SpdyHeaderBlock> ConstructPutHeaderBlock(
base::StringPiece url,
- int64 content_length) const;
+ int64_t content_length) const;
// Construct a SPDY frame. If it is a SYN_STREAM or SYN_REPLY frame (as
// specified in header_info.kind), the provided headers are included in the
@@ -358,7 +362,7 @@
// Construct a SPDY PING frame.
// Returns the constructed frame. The caller takes ownership of the frame.
- SpdyFrame* ConstructSpdyPing(uint32 ping_id, bool is_ack) const;
+ SpdyFrame* ConstructSpdyPing(uint32_t ping_id, bool is_ack) const;
// Construct a SPDY GOAWAY frame with last_good_stream_id = 0.
// Returns the constructed frame. The caller takes ownership of the frame.
@@ -377,9 +381,8 @@
// Construct a SPDY WINDOW_UPDATE frame.
// Returns the constructed frame. The caller takes ownership of the frame.
- SpdyFrame* ConstructSpdyWindowUpdate(
- SpdyStreamId stream_id,
- uint32 delta_window_size) const;
+ SpdyFrame* ConstructSpdyWindowUpdate(SpdyStreamId stream_id,
+ uint32_t delta_window_size) const;
// Construct a SPDY RST_STREAM frame.
// Returns the constructed frame. The caller takes ownership of the frame.
@@ -490,7 +493,7 @@
// Returns a SpdyFrame.
SpdyFrame* ConstructSpdyPost(const char* url,
SpdyStreamId stream_id,
- int64 content_length,
+ int64_t content_length,
RequestPriority priority,
const char* const extra_headers[],
int extra_header_count);
@@ -514,13 +517,15 @@
bool fin);
// Constructs a single SPDY data frame with the given content.
- SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data,
- uint32 len, bool fin);
+ SpdyFrame* ConstructSpdyBodyFrame(int stream_id,
+ const char* data,
+ uint32_t len,
+ bool fin);
// Constructs a single SPDY data frame with the given content and padding.
SpdyFrame* ConstructSpdyBodyFrame(int stream_id,
const char* data,
- uint32 len,
+ uint32_t len,
bool fin,
int padding_length);
@@ -561,7 +566,7 @@
scoped_ptr<SpdyHeaderBlock> ConstructHeaderBlock(
base::StringPiece method,
base::StringPiece url,
- int64* content_length) const;
+ int64_t* content_length) const;
const NextProto protocol_;
const SpdyMajorVersion spdy_version_;
diff --git a/net/spdy/spdy_test_utils.cc b/net/spdy/spdy_test_utils.cc
index de517c6..bc0dc17f66 100644
--- a/net/spdy/spdy_test_utils.cc
+++ b/net/spdy/spdy_test_utils.cc
@@ -89,7 +89,7 @@
}
void SetFrameFlags(SpdyFrame* frame,
- uint8 flags,
+ uint8_t flags,
SpdyMajorVersion spdy_version) {
switch (spdy_version) {
case SPDY2:
@@ -110,7 +110,7 @@
case SPDY3:
CHECK_EQ(0u, length & ~kLengthMask);
{
- int32 wire_length = base::HostToNet32(length);
+ int32_t wire_length = base::HostToNet32(length);
// The length field in SPDY 2 and 3 is a 24-bit (3B) integer starting at
// offset 5.
memcpy(frame->data() + 5, reinterpret_cast<char*>(&wire_length) + 1, 3);
@@ -119,7 +119,7 @@
case HTTP2:
CHECK_GT(1u<<14, length);
{
- int32 wire_length = base::HostToNet32(length);
+ int32_t wire_length = base::HostToNet32(length);
memcpy(frame->data(),
reinterpret_cast<char*>(&wire_length) + 1,
3);
@@ -131,7 +131,7 @@
}
std::string a2b_hex(const char* hex_data) {
- std::vector<uint8> output;
+ std::vector<uint8_t> output;
std::string result;
if (base::HexStringToBytes(hex_data, &output))
result.assign(reinterpret_cast<const char*>(&output[0]), output.size());
diff --git a/net/spdy/spdy_test_utils.h b/net/spdy/spdy_test_utils.h
index fee91f68..de4212f6 100644
--- a/net/spdy/spdy_test_utils.h
+++ b/net/spdy/spdy_test_utils.h
@@ -5,6 +5,7 @@
#ifndef NET_SPDY_TEST_UTILS_H_
#define NET_SPDY_TEST_UTILS_H_
+#include <stddef.h>
#include <stdint.h>
#include <string>
@@ -35,7 +36,7 @@
const int expected_len);
void SetFrameFlags(SpdyFrame* frame,
- uint8 flags,
+ uint8_t flags,
SpdyMajorVersion spdy_version);
void SetFrameLength(SpdyFrame* frame,
diff --git a/net/spdy/spdy_write_queue.h b/net/spdy/spdy_write_queue.h
index bd67f6b..c19b3f2 100644
--- a/net/spdy/spdy_write_queue.h
+++ b/net/spdy/spdy_write_queue.h
@@ -7,7 +7,7 @@
#include <deque>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/spdy/spdy_write_queue_unittest.cc b/net/spdy/spdy_write_queue_unittest.cc
index 0f83b3e9..61e925b 100644
--- a/net/spdy/spdy_write_queue_unittest.cc
+++ b/net/spdy/spdy_write_queue_unittest.cc
@@ -8,7 +8,6 @@
#include <cstring>
#include <string>
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
diff --git a/net/spdy/write_blocked_list.h b/net/spdy/write_blocked_list.h
index 47b19db..76d22da 100644
--- a/net/spdy/write_blocked_list.h
+++ b/net/spdy/write_blocked_list.h
@@ -5,6 +5,8 @@
#ifndef NET_SPDY_WRITE_BLOCKED_LIST_H_
#define NET_SPDY_WRITE_BLOCKED_LIST_H_
+#include <stddef.h>
+
#include <algorithm>
#include <deque>
diff --git a/net/ssl/channel_id_service.cc b/net/ssl/channel_id_service.cc
index cfa61ccd..fbf21c7 100644
--- a/net/ssl/channel_id_service.cc
+++ b/net/ssl/channel_id_service.cc
@@ -13,6 +13,7 @@
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_macros.h"
diff --git a/net/ssl/channel_id_service.h b/net/ssl/channel_id_service.h
index abb22fa..eb4a92ae 100644
--- a/net/ssl/channel_id_service.h
+++ b/net/ssl/channel_id_service.h
@@ -5,11 +5,13 @@
#ifndef NET_SSL_CHANNEL_ID_SERVICE_H_
#define NET_SSL_CHANNEL_ID_SERVICE_H_
+#include <stdint.h>
+
#include <map>
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
@@ -129,10 +131,10 @@
// Public only for unit testing.
int channel_id_count();
- uint64 requests() const { return requests_; }
- uint64 key_store_hits() const { return key_store_hits_; }
- uint64 inflight_joins() const { return inflight_joins_; }
- uint64 workers_created() const { return workers_created_; }
+ uint64_t requests() const { return requests_; }
+ uint64_t key_store_hits() const { return key_store_hits_; }
+ uint64_t inflight_joins() const { return inflight_joins_; }
+ uint64_t workers_created() const { return workers_created_; }
private:
void GotChannelID(int err,
@@ -174,10 +176,10 @@
// place.
std::map<std::string, ChannelIDServiceJob*> inflight_;
- uint64 requests_;
- uint64 key_store_hits_;
- uint64 inflight_joins_;
- uint64 workers_created_;
+ uint64_t requests_;
+ uint64_t key_store_hits_;
+ uint64_t inflight_joins_;
+ uint64_t workers_created_;
base::WeakPtrFactory<ChannelIDService> weak_ptr_factory_;
diff --git a/net/ssl/channel_id_service_unittest.cc b/net/ssl/channel_id_service_unittest.cc
index 2a2ec962..1e98b61 100644
--- a/net/ssl/channel_id_service_unittest.cc
+++ b/net/ssl/channel_id_service_unittest.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
diff --git a/net/ssl/client_cert_store.h b/net/ssl/client_cert_store.h
index b1172deb..f87c22e 100644
--- a/net/ssl/client_cert_store.h
+++ b/net/ssl/client_cert_store.h
@@ -5,8 +5,8 @@
#ifndef NET_SSL_CLIENT_CERT_STORE_H_
#define NET_SSL_CLIENT_CERT_STORE_H_
-#include "base/basictypes.h"
#include "base/callback_forward.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/cert/x509_certificate.h"
diff --git a/net/ssl/client_cert_store_mac.h b/net/ssl/client_cert_store_mac.h
index bca35b3..aade83ce 100644
--- a/net/ssl/client_cert_store_mac.h
+++ b/net/ssl/client_cert_store_mac.h
@@ -5,8 +5,8 @@
#ifndef NET_SSL_CLIENT_CERT_STORE_MAC_H_
#define NET_SSL_CLIENT_CERT_STORE_MAC_H_
-#include "base/basictypes.h"
#include "base/callback.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/ssl/client_cert_store.h"
#include "net/ssl/ssl_cert_request_info.h"
diff --git a/net/ssl/client_cert_store_win.h b/net/ssl/client_cert_store_win.h
index f19354c..ffbb301b 100644
--- a/net/ssl/client_cert_store_win.h
+++ b/net/ssl/client_cert_store_win.h
@@ -5,8 +5,8 @@
#ifndef NET_SSL_CLIENT_CERT_STORE_WIN_H_
#define NET_SSL_CLIENT_CERT_STORE_WIN_H_
-#include "base/basictypes.h"
#include "base/callback.h"
+#include "base/macros.h"
#include "crypto/scoped_capi_types.h"
#include "net/base/net_export.h"
#include "net/ssl/client_cert_store.h"
diff --git a/net/ssl/default_channel_id_store.h b/net/ssl/default_channel_id_store.h
index 516d33b..52eb1d0 100644
--- a/net/ssl/default_channel_id_store.h
+++ b/net/ssl/default_channel_id_store.h
@@ -11,6 +11,7 @@
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
diff --git a/net/ssl/openssl_client_key_store.h b/net/ssl/openssl_client_key_store.h
index 16904ef3..269565bf 100644
--- a/net/ssl/openssl_client_key_store.h
+++ b/net/ssl/openssl_client_key_store.h
@@ -9,7 +9,7 @@
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "crypto/openssl_util.h"
diff --git a/net/ssl/openssl_ssl_util.h b/net/ssl/openssl_ssl_util.h
index 6c886cc..af8b9ab 100644
--- a/net/ssl/openssl_ssl_util.h
+++ b/net/ssl/openssl_ssl_util.h
@@ -5,6 +5,8 @@
#ifndef NET_SSL_OPENSSL_SSL_UTIL_H_
#define NET_SSL_OPENSSL_SSL_UTIL_H_
+#include <stdint.h>
+
#include "net/log/net_log.h"
namespace crypto {
diff --git a/net/ssl/ssl_cipher_suite_names.cc b/net/ssl/ssl_cipher_suite_names.cc
index fc99cfe..2bfe72a 100644
--- a/net/ssl/ssl_cipher_suite_names.cc
+++ b/net/ssl/ssl_cipher_suite_names.cc
@@ -31,7 +31,7 @@
namespace {
struct CipherSuite {
- uint16 cipher_suite, encoded;
+ uint16_t cipher_suite, encoded;
};
const struct CipherSuite kCipherSuites[] = {
@@ -277,7 +277,7 @@
}
}
-bool GetCipherProperties(uint16 cipher_suite,
+bool GetCipherProperties(uint16_t cipher_suite,
int* out_key_exchange,
int* out_cipher,
int* out_mac) {
@@ -303,8 +303,8 @@
void SSLCipherSuiteToStrings(const char** key_exchange_str,
const char** cipher_str,
const char** mac_str,
- bool *is_aead,
- uint16 cipher_suite) {
+ bool* is_aead,
+ uint16_t cipher_suite) {
*key_exchange_str = *cipher_str = *mac_str = "???";
*is_aead = false;
@@ -350,19 +350,19 @@
}
bool ParseSSLCipherString(const std::string& cipher_string,
- uint16* cipher_suite) {
+ uint16_t* cipher_suite) {
int value = 0;
if (cipher_string.size() == 6 &&
base::StartsWith(cipher_string, "0x",
base::CompareCase::INSENSITIVE_ASCII) &&
base::HexStringToInt(cipher_string, &value)) {
- *cipher_suite = static_cast<uint16>(value);
+ *cipher_suite = static_cast<uint16_t>(value);
return true;
}
return false;
}
-bool IsSecureTLSCipherSuite(uint16 cipher_suite) {
+bool IsSecureTLSCipherSuite(uint16_t cipher_suite) {
int key_exchange, cipher, mac;
if (!GetCipherProperties(cipher_suite, &key_exchange, &cipher, &mac))
return false;
@@ -392,7 +392,7 @@
return true;
}
-bool IsTLSCipherSuiteAllowedByHTTP2(uint16 cipher_suite) {
+bool IsTLSCipherSuiteAllowedByHTTP2(uint16_t cipher_suite) {
int key_exchange, cipher, mac;
if (!GetCipherProperties(cipher_suite, &key_exchange, &cipher, &mac))
return false;
@@ -423,7 +423,7 @@
return true;
}
-const char* ECCurveName(uint16 cipher_suite, int key_exchange_info) {
+const char* ECCurveName(uint16_t cipher_suite, int key_exchange_info) {
#if defined(USE_OPENSSL)
int key_exchange, cipher, mac;
if (!GetCipherProperties(cipher_suite, &key_exchange, &cipher, &mac))
diff --git a/net/ssl/ssl_cipher_suite_names.h b/net/ssl/ssl_cipher_suite_names.h
index 186af71..4651eb18 100644
--- a/net/ssl/ssl_cipher_suite_names.h
+++ b/net/ssl/ssl_cipher_suite_names.h
@@ -5,9 +5,10 @@
#ifndef NET_SSL_SSL_CIPHER_SUITE_NAMES_H_
#define NET_SSL_SSL_CIPHER_SUITE_NAMES_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
namespace net {
@@ -23,7 +24,7 @@
const char** cipher_str,
const char** mac_str,
bool* is_aead,
- uint16 cipher_suite);
+ uint16_t cipher_suite);
// SSLVersionToString returns the name of the SSL protocol version
// specified by |ssl_version|, which is defined in
@@ -44,7 +45,7 @@
// TODO(rsleevi): Support the full strings defined in the IANA TLS parameters
// list.
NET_EXPORT bool ParseSSLCipherString(const std::string& cipher_string,
- uint16* cipher_suite);
+ uint16_t* cipher_suite);
// |cipher_suite| is the IANA id for the cipher suite. What a "secure"
// cipher suite is arbitrarily determined here. The intent is to indicate what
@@ -54,16 +55,17 @@
// Currently, this function follows these criteria:
// 1) Only uses ECDHE-based key exchanges authenticated by a certificate
// 2) Only uses AEADs
-NET_EXPORT bool IsSecureTLSCipherSuite(uint16 cipher_suite);
+NET_EXPORT bool IsSecureTLSCipherSuite(uint16_t cipher_suite);
// Returns true if |cipher_suite| is suitable for use with HTTP/2. See
// https://http2.github.io/http2-spec/#rfc.section.9.2.2.
-NET_EXPORT bool IsTLSCipherSuiteAllowedByHTTP2(uint16 cipher_suite);
+NET_EXPORT bool IsTLSCipherSuiteAllowedByHTTP2(uint16_t cipher_suite);
// Returns the static curve name of |key_exchange_info| if the |cipher_suite|
// is an elliptic curve, and a name is known. Returns nullptr otherwise.
// Only defined for OpenSSL, returns nullptr otherwise.
-NET_EXPORT const char* ECCurveName(uint16 cipher_suite, int key_exchange_info);
+NET_EXPORT const char* ECCurveName(uint16_t cipher_suite,
+ int key_exchange_info);
} // namespace net
diff --git a/net/ssl/ssl_cipher_suite_names_unittest.cc b/net/ssl/ssl_cipher_suite_names_unittest.cc
index 724f33e..cfa26e0 100644
--- a/net/ssl/ssl_cipher_suite_names_unittest.cc
+++ b/net/ssl/ssl_cipher_suite_names_unittest.cc
@@ -4,7 +4,7 @@
#include "net/ssl/ssl_cipher_suite_names.h"
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
@@ -48,7 +48,7 @@
}
TEST(CipherSuiteNamesTest, ParseSSLCipherString) {
- uint16 cipher_suite = 0;
+ uint16_t cipher_suite = 0;
EXPECT_TRUE(ParseSSLCipherString("0x0004", &cipher_suite));
EXPECT_EQ(0x00004u, cipher_suite);
@@ -64,7 +64,7 @@
};
for (size_t i = 0; i < arraysize(cipher_strings); ++i) {
- uint16 cipher_suite = 0;
+ uint16_t cipher_suite = 0;
EXPECT_FALSE(ParseSSLCipherString(cipher_strings[i], &cipher_suite));
}
}
diff --git a/net/ssl/ssl_client_auth_cache_unittest.cc b/net/ssl/ssl_client_auth_cache_unittest.cc
index f64fac3..3107ab8 100644
--- a/net/ssl/ssl_client_auth_cache_unittest.cc
+++ b/net/ssl/ssl_client_auth_cache_unittest.cc
@@ -4,6 +4,7 @@
#include "net/ssl/ssl_client_auth_cache.h"
+#include "base/macros.h"
#include "base/time/time.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/ssl_private_key.h"
diff --git a/net/ssl/ssl_client_session_cache_openssl.h b/net/ssl/ssl_client_session_cache_openssl.h
index ec1c57ed..b74042e 100644
--- a/net/ssl/ssl_client_session_cache_openssl.h
+++ b/net/ssl/ssl_client_session_cache_openssl.h
@@ -6,6 +6,7 @@
#define NET_SSL_SSL_CLIENT_SESSION_CACHE_OPENSSL_H
#include <openssl/ssl.h>
+#include <stddef.h>
#include <string>
diff --git a/net/ssl/ssl_config.h b/net/ssl/ssl_config.h
index 60f3dd1..5460f66 100644
--- a/net/ssl/ssl_config.h
+++ b/net/ssl/ssl_config.h
@@ -15,10 +15,10 @@
namespace net {
-// Various TLS/SSL ProtocolVersion values encoded as uint16
+// Various TLS/SSL ProtocolVersion values encoded as uint16_t
// struct {
-// uint8 major;
-// uint8 minor;
+// uint8_t major;
+// uint8_t minor;
// } ProtocolVersion;
// The most significant byte is |major|, and the least significant byte
// is |minor|.
@@ -84,14 +84,14 @@
// (Use the SSL_PROTOCOL_VERSION_xxx enumerators defined above.)
// SSL 2.0 and SSL 3.0 are not supported. If version_max < version_min, it
// means no protocol versions are enabled.
- uint16 version_min;
- uint16 version_max;
+ uint16_t version_min;
+ uint16_t version_max;
// version_fallback_min contains the minimum version that is acceptable to
// fallback to. Versions before this may be tried to see whether they would
// have succeeded and thus to give a better message to the user, but the
// resulting connection won't be used in these cases.
- uint16 version_fallback_min;
+ uint16_t version_fallback_min;
// Presorted list of cipher suites which should be explicitly prevented from
// being used in addition to those disabled by the net built-in policy.
@@ -109,12 +109,12 @@
// The ciphers listed in |disabled_cipher_suites| will be removed in addition
// to the above list.
//
- // Though cipher suites are sent in TLS as "uint8 CipherSuite[2]", in
+ // Though cipher suites are sent in TLS as "uint8_t CipherSuite[2]", in
// big-endian form, they should be declared in host byte order, with the
- // first uint8 occupying the most significant byte.
+ // first uint8_t occupying the most significant byte.
// Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify 0x0004, while to
// disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002.
- std::vector<uint16> disabled_cipher_suites;
+ std::vector<uint16_t> disabled_cipher_suites;
// Enables deprecated cipher suites. These cipher suites are selected under a
// fallback to distinguish servers which require them from servers which
diff --git a/net/ssl/ssl_config_service_defaults.h b/net/ssl/ssl_config_service_defaults.h
index de867da1..bec5b7a 100644
--- a/net/ssl/ssl_config_service_defaults.h
+++ b/net/ssl/ssl_config_service_defaults.h
@@ -5,6 +5,7 @@
#ifndef NET_SSL_SSL_CONFIG_SERVICE_DEFAULTS_H_
#define NET_SSL_SSL_CONFIG_SERVICE_DEFAULTS_H_
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/ssl/ssl_config_service.h"
diff --git a/net/ssl/ssl_config_service_unittest.cc b/net/ssl/ssl_config_service_unittest.cc
index 7428dd0..11f59cd 100644
--- a/net/ssl/ssl_config_service_unittest.cc
+++ b/net/ssl/ssl_config_service_unittest.cc
@@ -6,7 +6,6 @@
#include <vector>
-#include "base/basictypes.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -94,7 +93,7 @@
mock_service->SetSSLConfig(initial_config);
// Test that disabling certain cipher suites triggers an update.
- std::vector<uint16> disabled_ciphers;
+ std::vector<uint16_t> disabled_ciphers;
disabled_ciphers.push_back(0x0004u);
disabled_ciphers.push_back(0xBEEFu);
disabled_ciphers.push_back(0xDEADu);
diff --git a/net/ssl/ssl_connection_status_flags.h b/net/ssl/ssl_connection_status_flags.h
index 5d806ae7..c6c0305 100644
--- a/net/ssl/ssl_connection_status_flags.h
+++ b/net/ssl/ssl_connection_status_flags.h
@@ -5,6 +5,8 @@
#ifndef NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
#define NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
+#include <stdint.h>
+
#include "base/logging.h"
#include "base/macros.h"
@@ -53,8 +55,8 @@
static_assert(SSL_CONNECTION_VERSION_MAX - 1 <= SSL_CONNECTION_VERSION_MASK,
"SSL_CONNECTION_VERSION_MASK too small");
-inline uint16 SSLConnectionStatusToCipherSuite(int connection_status) {
- return static_cast<uint16>(connection_status);
+inline uint16_t SSLConnectionStatusToCipherSuite(int connection_status) {
+ return static_cast<uint16_t>(connection_status);
}
inline int SSLConnectionStatusToVersion(int connection_status) {
@@ -62,7 +64,7 @@
SSL_CONNECTION_VERSION_MASK;
}
-inline void SSLConnectionStatusSetCipherSuite(uint16 cipher_suite,
+inline void SSLConnectionStatusSetCipherSuite(uint16_t cipher_suite,
int* connection_status) {
// Clear out the old ciphersuite.
*connection_status &= ~SSL_CONNECTION_CIPHERSUITE_MASK;
diff --git a/net/ssl/ssl_connection_status_flags_unittest.cc b/net/ssl/ssl_connection_status_flags_unittest.cc
index 98e4f53..9827605 100644
--- a/net/ssl/ssl_connection_status_flags_unittest.cc
+++ b/net/ssl/ssl_connection_status_flags_unittest.cc
@@ -21,7 +21,7 @@
TEST(SSLConnectionStatusTest, SetVersion) {
int connection_status = 0xDEADBEEF;
- uint16 expected_cipher_suite =
+ uint16_t expected_cipher_suite =
SSLConnectionStatusToCipherSuite(connection_status);
SSLConnectionStatusSetVersion(SSL_CONNECTION_VERSION_TLS1_2,
diff --git a/net/ssl/ssl_key_logger.cc b/net/ssl/ssl_key_logger.cc
index 6e4c2d4..42984df 100644
--- a/net/ssl/ssl_key_logger.cc
+++ b/net/ssl/ssl_key_logger.cc
@@ -11,6 +11,7 @@
#include "base/files/scoped_file.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/sequence_checker.h"
#include "base/sequenced_task_runner.h"
diff --git a/net/ssl/ssl_platform_key_mac.cc b/net/ssl/ssl_platform_key_mac.cc
index 75ba2b9..ec7cb42 100644
--- a/net/ssl/ssl_platform_key_mac.cc
+++ b/net/ssl/ssl_platform_key_mac.cc
@@ -18,6 +18,7 @@
#include "base/logging.h"
#include "base/mac/mac_logging.h"
#include "base/mac/scoped_cftyperef.h"
+#include "base/macros.h"
#include "base/memory/scoped_policy.h"
#include "base/memory/scoped_ptr.h"
#include "base/sequenced_task_runner.h"
diff --git a/net/ssl/ssl_private_key.h b/net/ssl/ssl_private_key.h
index 0771c18..2e382fb 100644
--- a/net/ssl/ssl_private_key.h
+++ b/net/ssl/ssl_private_key.h
@@ -5,6 +5,7 @@
#ifndef NET_SSL_SSL_PRIVATE_KEY_H_
#define NET_SSL_SSL_PRIVATE_KEY_H_
+#include <stddef.h>
#include <stdint.h>
#include <vector>
diff --git a/net/ssl/ssl_server_config.h b/net/ssl/ssl_server_config.h
index 6e712fb..36d1286b 100644
--- a/net/ssl/ssl_server_config.h
+++ b/net/ssl/ssl_server_config.h
@@ -6,9 +6,9 @@
#define NET_SSL_SSL_SERVER_CONFIG_H_
#include <stdint.h>
+
#include <vector>
-#include "base/basictypes.h"
#include "net/base/net_export.h"
#include "net/ssl/ssl_config.h"
@@ -43,9 +43,9 @@
// The ciphers listed in |disabled_cipher_suites| will be removed in addition
// to the above list.
//
- // Though cipher suites are sent in TLS as "uint8 CipherSuite[2]", in
+ // Though cipher suites are sent in TLS as "uint8_t CipherSuite[2]", in
// big-endian form, they should be declared in host byte order, with the
- // first uint8 occupying the most significant byte.
+ // first uint8_t occupying the most significant byte.
// Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify 0x0004, while to
// disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002.
std::vector<uint16_t> disabled_cipher_suites;
diff --git a/net/ssl/threaded_ssl_private_key.h b/net/ssl/threaded_ssl_private_key.h
index 6fe9987..629ce3b 100644
--- a/net/ssl/threaded_ssl_private_key.h
+++ b/net/ssl/threaded_ssl_private_key.h
@@ -5,6 +5,7 @@
#ifndef NET_SSL_THREADED_SSL_PRIVATE_KEY_H_
#define NET_SSL_THREADED_SSL_PRIVATE_KEY_H_
+#include <stddef.h>
#include <stdint.h>
#include <vector>
diff --git a/net/test/cert_test_util_nss.cc b/net/test/cert_test_util_nss.cc
index 4427ceb..4cd435b 100644
--- a/net/test/cert_test_util_nss.cc
+++ b/net/test/cert_test_util_nss.cc
@@ -27,10 +27,10 @@
return false;
}
- const uint8* key_pkcs8_begin =
- reinterpret_cast<const uint8*>(key_pkcs8.data());
- std::vector<uint8> key_vector(key_pkcs8_begin,
- key_pkcs8_begin + key_pkcs8.length());
+ const uint8_t* key_pkcs8_begin =
+ reinterpret_cast<const uint8_t*>(key_pkcs8.data());
+ std::vector<uint8_t> key_vector(key_pkcs8_begin,
+ key_pkcs8_begin + key_pkcs8.length());
crypto::ScopedSECKEYPrivateKey private_key(
crypto::ImportNSSKeyFromPrivateKeyInfo(slot, key_vector,
diff --git a/net/test/ct_test_util.cc b/net/test/ct_test_util.cc
index 3bd30ff4..9381934 100644
--- a/net/test/ct_test_util.cc
+++ b/net/test/ct_test_util.cc
@@ -25,7 +25,7 @@
namespace {
std::string HexToBytes(const char* hex_data) {
- std::vector<uint8> output;
+ std::vector<uint8_t> output;
std::string result;
if (base::HexStringToBytes(hex_data, &output))
result.assign(reinterpret_cast<const char*>(&output[0]), output.size());
diff --git a/net/test/ct_test_util.h b/net/test/ct_test_util.h
index 5bb2d7a..72629ab 100644
--- a/net/test/ct_test_util.h
+++ b/net/test/ct_test_util.h
@@ -5,6 +5,9 @@
#ifndef NET_CERT_CT_TEST_UTIL_H_
#define NET_CERT_CT_TEST_UTIL_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
diff --git a/net/test/embedded_test_server/android/embedded_test_server_android.h b/net/test/embedded_test_server/android/embedded_test_server_android.h
index a17348f..a3876f7 100644
--- a/net/test/embedded_test_server/android/embedded_test_server_android.h
+++ b/net/test/embedded_test_server/android/embedded_test_server_android.h
@@ -9,6 +9,7 @@
#include "base/android/jni_weak_ref.h"
#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h
index 044f017a..ad69a14 100644
--- a/net/test/embedded_test_server/embedded_test_server.h
+++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -5,14 +5,16 @@
#ifndef NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_
#define NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_
+#include <stdint.h>
+
#include <map>
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -170,7 +172,7 @@
bool GetAddressList(AddressList* address_list) const WARN_UNUSED_RESULT;
// Returns the port number used by the server.
- uint16 port() const { return port_; }
+ uint16_t port() const { return port_; }
void SetSSLConfig(ServerCertificate cert, const SSLServerConfig& ssl_config);
void SetSSLConfig(ServerCertificate cert);
@@ -255,7 +257,7 @@
scoped_ptr<StreamSocket> accepted_socket_;
EmbeddedTestServerConnectionListener* connection_listener_;
- uint16 port_;
+ uint16_t port_;
GURL base_url_;
IPEndPoint local_endpoint_;
diff --git a/net/test/embedded_test_server/embedded_test_server_unittest.cc b/net/test/embedded_test_server/embedded_test_server_unittest.cc
index e008ac23..03061e44 100644
--- a/net/test/embedded_test_server/embedded_test_server_unittest.cc
+++ b/net/test/embedded_test_server/embedded_test_server_unittest.cc
@@ -4,6 +4,7 @@
#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/path_service.h"
#include "base/run_loop.h"
diff --git a/net/test/embedded_test_server/http_connection.h b/net/test/embedded_test_server/http_connection.h
index 20aa33f..4f4e555 100644
--- a/net/test/embedded_test_server/http_connection.h
+++ b/net/test/embedded_test_server/http_connection.h
@@ -5,8 +5,8 @@
#ifndef NET_TEST_EMBEDDED_TEST_SERVER_HTTP_CONNECTION_H_
#define NET_TEST_EMBEDDED_TEST_SERVER_HTTP_CONNECTION_H_
-#include "base/basictypes.h"
#include "base/callback.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/test/embedded_test_server/http_request.h b/net/test/embedded_test_server/http_request.h
index 9a142e8..1753cfd 100644
--- a/net/test/embedded_test_server/http_request.h
+++ b/net/test/embedded_test_server/http_request.h
@@ -5,10 +5,12 @@
#ifndef NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_
#define NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_
+#include <stddef.h>
+
#include <map>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "url/gurl.h"
diff --git a/net/test/embedded_test_server/http_response.h b/net/test/embedded_test_server/http_response.h
index cc4be86..caca4bf1f 100644
--- a/net/test/embedded_test_server/http_response.h
+++ b/net/test/embedded_test_server/http_response.h
@@ -7,9 +7,9 @@
#include <string>
-#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/strings/string_split.h"
#include "net/http/http_status_code.h"
diff --git a/net/test/scoped_disable_exit_on_dfatal.h b/net/test/scoped_disable_exit_on_dfatal.h
index d536fbc..33f06e3 100644
--- a/net/test/scoped_disable_exit_on_dfatal.h
+++ b/net/test/scoped_disable_exit_on_dfatal.h
@@ -6,13 +6,13 @@
#define NET_TEST_SCOPED_DISABLE_EXIT_ON_DFATAL_H_
#include "base/logging.h"
+#include "base/macros.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
namespace test {
-
// The ScopedDisableExitOnDFatal class is used to disable exiting the
// program when we encounter a LOG(DFATAL) within the current block.
// After we leave the current block, the default behavior is
diff --git a/net/test/spawned_test_server/base_test_server.h b/net/test/spawned_test_server/base_test_server.h
index 3ea2506..7df2416 100644
--- a/net/test/spawned_test_server/base_test_server.h
+++ b/net/test/spawned_test_server/base_test_server.h
@@ -5,12 +5,15 @@
#ifndef NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_
#define NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_
+#include <stdint.h>
+
#include <string>
#include <utility>
#include <vector>
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/host_port_pair.h"
@@ -156,7 +159,7 @@
// If not zero, |cert_serial| will be the serial number of the
// auto-generated leaf certificate when |server_certificate==CERT_AUTO|.
- uint64 cert_serial;
+ uint64_t cert_serial;
// True if a CertificateRequest should be sent to the client during
// handshaking.
@@ -297,10 +300,10 @@
// Gets port currently assigned to host_port_pair_ without checking
// whether it's available (server started) or not.
- uint16 GetPort();
+ uint16_t GetPort();
// Sets |port| as the actual port used by Python based test server.
- void SetPort(uint16 port);
+ void SetPort(uint16_t port);
// Set up internal status when the server is started.
bool SetupWhenServerStarted() WARN_UNUSED_RESULT;
diff --git a/net/test/spawned_test_server/local_test_server.h b/net/test/spawned_test_server/local_test_server.h
index 785d726..98152a1 100644
--- a/net/test/spawned_test_server/local_test_server.h
+++ b/net/test/spawned_test_server/local_test_server.h
@@ -9,6 +9,7 @@
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
+#include "base/macros.h"
#include "base/process/process.h"
#include "net/test/spawned_test_server/base_test_server.h"
diff --git a/net/test/spawned_test_server/local_test_server_posix.cc b/net/test/spawned_test_server/local_test_server_posix.cc
index 2899c90..e5db9c0 100644
--- a/net/test/spawned_test_server/local_test_server_posix.cc
+++ b/net/test/spawned_test_server/local_test_server_posix.cc
@@ -12,6 +12,7 @@
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/process/kill.h"
#include "base/process/launch.h"
#include "base/process/process_iterator.h"
@@ -60,7 +61,9 @@
// Given a file descriptor, reads into |buffer| until |bytes_max|
// bytes has been read or an error has been encountered. Returns true
// if the read was successful. |remaining_time| is used as a timeout.
-bool ReadData(int fd, ssize_t bytes_max, uint8* buffer,
+bool ReadData(int fd,
+ ssize_t bytes_max,
+ uint8_t* buffer,
base::TimeDelta* remaining_time) {
ssize_t bytes_read = 0;
base::TimeTicks previous_time = base::TimeTicks::Now();
@@ -153,17 +156,16 @@
base::TimeDelta remaining_time = TestTimeouts::action_timeout();
- uint32 server_data_len = 0;
+ uint32_t server_data_len = 0;
if (!ReadData(our_fd.get(), sizeof(server_data_len),
- reinterpret_cast<uint8*>(&server_data_len),
+ reinterpret_cast<uint8_t*>(&server_data_len),
&remaining_time)) {
LOG(ERROR) << "Could not read server_data_len";
return false;
}
std::string server_data(server_data_len, '\0');
if (!ReadData(our_fd.get(), server_data_len,
- reinterpret_cast<uint8*>(&server_data[0]),
- &remaining_time)) {
+ reinterpret_cast<uint8_t*>(&server_data[0]), &remaining_time)) {
LOG(ERROR) << "Could not read server_data (" << server_data_len
<< " bytes)";
return false;
diff --git a/net/test/spawned_test_server/local_test_server_win.cc b/net/test/spawned_test_server/local_test_server_win.cc
index 0476b907..3e87e997 100644
--- a/net/test/spawned_test_server/local_test_server_win.cc
+++ b/net/test/spawned_test_server/local_test_server_win.cc
@@ -41,8 +41,10 @@
// Given a file handle, reads into |buffer| until |bytes_max| bytes
// has been read or an error has been encountered. Returns
// true if the read was successful.
-bool ReadData(HANDLE read_fd, HANDLE write_fd,
- DWORD bytes_max, uint8* buffer) {
+bool ReadData(HANDLE read_fd,
+ HANDLE write_fd,
+ DWORD bytes_max,
+ uint8_t* buffer) {
base::Thread thread("test_server_watcher");
if (!thread.Start())
return false;
@@ -138,15 +140,15 @@
base::win::ScopedHandle read_fd(child_read_fd_.Take());
base::win::ScopedHandle write_fd(child_write_fd_.Take());
- uint32 server_data_len = 0;
+ uint32_t server_data_len = 0;
if (!ReadData(read_fd.Get(), write_fd.Get(), sizeof(server_data_len),
- reinterpret_cast<uint8*>(&server_data_len))) {
+ reinterpret_cast<uint8_t*>(&server_data_len))) {
LOG(ERROR) << "Could not read server_data_len";
return false;
}
std::string server_data(server_data_len, '\0');
if (!ReadData(read_fd.Get(), write_fd.Get(), server_data_len,
- reinterpret_cast<uint8*>(&server_data[0]))) {
+ reinterpret_cast<uint8_t*>(&server_data[0]))) {
LOG(ERROR) << "Could not read server_data (" << server_data_len
<< " bytes)";
return false;
diff --git a/net/test/spawned_test_server/remote_test_server.h b/net/test/spawned_test_server/remote_test_server.h
index a8b8bb2c..0de5c7f 100644
--- a/net/test/spawned_test_server/remote_test_server.h
+++ b/net/test/spawned_test_server/remote_test_server.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "net/test/spawned_test_server/base_test_server.h"
namespace net {
diff --git a/net/test/spawned_test_server/spawner_communicator.cc b/net/test/spawned_test_server/spawner_communicator.cc
index 0962143..9c6470e 100644
--- a/net/test/spawned_test_server/spawner_communicator.cc
+++ b/net/test/spawned_test_server/spawner_communicator.cc
@@ -8,6 +8,7 @@
#include "base/json/json_reader.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/strings/stringprintf.h"
#include "base/supports_user_data.h"
#include "base/test/test_timeouts.h"
diff --git a/net/test/spawned_test_server/spawner_communicator.h b/net/test/spawned_test_server/spawner_communicator.h
index ee1f057..c066016 100644
--- a/net/test/spawned_test_server/spawner_communicator.h
+++ b/net/test/spawned_test_server/spawner_communicator.h
@@ -9,6 +9,7 @@
#include <string>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/synchronization/waitable_event.h"
diff --git a/net/test/test_certificate_data.h b/net/test/test_certificate_data.h
index b5346b4d..a2e26a5 100644
--- a/net/test/test_certificate_data.h
+++ b/net/test/test_certificate_data.h
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stdint.h>
+
namespace {
// This is the SHA1 hash of the SubjectPublicKeyInfo of nist.der.
@@ -524,17 +526,16 @@
// 44:d=3 hl=2 l= 3 prim: OBJECT :organizationalUnitName
// 49:d=3 hl=2 l= 46 prim: PRINTABLESTRING :
// Class 1 Public Primary Certification Authority
-const uint8 VARIABLE_IS_NOT_USED VerisignDN[] = {
- 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
- 0x02, 0x55, 0x53, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0a,
- 0x13, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20,
- 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x37, 0x30, 0x35, 0x06, 0x03, 0x55, 0x04,
- 0x0b, 0x13, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x31, 0x20, 0x50,
- 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72,
- 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74,
- 0x79
-};
+const uint8_t VARIABLE_IS_NOT_USED VerisignDN[] = {
+ 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
+ 0x13, 0x02, 0x55, 0x53, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55,
+ 0x04, 0x0a, 0x13, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67,
+ 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x37, 0x30, 0x35,
+ 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2e, 0x43, 0x6c, 0x61, 0x73,
+ 0x73, 0x20, 0x31, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,
+ 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72,
+ 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79};
// 0:d=0 hl=2 l= 125 cons: SEQUENCE
// 2:d=1 hl=2 l= 11 cons: SET
@@ -555,19 +556,18 @@
// 88:d=3 hl=2 l= 3 prim: OBJECT :commonName
// 93:d=3 hl=2 l= 32 prim: PRINTABLESTRING :
// StartCom Certification Authority
-const uint8 VARIABLE_IS_NOT_USED StartComDN[] = {
- 0x30, 0x7d, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
- 0x02, 0x49, 0x4c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a,
- 0x13, 0x0d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x20, 0x4c,
- 0x74, 0x64, 0x2e, 0x31, 0x2b, 0x30, 0x29, 0x06, 0x03, 0x55, 0x04, 0x0b,
- 0x13, 0x22, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x44, 0x69, 0x67,
- 0x69, 0x74, 0x61, 0x6c, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
- 0x63, 0x61, 0x74, 0x65, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67,
- 0x31, 0x29, 0x30, 0x27, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x20, 0x53,
- 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x20, 0x43, 0x65, 0x72, 0x74,
- 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75,
- 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79
-};
+const uint8_t VARIABLE_IS_NOT_USED StartComDN[] = {
+ 0x30, 0x7d, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
+ 0x02, 0x49, 0x4c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a,
+ 0x13, 0x0d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x20, 0x4c,
+ 0x74, 0x64, 0x2e, 0x31, 0x2b, 0x30, 0x29, 0x06, 0x03, 0x55, 0x04, 0x0b,
+ 0x13, 0x22, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x44, 0x69, 0x67,
+ 0x69, 0x74, 0x61, 0x6c, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
+ 0x63, 0x61, 0x74, 0x65, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67,
+ 0x31, 0x29, 0x30, 0x27, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x20, 0x53,
+ 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x20, 0x43, 0x65, 0x72, 0x74,
+ 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75,
+ 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79};
// 0:d=0 hl=3 l= 174 cons: SEQUENCE
// 3:d=1 hl=2 l= 11 cons: SET
@@ -595,23 +595,22 @@
//125:d=3 hl=2 l= 3 prim: OBJECT :commonName
//130:d=3 hl=2 l= 45 prim: PRINTABLESTRING :
// UTN-USERFirst-Client Authentication and Email
-const uint8 VARIABLE_IS_NOT_USED UserTrustDN[] = {
- 0x30, 0x81, 0xae, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
- 0x13, 0x02, 0x55, 0x53, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
- 0x08, 0x13, 0x02, 0x55, 0x54, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55,
- 0x04, 0x07, 0x13, 0x0e, 0x53, 0x61, 0x6c, 0x74, 0x20, 0x4c, 0x61, 0x6b,
- 0x65, 0x20, 0x43, 0x69, 0x74, 0x79, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03,
- 0x55, 0x04, 0x0a, 0x13, 0x15, 0x54, 0x68, 0x65, 0x20, 0x55, 0x53, 0x45,
- 0x52, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f,
- 0x72, 0x6b, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13,
- 0x18, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e,
- 0x75, 0x73, 0x65, 0x72, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x63, 0x6f,
- 0x6d, 0x31, 0x36, 0x30, 0x34, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x2d,
- 0x55, 0x54, 0x4e, 0x2d, 0x55, 0x53, 0x45, 0x52, 0x46, 0x69, 0x72, 0x73,
- 0x74, 0x2d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x41, 0x75, 0x74,
- 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
- 0x61, 0x6e, 0x64, 0x20, 0x45, 0x6d, 0x61, 0x69, 0x6c
-};
+const uint8_t VARIABLE_IS_NOT_USED UserTrustDN[] = {
+ 0x30, 0x81, 0xae, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
+ 0x13, 0x02, 0x55, 0x53, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
+ 0x08, 0x13, 0x02, 0x55, 0x54, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55,
+ 0x04, 0x07, 0x13, 0x0e, 0x53, 0x61, 0x6c, 0x74, 0x20, 0x4c, 0x61, 0x6b,
+ 0x65, 0x20, 0x43, 0x69, 0x74, 0x79, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03,
+ 0x55, 0x04, 0x0a, 0x13, 0x15, 0x54, 0x68, 0x65, 0x20, 0x55, 0x53, 0x45,
+ 0x52, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f,
+ 0x72, 0x6b, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13,
+ 0x18, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e,
+ 0x75, 0x73, 0x65, 0x72, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x31, 0x36, 0x30, 0x34, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x2d,
+ 0x55, 0x54, 0x4e, 0x2d, 0x55, 0x53, 0x45, 0x52, 0x46, 0x69, 0x72, 0x73,
+ 0x74, 0x2d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x41, 0x75, 0x74,
+ 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x61, 0x6e, 0x64, 0x20, 0x45, 0x6d, 0x61, 0x69, 0x6c};
// 0:d=0 hl=3 l= 190 cons: SEQUENCE
// 3:d=1 hl=2 l= 63 cons: SET
@@ -633,26 +632,25 @@
//107:d=3 hl=2 l= 84 prim: UTF8STRING :
// TÜRKTRUST Bilgi İletiÅŸim ve BiliÅŸim GüvenliÄŸi Hizmetleri A.Åž.
// (c) Kasım 2005
-const uint8 VARIABLE_IS_NOT_USED TurkTrustDN[] = {
- 0x30, 0x81, 0xbe, 0x31, 0x3f, 0x30, 0x3d, 0x06, 0x03, 0x55, 0x04, 0x03,
- 0x0c, 0x36, 0x54, 0xc3, 0x9c, 0x52, 0x4b, 0x54, 0x52, 0x55, 0x53, 0x54,
- 0x20, 0x45, 0x6c, 0x65, 0x6b, 0x74, 0x72, 0x6f, 0x6e, 0x69, 0x6b, 0x20,
- 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x6b, 0x61, 0x20, 0x48, 0x69,
- 0x7a, 0x6d, 0x65, 0x74, 0x20, 0x53, 0x61, 0xc4, 0x9f, 0x6c, 0x61, 0x79,
- 0xc4, 0xb1, 0x63, 0xc4, 0xb1, 0x73, 0xc4, 0xb1, 0x31, 0x0b, 0x30, 0x09,
- 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x54, 0x52, 0x31, 0x0f, 0x30,
- 0x0d, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x06, 0x41, 0x6e, 0x6b, 0x61,
- 0x72, 0x61, 0x31, 0x5d, 0x30, 0x5b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c,
- 0x54, 0x54, 0xc3, 0x9c, 0x52, 0x4b, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20,
- 0x42, 0x69, 0x6c, 0x67, 0x69, 0x20, 0xc4, 0xb0, 0x6c, 0x65, 0x74, 0x69,
- 0xc5, 0x9f, 0x69, 0x6d, 0x20, 0x76, 0x65, 0x20, 0x42, 0x69, 0x6c, 0x69,
- 0xc5, 0x9f, 0x69, 0x6d, 0x20, 0x47, 0xc3, 0xbc, 0x76, 0x65, 0x6e, 0x6c,
- 0x69, 0xc4, 0x9f, 0x69, 0x20, 0x48, 0x69, 0x7a, 0x6d, 0x65, 0x74, 0x6c,
- 0x65, 0x72, 0x69, 0x20, 0x41, 0x2e, 0xc5, 0x9e, 0x2e, 0x20, 0x28, 0x63,
- 0x29, 0x20, 0x4b, 0x61, 0x73, 0xc4, 0xb1, 0x6d, 0x20, 0x32, 0x30, 0x30,
- 0x35, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x35, 0x31, 0x31, 0x30, 0x37, 0x31,
- 0x30, 0x30, 0x37, 0x35, 0x37
-};
+const uint8_t VARIABLE_IS_NOT_USED TurkTrustDN[] = {
+ 0x30, 0x81, 0xbe, 0x31, 0x3f, 0x30, 0x3d, 0x06, 0x03, 0x55, 0x04, 0x03,
+ 0x0c, 0x36, 0x54, 0xc3, 0x9c, 0x52, 0x4b, 0x54, 0x52, 0x55, 0x53, 0x54,
+ 0x20, 0x45, 0x6c, 0x65, 0x6b, 0x74, 0x72, 0x6f, 0x6e, 0x69, 0x6b, 0x20,
+ 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x6b, 0x61, 0x20, 0x48, 0x69,
+ 0x7a, 0x6d, 0x65, 0x74, 0x20, 0x53, 0x61, 0xc4, 0x9f, 0x6c, 0x61, 0x79,
+ 0xc4, 0xb1, 0x63, 0xc4, 0xb1, 0x73, 0xc4, 0xb1, 0x31, 0x0b, 0x30, 0x09,
+ 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x54, 0x52, 0x31, 0x0f, 0x30,
+ 0x0d, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x06, 0x41, 0x6e, 0x6b, 0x61,
+ 0x72, 0x61, 0x31, 0x5d, 0x30, 0x5b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c,
+ 0x54, 0x54, 0xc3, 0x9c, 0x52, 0x4b, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20,
+ 0x42, 0x69, 0x6c, 0x67, 0x69, 0x20, 0xc4, 0xb0, 0x6c, 0x65, 0x74, 0x69,
+ 0xc5, 0x9f, 0x69, 0x6d, 0x20, 0x76, 0x65, 0x20, 0x42, 0x69, 0x6c, 0x69,
+ 0xc5, 0x9f, 0x69, 0x6d, 0x20, 0x47, 0xc3, 0xbc, 0x76, 0x65, 0x6e, 0x6c,
+ 0x69, 0xc4, 0x9f, 0x69, 0x20, 0x48, 0x69, 0x7a, 0x6d, 0x65, 0x74, 0x6c,
+ 0x65, 0x72, 0x69, 0x20, 0x41, 0x2e, 0xc5, 0x9e, 0x2e, 0x20, 0x28, 0x63,
+ 0x29, 0x20, 0x4b, 0x61, 0x73, 0xc4, 0xb1, 0x6d, 0x20, 0x32, 0x30, 0x30,
+ 0x35, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x35, 0x31, 0x31, 0x30, 0x37, 0x31,
+ 0x30, 0x30, 0x37, 0x35, 0x37};
// 33:d=2 hl=3 l= 207 cons: SEQUENCE
// 36:d=3 hl=2 l= 11 cons: SET
@@ -672,26 +670,25 @@
//219:d=4 hl=2 l= 22 cons: SEQUENCE
//221:d=5 hl=2 l= 3 prim: OBJECT :commonName
//226:d=5 hl=2 l= 15 prim: PRINTABLESTRING :A-Trust-Qual-01
-const uint8 VARIABLE_IS_NOT_USED ATrustQual01DN[] = {
- 0x30, 0x81, 0xcf, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
- 0x13, 0x02, 0x41, 0x54, 0x31, 0x81, 0x8b, 0x30, 0x81, 0x88, 0x06, 0x03,
- 0x55, 0x04, 0x0a, 0x1e, 0x81, 0x80, 0x00, 0x41, 0x00, 0x2d, 0x00, 0x54,
- 0x00, 0x72, 0x00, 0x75, 0x00, 0x73, 0x00, 0x74, 0x00, 0x20, 0x00, 0x47,
- 0x00, 0x65, 0x00, 0x73, 0x00, 0x2e, 0x00, 0x20, 0x00, 0x66, 0x00, 0xfc,
- 0x00, 0x72, 0x00, 0x20, 0x00, 0x53, 0x00, 0x69, 0x00, 0x63, 0x00, 0x68,
- 0x00, 0x65, 0x00, 0x72, 0x00, 0x68, 0x00, 0x65, 0x00, 0x69, 0x00, 0x74,
- 0x00, 0x73, 0x00, 0x73, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65,
- 0x00, 0x6d, 0x00, 0x65, 0x00, 0x20, 0x00, 0x69, 0x00, 0x6d, 0x00, 0x20,
- 0x00, 0x65, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x72,
- 0x00, 0x2e, 0x00, 0x20, 0x00, 0x44, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65,
- 0x00, 0x6e, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x65,
- 0x00, 0x68, 0x00, 0x72, 0x00, 0x20, 0x00, 0x47, 0x00, 0x6d, 0x00, 0x62,
- 0x00, 0x48, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13,
- 0x0f, 0x41, 0x2d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x2d, 0x51, 0x75, 0x61,
- 0x6c, 0x2d, 0x30, 0x31, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
- 0x03, 0x13, 0x0f, 0x41, 0x2d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x2d, 0x51,
- 0x75, 0x61, 0x6c, 0x2d, 0x30, 0x31, 0x30, 0x1e, 0x17
-};
+const uint8_t VARIABLE_IS_NOT_USED ATrustQual01DN[] = {
+ 0x30, 0x81, 0xcf, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
+ 0x13, 0x02, 0x41, 0x54, 0x31, 0x81, 0x8b, 0x30, 0x81, 0x88, 0x06, 0x03,
+ 0x55, 0x04, 0x0a, 0x1e, 0x81, 0x80, 0x00, 0x41, 0x00, 0x2d, 0x00, 0x54,
+ 0x00, 0x72, 0x00, 0x75, 0x00, 0x73, 0x00, 0x74, 0x00, 0x20, 0x00, 0x47,
+ 0x00, 0x65, 0x00, 0x73, 0x00, 0x2e, 0x00, 0x20, 0x00, 0x66, 0x00, 0xfc,
+ 0x00, 0x72, 0x00, 0x20, 0x00, 0x53, 0x00, 0x69, 0x00, 0x63, 0x00, 0x68,
+ 0x00, 0x65, 0x00, 0x72, 0x00, 0x68, 0x00, 0x65, 0x00, 0x69, 0x00, 0x74,
+ 0x00, 0x73, 0x00, 0x73, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65,
+ 0x00, 0x6d, 0x00, 0x65, 0x00, 0x20, 0x00, 0x69, 0x00, 0x6d, 0x00, 0x20,
+ 0x00, 0x65, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x72,
+ 0x00, 0x2e, 0x00, 0x20, 0x00, 0x44, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65,
+ 0x00, 0x6e, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x65,
+ 0x00, 0x68, 0x00, 0x72, 0x00, 0x20, 0x00, 0x47, 0x00, 0x6d, 0x00, 0x62,
+ 0x00, 0x48, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13,
+ 0x0f, 0x41, 0x2d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x2d, 0x51, 0x75, 0x61,
+ 0x6c, 0x2d, 0x30, 0x31, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
+ 0x03, 0x13, 0x0f, 0x41, 0x2d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x2d, 0x51,
+ 0x75, 0x61, 0x6c, 0x2d, 0x30, 0x31, 0x30, 0x1e, 0x17};
// 34:d=2 hl=3 l= 180 cons: SEQUENCE
// 37:d=3 hl=2 l= 20 cons: SET
@@ -713,24 +710,23 @@
//168:d=5 hl=2 l= 3 prim: OBJECT :commonName
//173:d=5 hl=2 l= 42 prim: PRINTABLESTRING :
// Entrust.net Certification Authority (2048)
-const uint8 VARIABLE_IS_NOT_USED EntrustDN[] = {
- 0x30, 0x81, 0xb4, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a,
- 0x13, 0x0b, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65,
- 0x74, 0x31, 0x40, 0x30, 0x3e, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x14, 0x37,
- 0x77, 0x77, 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e,
- 0x6e, 0x65, 0x74, 0x2f, 0x43, 0x50, 0x53, 0x5f, 0x32, 0x30, 0x34, 0x38,
- 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x20, 0x62, 0x79, 0x20,
- 0x72, 0x65, 0x66, 0x2e, 0x20, 0x28, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73,
- 0x20, 0x6c, 0x69, 0x61, 0x62, 0x2e, 0x29, 0x31, 0x25, 0x30, 0x23, 0x06,
- 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1c, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39,
- 0x39, 0x39, 0x20, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e,
- 0x65, 0x74, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x31, 0x33,
- 0x30, 0x31, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x2a, 0x45, 0x6e, 0x74,
- 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x43, 0x65, 0x72,
- 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41,
- 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x28, 0x32, 0x30,
- 0x34, 0x38, 0x29
-};
+const uint8_t VARIABLE_IS_NOT_USED EntrustDN[] = {
+ 0x30, 0x81, 0xb4, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a,
+ 0x13, 0x0b, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65,
+ 0x74, 0x31, 0x40, 0x30, 0x3e, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x14, 0x37,
+ 0x77, 0x77, 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e,
+ 0x6e, 0x65, 0x74, 0x2f, 0x43, 0x50, 0x53, 0x5f, 0x32, 0x30, 0x34, 0x38,
+ 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x20, 0x62, 0x79, 0x20,
+ 0x72, 0x65, 0x66, 0x2e, 0x20, 0x28, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73,
+ 0x20, 0x6c, 0x69, 0x61, 0x62, 0x2e, 0x29, 0x31, 0x25, 0x30, 0x23, 0x06,
+ 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1c, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39,
+ 0x39, 0x39, 0x20, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e,
+ 0x65, 0x74, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x31, 0x33,
+ 0x30, 0x31, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x2a, 0x45, 0x6e, 0x74,
+ 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x43, 0x65, 0x72,
+ 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41,
+ 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x28, 0x32, 0x30,
+ 0x34, 0x38, 0x29};
// 46:d=2 hl=2 l= 76 cons: SEQUENCE
// 48:d=3 hl=2 l= 11 cons: SET
@@ -746,15 +742,14 @@
// 102:d=4 hl=2 l= 20 cons: SEQUENCE
// 104:d=5 hl=2 l= 3 prim: OBJECT :commonName
// 109:d=5 hl=2 l= 13 prim: PRINTABLESTRING :Thawte SGC CA
-const uint8 VARIABLE_IS_NOT_USED ThawteDN[] = {
- 0x30, 0x4C, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
- 0x02, 0x5A, 0x41, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x0A,
- 0x13, 0x1C, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x43, 0x6F, 0x6E,
- 0x73, 0x75, 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x20, 0x28, 0x50, 0x74, 0x79,
- 0x29, 0x20, 0x4C, 0x74, 0x64, 0x2E, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03,
- 0x55, 0x04, 0x03, 0x13, 0x0D, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20,
- 0x53, 0x47, 0x43, 0x20, 0x43, 0x41
-};
+const uint8_t VARIABLE_IS_NOT_USED ThawteDN[] = {
+ 0x30, 0x4C, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
+ 0x02, 0x5A, 0x41, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x0A,
+ 0x13, 0x1C, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x43, 0x6F, 0x6E,
+ 0x73, 0x75, 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x20, 0x28, 0x50, 0x74, 0x79,
+ 0x29, 0x20, 0x4C, 0x74, 0x64, 0x2E, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03,
+ 0x55, 0x04, 0x03, 0x13, 0x0D, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20,
+ 0x53, 0x47, 0x43, 0x20, 0x43, 0x41};
// 47:d=2 hl=2 l= 108 cons: SEQUENCE
// 49:d=3 hl=2 l= 11 cons: SET
@@ -774,17 +769,16 @@
// 136:d=4 hl=2 l= 19 cons: SEQUENCE
// 138:d=5 hl=2 l= 3 prim: OBJECT :organizationalUnitName
// 143:d=5 hl=2 l= 12 prim: PRINTABLESTRING :Client CA v1
-const uint8 VARIABLE_IS_NOT_USED MITDN[] = {
- 0x30, 0x6C, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
- 0x02, 0x55, 0x53, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x08,
- 0x13, 0x0D, 0x4D, 0x61, 0x73, 0x73, 0x61, 0x63, 0x68, 0x75, 0x73, 0x65,
- 0x74, 0x74, 0x73, 0x31, 0x2E, 0x30, 0x2C, 0x06, 0x03, 0x55, 0x04, 0x0A,
- 0x13, 0x25, 0x4D, 0x61, 0x73, 0x73, 0x61, 0x63, 0x68, 0x75, 0x73, 0x65,
- 0x74, 0x74, 0x73, 0x20, 0x49, 0x6E, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74,
- 0x65, 0x20, 0x6F, 0x66, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C,
- 0x6F, 0x67, 0x79, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0B,
- 0x13, 0x0C, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20, 0x43, 0x41, 0x20,
- 0x76, 0x31
-};
+const uint8_t VARIABLE_IS_NOT_USED MITDN[] = {
+ 0x30, 0x6C, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
+ 0x13, 0x02, 0x55, 0x53, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55,
+ 0x04, 0x08, 0x13, 0x0D, 0x4D, 0x61, 0x73, 0x73, 0x61, 0x63, 0x68,
+ 0x75, 0x73, 0x65, 0x74, 0x74, 0x73, 0x31, 0x2E, 0x30, 0x2C, 0x06,
+ 0x03, 0x55, 0x04, 0x0A, 0x13, 0x25, 0x4D, 0x61, 0x73, 0x73, 0x61,
+ 0x63, 0x68, 0x75, 0x73, 0x65, 0x74, 0x74, 0x73, 0x20, 0x49, 0x6E,
+ 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x6F, 0x66, 0x20,
+ 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x79, 0x31,
+ 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x13, 0x0C, 0x43,
+ 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20, 0x43, 0x41, 0x20, 0x76, 0x31};
} // namespace
diff --git a/net/test/url_request/ssl_certificate_error_job.cc b/net/test/url_request/ssl_certificate_error_job.cc
index 8f2a12b..83e7fd0c 100644
--- a/net/test/url_request/ssl_certificate_error_job.cc
+++ b/net/test/url_request/ssl_certificate_error_job.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/bind.h"
+#include "base/macros.h"
#include "base/strings/stringprintf.h"
#include "base/thread_task_runner_handle.h"
#include "net/ssl/ssl_info.h"
diff --git a/net/test/url_request/url_request_failed_job.h b/net/test/url_request/url_request_failed_job.h
index 45b1911..72518f7 100644
--- a/net/test/url_request/url_request_failed_job.h
+++ b/net/test/url_request/url_request_failed_job.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/url_request/url_request_job.h"
#include "url/gurl.h"
diff --git a/net/test/url_request/url_request_mock_data_job.cc b/net/test/url_request/url_request_mock_data_job.cc
index 3b3f9d3..8c67dc5 100644
--- a/net/test/url_request/url_request_mock_data_job.cc
+++ b/net/test/url_request/url_request_mock_data_job.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
diff --git a/net/test/url_request/url_request_mock_data_job.h b/net/test/url_request/url_request_mock_data_job.h
index 91189ba..ae33dd7d 100644
--- a/net/test/url_request/url_request_mock_data_job.h
+++ b/net/test/url_request/url_request_mock_data_job.h
@@ -5,6 +5,8 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_MOCK_DATA_JOB_H_
#define NET_URL_REQUEST_URL_REQUEST_MOCK_DATA_JOB_H_
+#include <stddef.h>
+
#include <string>
#include "base/memory/weak_ptr.h"
diff --git a/net/test/url_request/url_request_slow_download_job.cc b/net/test/url_request/url_request_slow_download_job.cc
index 52fd71c..ac4beb0 100644
--- a/net/test/url_request/url_request_slow_download_job.cc
+++ b/net/test/url_request/url_request_slow_download_job.cc
@@ -8,6 +8,7 @@
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
diff --git a/net/test/url_request/url_request_slow_download_job.h b/net/test/url_request/url_request_slow_download_job.h
index fcd7f661b..5ab4ccd 100644
--- a/net/test/url_request/url_request_slow_download_job.h
+++ b/net/test/url_request/url_request_slow_download_job.h
@@ -8,6 +8,8 @@
#ifndef NET_TEST_URL_REQUEST_URL_REQUEST_SLOW_DOWNLOAD_JOB_H_
#define NET_TEST_URL_REQUEST_URL_REQUEST_SLOW_DOWNLOAD_JOB_H_
+#include <stddef.h>
+
#include <set>
#include <string>
diff --git a/net/third_party/mozilla_security_manager/nsPKCS12Blob.h b/net/third_party/mozilla_security_manager/nsPKCS12Blob.h
index a2f2a49..1a87c060 100644
--- a/net/third_party/mozilla_security_manager/nsPKCS12Blob.h
+++ b/net/third_party/mozilla_security_manager/nsPKCS12Blob.h
@@ -38,6 +38,8 @@
#ifndef NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_
#define NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
diff --git a/net/tools/balsa/balsa_frame.cc b/net/tools/balsa/balsa_frame.cc
index cbd11ba..8505ac1 100644
--- a/net/tools/balsa/balsa_frame.cc
+++ b/net/tools/balsa/balsa_frame.cc
@@ -405,7 +405,7 @@
return false;
}
size_t status_code_x_10 = headers->parsed_response_code_ * 10;
- uint8 c = *parsed_response_code_current - '0';
+ uint8_t c = *parsed_response_code_current - '0';
if ((headers->parsed_response_code_ > kMaxDiv10) ||
(std::numeric_limits<size_t>::max() - status_code_x_10) < c) {
// overflow.
diff --git a/net/tools/balsa/balsa_frame.h b/net/tools/balsa/balsa_frame.h
index 27f27ea..97025dd 100644
--- a/net/tools/balsa/balsa_frame.h
+++ b/net/tools/balsa/balsa_frame.h
@@ -5,6 +5,9 @@
#ifndef NET_TOOLS_BALSA_BALSA_FRAME_H_
#define NET_TOOLS_BALSA_BALSA_FRAME_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <utility>
#include <vector>
@@ -34,16 +37,10 @@
// TODO(fenix): get rid of the 'kValidTerm*' stuff by using the 'since last
// index' strategy. Note that this implies getting rid of the HeaderFramed()
- static const uint32 kValidTerm1 = '\n' << 16 |
- '\r' << 8 |
- '\n';
- static const uint32 kValidTerm1Mask = 0xFF << 16 |
- 0xFF << 8 |
- 0xFF;
- static const uint32 kValidTerm2 = '\n' << 8 |
- '\n';
- static const uint32 kValidTerm2Mask = 0xFF << 8 |
- 0xFF;
+ static const uint32_t kValidTerm1 = '\n' << 16 | '\r' << 8 | '\n';
+ static const uint32_t kValidTerm1Mask = 0xFF << 16 | 0xFF << 8 | 0xFF;
+ static const uint32_t kValidTerm2 = '\n' << 8 | '\n';
+ static const uint32_t kValidTerm2Mask = 0xFF << 8 | 0xFF;
BalsaFrame();
~BalsaFrame();
@@ -245,7 +242,7 @@
const char* last_slash_n_loc_;
const char* last_recorded_slash_n_loc_;
size_t last_slash_n_idx_;
- uint32 term_chars_;
+ uint32_t term_chars_;
BalsaFrameEnums::ParseState parse_state_;
BalsaFrameEnums::ErrorCode last_error_;
diff --git a/net/tools/balsa/balsa_headers.h b/net/tools/balsa/balsa_headers.h
index 3fc01c4c..a67e743 100644
--- a/net/tools/balsa/balsa_headers.h
+++ b/net/tools/balsa/balsa_headers.h
@@ -5,6 +5,8 @@
#ifndef NET_TOOLS_BALSA_BALSA_HEADERS_H_
#define NET_TOOLS_BALSA_BALSA_HEADERS_H_
+#include <stddef.h>
+
#include <algorithm>
#include <iosfwd>
#include <iterator>
diff --git a/net/tools/balsa/noop_balsa_visitor.h b/net/tools/balsa/noop_balsa_visitor.h
index 89e97194..0e0c04a 100644
--- a/net/tools/balsa/noop_balsa_visitor.h
+++ b/net/tools/balsa/noop_balsa_visitor.h
@@ -9,6 +9,9 @@
#ifndef NET_TOOLS_BALSA_NOOP_BALSA_VISITOR_H_
#define NET_TOOLS_BALSA_NOOP_BALSA_VISITOR_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/tools/balsa/balsa_visitor_interface.h"
namespace net {
diff --git a/net/tools/balsa/simple_buffer.h b/net/tools/balsa/simple_buffer.h
index d914ec58..7cc1e16 100644
--- a/net/tools/balsa/simple_buffer.h
+++ b/net/tools/balsa/simple_buffer.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/tools/balsa/buffer_interface.h"
namespace net {
diff --git a/net/tools/balsa/string_piece_utils.h b/net/tools/balsa/string_piece_utils.h
index 6d8967a..ccc9d527 100644
--- a/net/tools/balsa/string_piece_utils.h
+++ b/net/tools/balsa/string_piece_utils.h
@@ -5,6 +5,8 @@
#ifndef NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_
#define NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_
+#include <stddef.h>
+
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
diff --git a/net/tools/disk_cache_memory_test/disk_cache_memory_test.cc b/net/tools/disk_cache_memory_test/disk_cache_memory_test.cc
index 1b29f24a..bcf5412 100644
--- a/net/tools/disk_cache_memory_test/disk_cache_memory_test.cc
+++ b/net/tools/disk_cache_memory_test/disk_cache_memory_test.cc
@@ -161,7 +161,7 @@
// only if parsing succeeded.
bool ParseRangeProperty(const std::string& line,
std::vector<std::string>* tokens,
- uint64* size,
+ uint64_t* size,
bool* is_private_dirty) {
*tokens = base::SplitString(line, base::kWhitespaceASCII,
base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
@@ -182,7 +182,7 @@
return true;
}
const std::string& size_str = (*tokens)[1];
- uint64 map_size = 0;
+ uint64_t map_size = 0;
if (!base::StringToUint64(size_str, &map_size))
return true;
*is_private_dirty = true;
@@ -190,7 +190,7 @@
return true;
}
-uint64 GetMemoryConsumption() {
+uint64_t GetMemoryConsumption() {
std::ifstream maps_file(
base::StringPrintf("/proc/%d/smaps", getpid()).c_str());
if (!maps_file.good()) {
@@ -199,7 +199,7 @@
}
std::string line;
std::vector<std::string> tokens;
- uint64 total_size = 0;
+ uint64_t total_size = 0;
if (!std::getline(maps_file, line) || line.empty())
return total_size;
while (true) {
@@ -210,7 +210,7 @@
if (!std::getline(maps_file, line) || line.empty())
return total_size;
bool is_private_dirty = false;
- uint64 size = 0;
+ uint64_t size = 0;
while (ParseRangeProperty(line, &tokens, &size, &is_private_dirty)) {
if (is_anonymous_read_write && is_private_dirty) {
total_size += size;
@@ -233,7 +233,7 @@
<< backend->GetEntryCount() << std::endl;
backends.push_back(std::move(backend));
}
- const uint64 memory_consumption = GetMemoryConsumption();
+ const uint64_t memory_consumption = GetMemoryConsumption();
std::cout << "Private dirty memory: " << memory_consumption << " kB"
<< std::endl;
return true;
diff --git a/net/tools/dump_cache/dump_files.cc b/net/tools/dump_cache/dump_files.cc
index 8c7434e..691c0854 100644
--- a/net/tools/dump_cache/dump_files.cc
+++ b/net/tools/dump_cache/dump_files.cc
@@ -18,6 +18,7 @@
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/format_macros.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -73,13 +74,13 @@
if (!file)
return;
- size_t length = (2 + disk_cache::Stats::kDataSizesLength) * sizeof(int32) +
- disk_cache::Stats::MAX_COUNTER * sizeof(int64);
+ size_t length = (2 + disk_cache::Stats::kDataSizesLength) * sizeof(int32_t) +
+ disk_cache::Stats::MAX_COUNTER * sizeof(int64_t);
size_t offset = address.start_block() * address.BlockSize() +
disk_cache::kBlockHeaderSize;
- scoped_ptr<int32[]> buffer(new int32[length]);
+ scoped_ptr<int32_t[]> buffer(new int32_t[length]);
if (!file->Read(buffer.get(), length, offset))
return;
@@ -88,8 +89,8 @@
for (int i = 0; i < disk_cache::Stats::kDataSizesLength; i++)
printf("Size(%d): %d\n", i, buffer[i + 2]);
- int64* counters = reinterpret_cast<int64*>(
- buffer.get() + 2 + disk_cache::Stats::kDataSizesLength);
+ int64_t* counters = reinterpret_cast<int64_t*>(
+ buffer.get() + 2 + disk_cache::Stats::kDataSizesLength);
for (int i = 0; i < disk_cache::Stats::MAX_COUNTER; i++)
printf("Count(%d): %" PRId64 "\n", i, *counters++);
printf("-------------------------\n\n");
@@ -306,7 +307,7 @@
return true;
}
-std::string ToLocalTime(int64 time_us) {
+std::string ToLocalTime(int64_t time_us) {
base::Time time = base::Time::FromInternalValue(time_us);
base::Time::Exploded e;
time.LocalExplode(&e);
@@ -490,7 +491,7 @@
const int kMaxLength = 1 * 1000 * 1000;
for (int i = 0; i < 5; i++) {
- int32 size = header.lru.sizes[i];
+ int32_t size = header.lru.sizes[i];
if (size < 0 || size > kMaxLength) {
printf("Wrong size %d\n", size);
size = kMaxLength;
diff --git a/net/tools/epoll_server/epoll_server.cc b/net/tools/epoll_server/epoll_server.cc
index 1933b99..7aec113 100644
--- a/net/tools/epoll_server/epoll_server.cc
+++ b/net/tools/epoll_server/epoll_server.cc
@@ -361,23 +361,23 @@
// long-running alarms might install other long-running
// alarms, etc. By storing it here now, we ensure that
// a more reasonable amount of work is done here.
- int64 now_in_us = NowInUsec();
+ int64_t now_in_us = NowInUsec();
// Get the first timeout from the alarm_map where it is
// stored in absolute time.
- int64 next_alarm_time_in_us = alarm_map_.begin()->first;
+ int64_t next_alarm_time_in_us = alarm_map_.begin()->first;
VLOG(4) << "next_alarm_time = " << next_alarm_time_in_us
<< " now = " << now_in_us
<< " timeout_in_us = " << timeout_in_us_;
- int64 wait_time_in_us;
- int64 alarm_timeout_in_us = next_alarm_time_in_us - now_in_us;
+ int64_t wait_time_in_us;
+ int64_t alarm_timeout_in_us = next_alarm_time_in_us - now_in_us;
// If the next alarm is sooner than the default timeout, or if there is no
// timeout (timeout_in_us_ == -1), wake up when the alarm should fire.
// Otherwise use the default timeout.
if (alarm_timeout_in_us < timeout_in_us_ || timeout_in_us_ < 0) {
- wait_time_in_us = std::max(alarm_timeout_in_us, static_cast<int64>(0));
+ wait_time_in_us = std::max(alarm_timeout_in_us, static_cast<int64_t>(0));
} else {
wait_time_in_us = timeout_in_us_;
}
@@ -440,7 +440,7 @@
CHECK_EQ(ready_list_size_, count) << "Ready list size does not match count";
}
-void EpollServer::RegisterAlarm(int64 timeout_time_in_us, AlarmCB* ac) {
+void EpollServer::RegisterAlarm(int64_t timeout_time_in_us, AlarmCB* ac) {
CHECK(ac);
if (ContainsKey(all_alarms_, ac)) {
LOG(FATAL) << "Alarm already exists " << ac;
@@ -476,11 +476,11 @@
DCHECK_EQ(rv, 1);
}
-int64 EpollServer::NowInUsec() const {
+int64_t EpollServer::NowInUsec() const {
return (base::Time::Now() - base::Time::UnixEpoch()).InMicroseconds();
}
-int64 EpollServer::ApproximateNowInUsec() const {
+int64_t EpollServer::ApproximateNowInUsec() const {
if (recorded_now_in_us_ != 0) {
return recorded_now_in_us_;
}
@@ -612,7 +612,7 @@
}
}
-void EpollServer::WaitForEventsAndCallHandleEvents(int64 timeout_in_us,
+void EpollServer::WaitForEventsAndCallHandleEvents(int64_t timeout_in_us,
struct epoll_event events[],
int events_size) {
if (timeout_in_us == 0 || ready_list_.lh_first != NULL) {
@@ -716,7 +716,7 @@
}
void EpollServer::CallAndReregisterAlarmEvents() {
- int64 now_in_us = recorded_now_in_us_;
+ int64_t now_in_us = recorded_now_in_us_;
DCHECK_NE(0, recorded_now_in_us_);
TimeToAlarmCBMap::iterator erase_it;
@@ -739,7 +739,7 @@
continue;
}
all_alarms_.erase(cb);
- const int64 new_timeout_time_in_us = cb->OnAlarm();
+ const int64_t new_timeout_time_in_us = cb->OnAlarm();
erase_it = i;
++i;
@@ -770,7 +770,7 @@
UnregisterIfRegistered();
}
-int64 EpollAlarm::OnAlarm() {
+int64_t EpollAlarm::OnAlarm() {
registered_ = false;
return 0;
}
diff --git a/net/tools/epoll_server/epoll_server.h b/net/tools/epoll_server/epoll_server.h
index 4293362..460db3d 100644
--- a/net/tools/epoll_server/epoll_server.h
+++ b/net/tools/epoll_server/epoll_server.h
@@ -6,7 +6,10 @@
#define NET_TOOLS_EPOLL_SERVER_EPOLL_SERVER_H_
#include <fcntl.h>
+#include <stddef.h>
+#include <stdint.h>
#include <sys/queue.h>
+
#include <map>
#include <string>
#include <vector>
@@ -30,9 +33,9 @@
#include "base/logging.h"
#endif
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include <sys/epoll.h>
@@ -120,7 +123,7 @@
typedef EpollAlarmCallbackInterface AlarmCB;
typedef EpollCallbackInterface CB;
- typedef std::multimap<int64, AlarmCB*> TimeToAlarmCBMap;
+ typedef std::multimap<int64_t, AlarmCB*> TimeToAlarmCBMap;
typedef TimeToAlarmCBMap::iterator AlarmRegToken;
// Summary:
@@ -359,7 +362,7 @@
// Args:
// timeout_time_in_us - the absolute time at which the alarm should go off
// ac - the alarm which will be called.
- virtual void RegisterAlarm(int64 timeout_time_in_us, AlarmCB* ac);
+ virtual void RegisterAlarm(int64_t timeout_time_in_us, AlarmCB* ac);
// Summary:
// Registers an alarm 'ac' to go off at time: (ApproximateNowInUs() +
@@ -381,7 +384,7 @@
// delta_in_us - the delta in microseconds from the ApproximateTimeInUs() at
// which point the alarm should go off.
// ac - the alarm which will be called.
- void RegisterAlarmApproximateDelta(int64 delta_in_us, AlarmCB* ac) {
+ void RegisterAlarmApproximateDelta(int64_t delta_in_us, AlarmCB* ac) {
RegisterAlarm(ApproximateNowInUsec() + delta_in_us, ac);
}
@@ -414,7 +417,7 @@
// that would ensue)
// Returns:
// the current time as number of microseconds since the Unix epoch.
- virtual int64 NowInUsec() const;
+ virtual int64_t NowInUsec() const;
// Summary:
// Since calling NowInUsec() many thousands of times per
@@ -437,7 +440,7 @@
// Returns:
// the "approximate" current time as number of microseconds since the Unix
// epoch.
- virtual int64 ApproximateNowInUsec() const;
+ virtual int64_t ApproximateNowInUsec() const;
static std::string EventMaskToString(int event_mask);
@@ -459,7 +462,7 @@
// Args:
// timeout_in_us - value specified depending on behaviour desired.
// See above.
- void set_timeout_in_us(int64 timeout_in_us) {
+ void set_timeout_in_us(int64_t timeout_in_us) {
timeout_in_us_ = timeout_in_us;
}
@@ -622,12 +625,10 @@
// another callback (A) has closed a file-descriptor N, and
// the callback (B) has a newly opened file-descriptor, which
// also happens to be N.
- virtual void WaitForEventsAndCallHandleEvents(int64 timeout_in_us,
+ virtual void WaitForEventsAndCallHandleEvents(int64_t timeout_in_us,
struct epoll_event events[],
int events_size);
-
-
// Summary:
// An internal function for implementing the ready list. It adds a fd's
// CBAndEventMask to the ready list. If the fd is already on the ready
@@ -673,14 +674,14 @@
// If this is positive, wait that many microseconds.
// If this is negative, wait forever, or for the first event that occurs
// If this is zero, never wait for an event.
- int64 timeout_in_us_;
+ int64_t timeout_in_us_;
// This is nonzero only after the invocation of epoll_wait_impl within
// WaitForEventsAndCallHandleEvents and before the function
// WaitForEventsAndExecuteCallbacks returns. At all other times, this is
// zero. This enables us to have relatively accurate time returned from the
// ApproximateNowInUs() function. See that function for more details.
- int64 recorded_now_in_us_;
+ int64_t recorded_now_in_us_;
// This is used to implement CallAndReregisterAlarmEvents. This stores
// all alarms that were reregistered because OnAlarm() returned a
@@ -717,7 +718,7 @@
// Note that the definition of an 'event' is a bit 'hazy',
// as it includes the 'Unregistration' event, and perhaps
// others.
- void set_record_threshold(int64 new_threshold) {
+ void set_record_threshold(int64_t new_threshold) {
record_threshold_ = new_threshold;
}
@@ -916,8 +917,8 @@
std::vector<Events> unregistered_fds_;
typedef base::hash_map<int, Events> EventCountsMap;
EventCountsMap event_counts_;
- int64 num_records_;
- int64 record_threshold_;
+ int64_t num_records_;
+ int64_t record_threshold_;
};
void ClearEventRecords() {
@@ -968,7 +969,7 @@
// Returns:
// the unix time (in microseconds) at which this alarm should be signaled
// again, or 0 if the alarm should be removed.
- virtual int64 OnAlarm() = 0;
+ virtual int64_t OnAlarm() = 0;
// Summary:
// Called when the an alarm is registered. Invalidates an AlarmRegToken.
@@ -1012,7 +1013,7 @@
// Marks the alarm as unregistered and returns 0. The return value may be
// safely ignored by subclasses.
- int64 OnAlarm() override;
+ int64_t OnAlarm() override;
// Marks the alarm as registered, and stores the token.
void OnRegistration(const EpollServer::AlarmRegToken& token,
diff --git a/net/tools/flip_server/flip_in_mem_edsm_server.cc b/net/tools/flip_server/flip_in_mem_edsm_server.cc
index ed449f8..84735605 100644
--- a/net/tools/flip_server/flip_in_mem_edsm_server.cc
+++ b/net/tools/flip_server/flip_in_mem_edsm_server.cc
@@ -33,10 +33,10 @@
// alarm goes off when the accept_using_alarm flag is set to true.
// If set to 0, accept() will be performed until the accept queue
// is completely drained and the accept() call returns an error);
-int32 FLAGS_accepts_per_wake = 0;
+int32_t FLAGS_accepts_per_wake = 0;
// The size of the TCP accept backlog);
-int32 FLAGS_accept_backlog_size = 1024;
+int32_t FLAGS_accept_backlog_size = 1024;
// If set to false a single socket will be used. If set to true
// then a new socket will be created for each accept thread.
diff --git a/net/tools/flip_server/flip_test_utils.h b/net/tools/flip_server/flip_test_utils.h
index 0a61a60..a4eab1bb7 100644
--- a/net/tools/flip_server/flip_test_utils.h
+++ b/net/tools/flip_server/flip_test_utils.h
@@ -5,6 +5,9 @@
#ifndef NET_TOOLS_FLIP_SERVER_FLIP_TEST_UTILS_H_
#define NET_TOOLS_FLIP_SERVER_FLIP_TEST_UTILS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include "net/tools/flip_server/sm_interface.h"
@@ -18,7 +21,7 @@
MockSMInterface();
virtual ~MockSMInterface();
- MOCK_METHOD2(InitSMInterface, void(SMInterface*, int32));
+ MOCK_METHOD2(InitSMInterface, void(SMInterface*, int32_t));
MOCK_METHOD8(InitSMConnection,
void(SMConnectionPoolInterface*,
SMInterface*,
@@ -30,21 +33,22 @@
bool));
MOCK_METHOD2(ProcessReadInput, size_t(const char*, size_t));
MOCK_METHOD2(ProcessWriteInput, size_t(const char*, size_t));
- MOCK_METHOD1(SetStreamID, void(uint32 stream_id));
+ MOCK_METHOD1(SetStreamID, void(uint32_t stream_id));
MOCK_CONST_METHOD0(MessageFullyRead, bool());
MOCK_CONST_METHOD0(Error, bool());
MOCK_CONST_METHOD0(ErrorAsString, const char*());
MOCK_METHOD0(Reset, void());
- MOCK_METHOD1(ResetForNewInterface, void(int32 server_idx));
+ MOCK_METHOD1(ResetForNewInterface, void(int32_t server_idx));
MOCK_METHOD0(ResetForNewConnection, void());
MOCK_METHOD0(Cleanup, void());
MOCK_METHOD0(PostAcceptHook, int());
- MOCK_METHOD3(NewStream, void(uint32, uint32, const std::string&));
- MOCK_METHOD1(SendEOF, void(uint32 stream_id));
- MOCK_METHOD1(SendErrorNotFound, void(uint32 stream_id));
- MOCK_METHOD2(SendSynStream, size_t(uint32, const BalsaHeaders&));
- MOCK_METHOD2(SendSynReply, size_t(uint32, const BalsaHeaders&));
- MOCK_METHOD5(SendDataFrame, void(uint32, const char*, int64, uint32, bool));
+ MOCK_METHOD3(NewStream, void(uint32_t, uint32_t, const std::string&));
+ MOCK_METHOD1(SendEOF, void(uint32_t stream_id));
+ MOCK_METHOD1(SendErrorNotFound, void(uint32_t stream_id));
+ MOCK_METHOD2(SendSynStream, size_t(uint32_t, const BalsaHeaders&));
+ MOCK_METHOD2(SendSynReply, size_t(uint32_t, const BalsaHeaders&));
+ MOCK_METHOD5(SendDataFrame,
+ void(uint32_t, const char*, int64_t, uint32_t, bool));
MOCK_METHOD0(GetOutput, void());
MOCK_METHOD0(set_is_request, void());
};
diff --git a/net/tools/flip_server/http_interface.cc b/net/tools/flip_server/http_interface.cc
index 576e912b..dab0a5b4 100644
--- a/net/tools/flip_server/http_interface.cc
+++ b/net/tools/flip_server/http_interface.cc
@@ -87,7 +87,8 @@
output_ordering_.AddToOutputOrder(mci);
}
-void HttpSM::InitSMInterface(SMInterface* sm_spdy_interface, int32 server_idx) {
+void HttpSM::InitSMInterface(SMInterface* sm_spdy_interface,
+ int32_t server_idx) {
sm_spdy_interface_ = sm_spdy_interface;
server_idx_ = server_idx;
}
@@ -135,7 +136,9 @@
return http_framer_->MessageFullyRead();
}
-void HttpSM::SetStreamID(uint32 stream_id) { stream_id_ = stream_id; }
+void HttpSM::SetStreamID(uint32_t stream_id) {
+ stream_id_ = stream_id;
+}
bool HttpSM::Error() const { return http_framer_->Error(); }
@@ -177,8 +180,8 @@
int HttpSM::PostAcceptHook() { return 1; }
-void HttpSM::NewStream(uint32 stream_id,
- uint32 priority,
+void HttpSM::NewStream(uint32_t stream_id,
+ uint32_t priority,
const std::string& filename) {
MemCacheIter mci;
mci.stream_id = stream_id;
@@ -192,34 +195,34 @@
}
}
-void HttpSM::SendEOF(uint32 stream_id) {
+void HttpSM::SendEOF(uint32_t stream_id) {
SendEOFImpl(stream_id);
if (acceptor_->flip_handler_type_ == FLIP_HANDLER_PROXY) {
sm_spdy_interface_->ResetForNewInterface(server_idx_);
}
}
-void HttpSM::SendErrorNotFound(uint32 stream_id) {
+void HttpSM::SendErrorNotFound(uint32_t stream_id) {
SendErrorNotFoundImpl(stream_id);
}
-size_t HttpSM::SendSynStream(uint32 stream_id, const BalsaHeaders& headers) {
+size_t HttpSM::SendSynStream(uint32_t stream_id, const BalsaHeaders& headers) {
return 0;
}
-size_t HttpSM::SendSynReply(uint32 stream_id, const BalsaHeaders& headers) {
+size_t HttpSM::SendSynReply(uint32_t stream_id, const BalsaHeaders& headers) {
return SendSynReplyImpl(stream_id, headers);
}
-void HttpSM::SendDataFrame(uint32 stream_id,
+void HttpSM::SendDataFrame(uint32_t stream_id,
const char* data,
- int64 len,
- uint32 flags,
+ int64_t len,
+ uint32_t flags,
bool compress) {
SendDataFrameImpl(stream_id, data, len, flags, compress);
}
-void HttpSM::SendEOFImpl(uint32 stream_id) {
+void HttpSM::SendEOFImpl(uint32_t stream_id) {
DataFrame* df = new DataFrame;
df->data = "0\r\n\r\n";
df->size = 5;
@@ -230,7 +233,7 @@
}
}
-void HttpSM::SendErrorNotFoundImpl(uint32 stream_id) {
+void HttpSM::SendErrorNotFoundImpl(uint32_t stream_id) {
BalsaHeaders my_headers;
my_headers.SetFirstlineFromStringPieces("HTTP/1.1", "404", "Not Found");
my_headers.RemoveAllOfHeader("content-length");
@@ -241,7 +244,8 @@
output_ordering_.RemoveStreamId(stream_id);
}
-size_t HttpSM::SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers) {
+size_t HttpSM::SendSynReplyImpl(uint32_t stream_id,
+ const BalsaHeaders& headers) {
SimpleBuffer sb;
headers.WriteHeaderAndEndingToBuffer(&sb);
DataFrame* df = new DataFrame;
@@ -257,7 +261,7 @@
return df_size;
}
-size_t HttpSM::SendSynStreamImpl(uint32 stream_id,
+size_t HttpSM::SendSynStreamImpl(uint32_t stream_id,
const BalsaHeaders& headers) {
SimpleBuffer sb;
headers.WriteHeaderAndEndingToBuffer(&sb);
@@ -274,10 +278,10 @@
return df_size;
}
-void HttpSM::SendDataFrameImpl(uint32 stream_id,
+void HttpSM::SendDataFrameImpl(uint32_t stream_id,
const char* data,
- int64 len,
- uint32 flags,
+ int64_t len,
+ uint32_t flags,
bool compress) {
char chunk_buf[128];
snprintf(chunk_buf, sizeof(chunk_buf), "%x\r\n", (unsigned int)len);
diff --git a/net/tools/flip_server/http_interface.h b/net/tools/flip_server/http_interface.h
index c6dc978b..56758f4 100644
--- a/net/tools/flip_server/http_interface.h
+++ b/net/tools/flip_server/http_interface.h
@@ -5,6 +5,9 @@
#ifndef NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_
#define NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include "base/compiler_specific.h"
@@ -72,7 +75,7 @@
// SMInterface:
void InitSMInterface(SMInterface* sm_spdy_interface,
- int32 server_idx) override;
+ int32_t server_idx) override;
void InitSMConnection(SMConnectionPoolInterface* connection_pool,
SMInterface* sm_interface,
EpollServer* epoll_server,
@@ -84,38 +87,39 @@
size_t ProcessReadInput(const char* data, size_t len) override;
size_t ProcessWriteInput(const char* data, size_t len) override;
bool MessageFullyRead() const override;
- void SetStreamID(uint32 stream_id) override;
+ void SetStreamID(uint32_t stream_id) override;
bool Error() const override;
const char* ErrorAsString() const override;
void Reset() override;
- void ResetForNewInterface(int32 server_idx) override {}
+ void ResetForNewInterface(int32_t server_idx) override {}
void ResetForNewConnection() override;
void Cleanup() override;
int PostAcceptHook() override;
- void NewStream(uint32 stream_id,
- uint32 priority,
+ void NewStream(uint32_t stream_id,
+ uint32_t priority,
const std::string& filename) override;
- void SendEOF(uint32 stream_id) override;
- void SendErrorNotFound(uint32 stream_id) override;
- size_t SendSynStream(uint32 stream_id, const BalsaHeaders& headers) override;
- size_t SendSynReply(uint32 stream_id, const BalsaHeaders& headers) override;
- void SendDataFrame(uint32 stream_id,
+ void SendEOF(uint32_t stream_id) override;
+ void SendErrorNotFound(uint32_t stream_id) override;
+ size_t SendSynStream(uint32_t stream_id,
+ const BalsaHeaders& headers) override;
+ size_t SendSynReply(uint32_t stream_id, const BalsaHeaders& headers) override;
+ void SendDataFrame(uint32_t stream_id,
const char* data,
- int64 len,
- uint32 flags,
+ int64_t len,
+ uint32_t flags,
bool compress) override;
private:
- void SendEOFImpl(uint32 stream_id);
- void SendErrorNotFoundImpl(uint32 stream_id);
- void SendOKResponseImpl(uint32 stream_id, const std::string& output);
- size_t SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers);
- size_t SendSynStreamImpl(uint32 stream_id, const BalsaHeaders& headers);
- void SendDataFrameImpl(uint32 stream_id,
+ void SendEOFImpl(uint32_t stream_id);
+ void SendErrorNotFoundImpl(uint32_t stream_id);
+ void SendOKResponseImpl(uint32_t stream_id, const std::string& output);
+ size_t SendSynReplyImpl(uint32_t stream_id, const BalsaHeaders& headers);
+ size_t SendSynStreamImpl(uint32_t stream_id, const BalsaHeaders& headers);
+ void SendDataFrameImpl(uint32_t stream_id,
const char* data,
- int64 len,
- uint32 flags,
+ int64_t len,
+ uint32_t flags,
bool compress);
void EnqueueDataFrame(DataFrame* df);
void GetOutput() override;
@@ -123,8 +127,8 @@
private:
BalsaFrame* http_framer_;
BalsaHeaders headers_;
- uint32 stream_id_;
- int32 server_idx_;
+ uint32_t stream_id_;
+ int32_t server_idx_;
SMConnection* connection_;
SMInterface* sm_spdy_interface_;
diff --git a/net/tools/flip_server/http_interface_test.cc b/net/tools/flip_server/http_interface_test.cc
index 6d07840b..34b2390 100644
--- a/net/tools/flip_server/http_interface_test.cc
+++ b/net/tools/flip_server/http_interface_test.cc
@@ -95,7 +95,7 @@
STLDeleteElements(connection_->output_list());
}
- bool HasStream(uint32 stream_id) {
+ bool HasStream(uint32_t stream_id) {
return interface_->output_ordering().ExistsInPriorityMaps(stream_id);
}
@@ -131,7 +131,7 @@
}
TEST_F(FlipHttpSMTest, AddToOutputOrder) {
- uint32 stream_id = 13;
+ uint32_t stream_id = 13;
MemCacheIter mci;
mci.stream_id = stream_id;
@@ -254,7 +254,7 @@
}
TEST_F(FlipHttpSMTest, NewStream) {
- uint32 stream_id = 4;
+ uint32_t stream_id = 4;
{
BalsaHeaders headers;
std::string filename = "foobar";
@@ -270,7 +270,7 @@
"HTTP/1.1 404 Not Found\r\n"
"transfer-encoding: chunked\r\n\r\n";
std::string body = "e\r\npage not found\r\n";
- uint32 stream_id = 4;
+ uint32_t stream_id = 4;
ASSERT_FALSE(HasStream(stream_id));
interface_->NewStream(stream_id, 1, "foobar");
@@ -291,7 +291,7 @@
"HTTP/1.1 404 Not Found\r\n"
"transfer-encoding: chunked\r\n\r\n";
std::string body = "e\r\npage not found\r\n";
- uint32 stream_id = 13;
+ uint32_t stream_id = 13;
MemCacheIter mci;
mci.stream_id = stream_id;
@@ -416,7 +416,7 @@
BalsaHeaders headers;
headers.AppendHeader("Host", "example.com");
headers.SetRequestFirstlineFromStringPieces("GET", "/path/file", "HTTP/1.0");
- uint32 stream_id = 133;
+ uint32_t stream_id = 133;
interface_->SetStreamID(stream_id);
ASSERT_FALSE(HasStream(stream_id));
visitor->ProcessHeaders(headers);
diff --git a/net/tools/flip_server/mem_cache.h b/net/tools/flip_server/mem_cache.h
index 6d311b2b..d35322a 100644
--- a/net/tools/flip_server/mem_cache.h
+++ b/net/tools/flip_server/mem_cache.h
@@ -5,10 +5,14 @@
#ifndef NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_
#define NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
#include <string>
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/tools/balsa/balsa_headers.h"
#include "net/tools/balsa/balsa_visitor_interface.h"
@@ -103,8 +107,8 @@
int priority;
bool transformed_header;
size_t body_bytes_consumed;
- uint32 stream_id;
- uint32 max_segment_size;
+ uint32_t stream_id;
+ uint32_t max_segment_size;
size_t bytes_sent;
};
diff --git a/net/tools/flip_server/output_ordering.cc b/net/tools/flip_server/output_ordering.cc
index 9659954..f378a87 100644
--- a/net/tools/flip_server/output_ordering.cc
+++ b/net/tools/flip_server/output_ordering.cc
@@ -41,7 +41,7 @@
first_data_senders_.clear();
}
-bool OutputOrdering::ExistsInPriorityMaps(uint32 stream_id) const {
+bool OutputOrdering::ExistsInPriorityMaps(uint32_t stream_id) const {
StreamIdToPriorityMap::const_iterator sitpmi = stream_ids_.find(stream_id);
return sitpmi != stream_ids_.end();
}
@@ -57,7 +57,7 @@
epoll_server_->UnregisterAlarm(pmp_->alarm_token);
}
-int64 OutputOrdering::BeginOutputtingAlarm::OnAlarm() {
+int64_t OutputOrdering::BeginOutputtingAlarm::OnAlarm() {
OnUnregistration();
output_ordering_->MoveToActive(pmp_, mci_);
VLOG(2) << "ON ALARM! Should now start to output...";
@@ -110,8 +110,9 @@
}
}
StreamIdToPriorityMap::iterator sitpmi;
- sitpmi = stream_ids_.insert(std::pair<uint32, PriorityMapPointer>(
- mci.stream_id, PriorityMapPointer())).first;
+ sitpmi = stream_ids_.insert(std::pair<uint32_t, PriorityMapPointer>(
+ mci.stream_id, PriorityMapPointer()))
+ .first;
PriorityMapPointer& pmp = sitpmi->second;
BeginOutputtingAlarm* boa = new BeginOutputtingAlarm(this, &pmp, mci);
@@ -123,8 +124,9 @@
MemCacheIter& mci = *pri;
PriorityMap::iterator pmi = priority_map_.find(mci.priority);
if (pmi == priority_map_.end()) {
- pmi = priority_map_.insert(std::pair<uint32, PriorityRing>(
- mci.priority, PriorityRing())).first;
+ pmi = priority_map_.insert(std::pair<uint32_t, PriorityRing>(
+ mci.priority, PriorityRing()))
+ .first;
}
pmi->second.splice(pmi->second.end(), first_data_senders_, pri);
@@ -159,7 +161,7 @@
return NULL;
}
-void OutputOrdering::RemoveStreamId(uint32 stream_id) {
+void OutputOrdering::RemoveStreamId(uint32_t stream_id) {
StreamIdToPriorityMap::iterator sitpmi = stream_ids_.find(stream_id);
if (sitpmi == stream_ids_.end())
return;
diff --git a/net/tools/flip_server/output_ordering.h b/net/tools/flip_server/output_ordering.h
index 82cbfd2..3641460 100644
--- a/net/tools/flip_server/output_ordering.h
+++ b/net/tools/flip_server/output_ordering.h
@@ -5,11 +5,12 @@
#ifndef NET_TOOLS_FLIP_SERVER_OUTPUT_ORDERING_H_
#define NET_TOOLS_FLIP_SERVER_OUTPUT_ORDERING_H_
+#include <stdint.h>
+
#include <list>
#include <map>
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "net/tools/epoll_server/epoll_server.h"
#include "net/tools/flip_server/constants.h"
@@ -22,7 +23,7 @@
class OutputOrdering {
public:
typedef std::list<MemCacheIter> PriorityRing;
- typedef std::map<uint32, PriorityRing> PriorityMap;
+ typedef std::map<uint32_t, PriorityRing> PriorityMap;
struct PriorityMapPointer {
PriorityMapPointer();
@@ -33,20 +34,20 @@
EpollServer::AlarmRegToken alarm_token;
};
- typedef std::map<uint32, PriorityMapPointer> StreamIdToPriorityMap;
+ typedef std::map<uint32_t, PriorityMapPointer> StreamIdToPriorityMap;
StreamIdToPriorityMap stream_ids_;
PriorityMap priority_map_;
PriorityRing first_data_senders_;
- uint32 first_data_senders_threshold_; // when you've passed this, you're no
- // longer a first_data_sender...
+ uint32_t first_data_senders_threshold_; // when you've passed this, you're no
+ // longer a first_data_sender...
SMConnectionInterface* connection_;
EpollServer* epoll_server_;
explicit OutputOrdering(SMConnectionInterface* connection);
~OutputOrdering();
void Reset();
- bool ExistsInPriorityMaps(uint32 stream_id) const;
+ bool ExistsInPriorityMaps(uint32_t stream_id) const;
struct BeginOutputtingAlarm : public EpollAlarmCallbackInterface {
public:
@@ -56,7 +57,7 @@
~BeginOutputtingAlarm() override;
// EpollAlarmCallbackInterface:
- int64 OnAlarm() override;
+ int64_t OnAlarm() override;
void OnRegistration(const EpollServer::AlarmRegToken& tok,
EpollServer* eps) override;
void OnUnregistration() override;
@@ -73,7 +74,7 @@
void AddToOutputOrder(const MemCacheIter& mci);
void SpliceToPriorityRing(PriorityRing::iterator pri);
MemCacheIter* GetIter();
- void RemoveStreamId(uint32 stream_id);
+ void RemoveStreamId(uint32_t stream_id);
static double server_think_time_in_s() { return server_think_time_in_s_; }
static void set_server_think_time_in_s(double value) {
diff --git a/net/tools/flip_server/sm_connection.h b/net/tools/flip_server/sm_connection.h
index af94d6d1..b586a18 100644
--- a/net/tools/flip_server/sm_connection.h
+++ b/net/tools/flip_server/sm_connection.h
@@ -6,6 +6,7 @@
#define NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_
#include <arpa/inet.h> // in_addr_t
+#include <stddef.h>
#include <time.h>
#include <list>
diff --git a/net/tools/flip_server/sm_interface.h b/net/tools/flip_server/sm_interface.h
index 389c6836..bf2bc5ed 100644
--- a/net/tools/flip_server/sm_interface.h
+++ b/net/tools/flip_server/sm_interface.h
@@ -7,6 +7,9 @@
// State Machine Interfaces
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include "net/tools/balsa/balsa_headers.h"
@@ -20,7 +23,7 @@
class SMInterface {
public:
virtual void InitSMInterface(SMInterface* sm_other_interface,
- int32 server_idx) = 0;
+ int32_t server_idx) = 0;
virtual void InitSMConnection(SMConnectionPoolInterface* connection_pool,
SMInterface* sm_interface,
EpollServer* epoll_server,
@@ -31,12 +34,12 @@
bool use_ssl) = 0;
virtual size_t ProcessReadInput(const char* data, size_t len) = 0;
virtual size_t ProcessWriteInput(const char* data, size_t len) = 0;
- virtual void SetStreamID(uint32 stream_id) = 0;
+ virtual void SetStreamID(uint32_t stream_id) = 0;
virtual bool MessageFullyRead() const = 0;
virtual bool Error() const = 0;
virtual const char* ErrorAsString() const = 0;
virtual void Reset() = 0;
- virtual void ResetForNewInterface(int32 server_idx) = 0;
+ virtual void ResetForNewInterface(int32_t server_idx) = 0;
// ResetForNewConnection is used for interfaces which control SMConnection
// objects. When called an interface may put its connection object into
// a reusable instance pool. Currently this is what the HttpSM interface
@@ -46,19 +49,19 @@
virtual int PostAcceptHook() = 0;
- virtual void NewStream(uint32 stream_id,
- uint32 priority,
+ virtual void NewStream(uint32_t stream_id,
+ uint32_t priority,
const std::string& filename) = 0;
- virtual void SendEOF(uint32 stream_id) = 0;
- virtual void SendErrorNotFound(uint32 stream_id) = 0;
- virtual size_t SendSynStream(uint32 stream_id,
+ virtual void SendEOF(uint32_t stream_id) = 0;
+ virtual void SendErrorNotFound(uint32_t stream_id) = 0;
+ virtual size_t SendSynStream(uint32_t stream_id,
const BalsaHeaders& headers) = 0;
- virtual size_t SendSynReply(uint32 stream_id,
+ virtual size_t SendSynReply(uint32_t stream_id,
const BalsaHeaders& headers) = 0;
- virtual void SendDataFrame(uint32 stream_id,
+ virtual void SendDataFrame(uint32_t stream_id,
const char* data,
- int64 len,
- uint32 flags,
+ int64_t len,
+ uint32_t flags,
bool compress) = 0;
virtual void GetOutput() = 0;
virtual void set_is_request() = 0;
diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc
index d21b500..30f423d6 100644
--- a/net/tools/flip_server/spdy_interface.cc
+++ b/net/tools/flip_server/spdy_interface.cc
@@ -93,7 +93,7 @@
const std::string& server_ip,
const std::string& server_port) {
SMInterface* sm_http_interface;
- int32 server_idx;
+ int32_t server_idx;
if (unused_server_interface_list.empty()) {
sm_http_interface = NewConnectionInterface();
server_idx = server_interface_list.size();
@@ -343,7 +343,7 @@
return SpdyFramer::ErrorCodeToString(buffered_spdy_framer_->error_code());
}
-void SpdySM::ResetForNewInterface(int32 server_idx) {
+void SpdySM::ResetForNewInterface(int32_t server_idx) {
VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: Reset for new interface: "
<< "server_idx: " << server_idx;
unused_server_interface_list.push_back(server_idx);
@@ -371,8 +371,8 @@
return 1;
}
-void SpdySM::NewStream(uint32 stream_id,
- uint32 priority,
+void SpdySM::NewStream(uint32_t stream_id,
+ uint32_t priority,
const std::string& filename) {
MemCacheIter mci;
mci.stream_id = stream_id;
@@ -397,37 +397,39 @@
client_output_ordering_.AddToOutputOrder(mci);
}
-void SpdySM::SendEOF(uint32 stream_id) { SendEOFImpl(stream_id); }
+void SpdySM::SendEOF(uint32_t stream_id) {
+ SendEOFImpl(stream_id);
+}
-void SpdySM::SendErrorNotFound(uint32 stream_id) {
+void SpdySM::SendErrorNotFound(uint32_t stream_id) {
SendErrorNotFoundImpl(stream_id);
}
-size_t SpdySM::SendSynStream(uint32 stream_id, const BalsaHeaders& headers) {
+size_t SpdySM::SendSynStream(uint32_t stream_id, const BalsaHeaders& headers) {
return SendSynStreamImpl(stream_id, headers);
}
-size_t SpdySM::SendSynReply(uint32 stream_id, const BalsaHeaders& headers) {
+size_t SpdySM::SendSynReply(uint32_t stream_id, const BalsaHeaders& headers) {
return SendSynReplyImpl(stream_id, headers);
}
-void SpdySM::SendDataFrame(uint32 stream_id,
+void SpdySM::SendDataFrame(uint32_t stream_id,
const char* data,
- int64 len,
- uint32 flags,
+ int64_t len,
+ uint32_t flags,
bool compress) {
SpdyDataFlags spdy_flags = static_cast<SpdyDataFlags>(flags);
SendDataFrameImpl(stream_id, data, len, spdy_flags, compress);
}
-void SpdySM::SendEOFImpl(uint32 stream_id) {
+void SpdySM::SendEOFImpl(uint32_t stream_id) {
SendDataFrame(stream_id, NULL, 0, DATA_FLAG_FIN, false);
VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: Sending EOF: " << stream_id;
KillStream(stream_id);
stream_to_smif_.erase(stream_id);
}
-void SpdySM::SendErrorNotFoundImpl(uint32 stream_id) {
+void SpdySM::SendErrorNotFoundImpl(uint32_t stream_id) {
BalsaHeaders my_headers;
my_headers.SetFirstlineFromStringPieces("HTTP/1.1", "404", "Not Found");
SendSynReplyImpl(stream_id, my_headers);
@@ -435,7 +437,7 @@
client_output_ordering_.RemoveStreamId(stream_id);
}
-void SpdySM::KillStream(uint32 stream_id) {
+void SpdySM::KillStream(uint32_t stream_id) {
client_output_ordering_.RemoveStreamId(stream_id);
}
@@ -466,7 +468,7 @@
dest.erase("X-Original-Url"); // TODO(mbelshe): case-sensitive
}
-size_t SpdySM::SendSynStreamImpl(uint32 stream_id,
+size_t SpdySM::SendSynStreamImpl(uint32_t stream_id,
const BalsaHeaders& headers) {
SpdyHeaderBlock block;
CopyHeaders(block, headers);
@@ -509,7 +511,8 @@
return df_size;
}
-size_t SpdySM::SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers) {
+size_t SpdySM::SendSynReplyImpl(uint32_t stream_id,
+ const BalsaHeaders& headers) {
SpdyHeaderBlock block;
CopyHeaders(block, headers);
if (spdy_version() == SPDY2) {
@@ -533,9 +536,9 @@
return df_size;
}
-void SpdySM::SendDataFrameImpl(uint32 stream_id,
+void SpdySM::SendDataFrameImpl(uint32_t stream_id,
const char* data,
- int64 len,
+ int64_t len,
SpdyDataFlags flags,
bool compress) {
DCHECK(buffered_spdy_framer_);
@@ -552,7 +555,7 @@
// Chop data frames into chunks so that one stream can't monopolize the
// output channel.
while (len > 0) {
- int64 size = std::min(len, static_cast<int64>(kSpdySegmentSize));
+ int64_t size = std::min(len, static_cast<int64_t>(kSpdySegmentSize));
SpdyDataFlags chunk_flags = flags;
// If we chunked this block, and the FIN flag was set, there is more
diff --git a/net/tools/flip_server/spdy_interface.h b/net/tools/flip_server/spdy_interface.h
index b959419..3d1cfa0a6 100644
--- a/net/tools/flip_server/spdy_interface.h
+++ b/net/tools/flip_server/spdy_interface.h
@@ -5,6 +5,9 @@
#ifndef NET_TOOLS_FLIP_SERVER_SPDY_INTERFACE_H_
#define NET_TOOLS_FLIP_SERVER_SPDY_INTERFACE_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <map>
#include <string>
#include <vector>
@@ -35,7 +38,7 @@
~SpdySM() override;
void InitSMInterface(SMInterface* sm_http_interface,
- int32 server_idx) override {}
+ int32_t server_idx) override {}
void InitSMConnection(SMConnectionPoolInterface* connection_pool,
SMInterface* sm_interface,
@@ -129,7 +132,7 @@
// Called when an individual setting within a SETTINGS frame has been parsed
// and validated.
- void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {}
+ void OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) override {}
// Called when a PING frame has been parsed.
void OnPing(SpdyPingId unique_id, bool is_ack) override {}
@@ -156,11 +159,11 @@
size_t ProcessReadInput(const char* data, size_t len) override;
size_t ProcessWriteInput(const char* data, size_t len) override;
bool MessageFullyRead() const override;
- void SetStreamID(uint32 stream_id) override {}
+ void SetStreamID(uint32_t stream_id) override {}
bool Error() const override;
const char* ErrorAsString() const override;
void Reset() override {}
- void ResetForNewInterface(int32 server_idx) override;
+ void ResetForNewInterface(int32_t server_idx) override;
void ResetForNewConnection() override;
// SMInterface's Cleanup is currently only called by SMConnection after a
// protocol message as been fully read. Spdy's SMInterface does not need
@@ -170,18 +173,19 @@
void Cleanup() override {}
// Send a settings frame
int PostAcceptHook() override;
- void NewStream(uint32 stream_id,
- uint32 priority,
+ void NewStream(uint32_t stream_id,
+ uint32_t priority,
const std::string& filename) override;
void AddToOutputOrder(const MemCacheIter& mci);
- void SendEOF(uint32 stream_id) override;
- void SendErrorNotFound(uint32 stream_id) override;
- size_t SendSynStream(uint32 stream_id, const BalsaHeaders& headers) override;
- size_t SendSynReply(uint32 stream_id, const BalsaHeaders& headers) override;
- void SendDataFrame(uint32 stream_id,
+ void SendEOF(uint32_t stream_id) override;
+ void SendErrorNotFound(uint32_t stream_id) override;
+ size_t SendSynStream(uint32_t stream_id,
+ const BalsaHeaders& headers) override;
+ size_t SendSynReply(uint32_t stream_id, const BalsaHeaders& headers) override;
+ void SendDataFrame(uint32_t stream_id,
const char* data,
- int64 len,
- uint32 flags,
+ int64_t len,
+ uint32_t flags,
bool compress) override;
BufferedSpdyFramer* spdy_framer() { return buffered_spdy_framer_.get(); }
@@ -199,15 +203,15 @@
}
private:
- void SendEOFImpl(uint32 stream_id);
- void SendErrorNotFoundImpl(uint32 stream_id);
- void KillStream(uint32 stream_id);
+ void SendEOFImpl(uint32_t stream_id);
+ void SendErrorNotFoundImpl(uint32_t stream_id);
+ void KillStream(uint32_t stream_id);
void CopyHeaders(SpdyHeaderBlock& dest, const BalsaHeaders& headers);
- size_t SendSynStreamImpl(uint32 stream_id, const BalsaHeaders& headers);
- size_t SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers);
- void SendDataFrameImpl(uint32 stream_id,
+ size_t SendSynStreamImpl(uint32_t stream_id, const BalsaHeaders& headers);
+ size_t SendSynReplyImpl(uint32_t stream_id, const BalsaHeaders& headers);
+ void SendDataFrameImpl(uint32_t stream_id,
const char* data,
- int64 len,
+ int64_t len,
SpdyDataFlags flags,
bool compress);
void EnqueueDataFrame(DataFrame* df);
@@ -222,13 +226,13 @@
SMConnection* connection_;
OutputList* client_output_list_;
OutputOrdering client_output_ordering_;
- uint32 next_outgoing_stream_id_;
+ uint32_t next_outgoing_stream_id_;
EpollServer* epoll_server_;
FlipAcceptor* acceptor_;
MemoryCache* memory_cache_;
std::vector<SMInterface*> server_interface_list;
- std::vector<int32> unused_server_interface_list;
- typedef std::map<uint32, SMInterface*> StreamToSmif;
+ std::vector<int32_t> unused_server_interface_list;
+ typedef std::map<uint32_t, SMInterface*> StreamToSmif;
StreamToSmif stream_to_smif_;
bool close_on_error_;
diff --git a/net/tools/flip_server/spdy_interface_test.cc b/net/tools/flip_server/spdy_interface_test.cc
index afea0c4..1d4c09a 100644
--- a/net/tools/flip_server/spdy_interface_test.cc
+++ b/net/tools/flip_server/spdy_interface_test.cc
@@ -76,7 +76,7 @@
MOCK_METHOD2(OnHeaderFrameEnd,
void(SpdyStreamId stream_id, bool end_headers));
MOCK_METHOD1(OnSettings, void(bool clear_persisted));
- MOCK_METHOD3(OnSetting, void(SpdySettingsIds, uint8, uint32));
+ MOCK_METHOD3(OnSetting, void(SpdySettingsIds, uint8_t, uint32_t));
MOCK_METHOD2(OnPing, void(SpdyPingId unique_id, bool is_ack));
MOCK_METHOD2(OnRstStream, void(SpdyStreamId, SpdyRstStreamStatus));
MOCK_METHOD3(OnGoAway, void(SpdyStreamId, SpdyGoAwayStatus, StringPiece));
@@ -189,7 +189,7 @@
output_list.clear();
}
- bool HasStream(uint32 stream_id) {
+ bool HasStream(uint32_t stream_id) {
return interface_->output_ordering().ExistsInPriorityMaps(stream_id);
}
@@ -231,8 +231,8 @@
TEST_P(SpdySMProxyTest, OnStreamFrameData) {
BufferedSpdyFramerVisitorInterface* visitor = interface_.get();
scoped_ptr<MockSMInterface> mock_interface(new MockSMInterface);
- uint32 stream_id = 92;
- uint32 associated_id = 43;
+ uint32_t stream_id = 92;
+ uint32_t associated_id = 43;
SpdyHeaderBlock block;
testing::MockFunction<void(int)> checkpoint; // NOLINT
@@ -261,7 +261,7 @@
TEST_P(SpdySMProxyTest, OnRstStream) {
BufferedSpdyFramerVisitorInterface* visitor = interface_.get();
- uint32 stream_id = 82;
+ uint32_t stream_id = 82;
MemCacheIter mci;
mci.stream_id = stream_id;
@@ -287,7 +287,7 @@
}
TEST_P(SpdySMProxyTest, ResetForNewConnection) {
- uint32 stream_id = 13;
+ uint32_t stream_id = 13;
MemCacheIter mci;
mci.stream_id = stream_id;
// incomplete input
@@ -346,7 +346,7 @@
}
TEST_P(SpdySMProxyTest, AddToOutputOrder) {
- uint32 stream_id = 13;
+ uint32_t stream_id = 13;
MemCacheIter mci;
mci.stream_id = stream_id;
@@ -362,7 +362,7 @@
}
TEST_P(SpdySMProxyTest, SendErrorNotFound) {
- uint32 stream_id = 82;
+ uint32_t stream_id = 82;
SpdyHeaderBlock actual_header_block;
const char* actual_data;
size_t actual_size;
@@ -410,7 +410,7 @@
}
TEST_P(SpdySMProxyTest, SendSynStream) {
- uint32 stream_id = 82;
+ uint32_t stream_id = 82;
BalsaHeaders headers;
SpdyHeaderBlock actual_header_block;
headers.AppendHeader("key1", "value1");
@@ -441,7 +441,7 @@
}
TEST_P(SpdySMProxyTest, SendSynReply) {
- uint32 stream_id = 82;
+ uint32_t stream_id = 82;
BalsaHeaders headers;
SpdyHeaderBlock actual_header_block;
headers.AppendHeader("key1", "value1");
@@ -475,7 +475,7 @@
}
TEST_P(SpdySMProxyTest, SendDataFrame) {
- uint32 stream_id = 133;
+ uint32_t stream_id = 133;
SpdyDataFlags flags = DATA_FLAG_NONE;
const char* actual_data;
size_t actual_size;
@@ -501,7 +501,7 @@
}
TEST_P(SpdySMProxyTest, SendLongDataFrame) {
- uint32 stream_id = 133;
+ uint32_t stream_id = 133;
SpdyDataFlags flags = DATA_FLAG_NONE;
const char* actual_data;
size_t actual_size;
@@ -541,7 +541,7 @@
TEST_P(SpdySMServerTest, OnSynStream) {
BufferedSpdyFramerVisitorInterface* visitor = interface_.get();
- uint32 stream_id = 82;
+ uint32_t stream_id = 82;
SpdyHeaderBlock spdy_headers;
spdy_headers["url"] = "http://www.example.com/path";
spdy_headers["method"] = "GET";
@@ -557,7 +557,7 @@
}
TEST_P(SpdySMServerTest, NewStream) {
- uint32 stream_id = 13;
+ uint32_t stream_id = 13;
std::string filename = "foobar";
{
@@ -570,7 +570,7 @@
}
TEST_P(SpdySMServerTest, NewStreamError) {
- uint32 stream_id = 82;
+ uint32_t stream_id = 82;
SpdyHeaderBlock actual_header_block;
const char* actual_data;
size_t actual_size;
diff --git a/net/tools/flip_server/streamer_interface.cc b/net/tools/flip_server/streamer_interface.cc
index 25a49649..5f3d479 100644
--- a/net/tools/flip_server/streamer_interface.cc
+++ b/net/tools/flip_server/streamer_interface.cc
@@ -43,7 +43,7 @@
}
void StreamerSM::InitSMInterface(SMInterface* sm_other_interface,
- int32 server_idx) {
+ int32_t server_idx) {
sm_other_interface_ = sm_other_interface;
}
@@ -143,12 +143,13 @@
return 1;
}
-size_t StreamerSM::SendSynStream(uint32 stream_id,
+size_t StreamerSM::SendSynStream(uint32_t stream_id,
const BalsaHeaders& headers) {
return 0;
}
-size_t StreamerSM::SendSynReply(uint32 stream_id, const BalsaHeaders& headers) {
+size_t StreamerSM::SendSynReply(uint32_t stream_id,
+ const BalsaHeaders& headers) {
return 0;
}
diff --git a/net/tools/flip_server/streamer_interface.h b/net/tools/flip_server/streamer_interface.h
index ef66669..f255427 100644
--- a/net/tools/flip_server/streamer_interface.h
+++ b/net/tools/flip_server/streamer_interface.h
@@ -5,6 +5,9 @@
#ifndef NET_TOOLS_FLIP_SERVER_STREAMER_INTERFACE_H_
#define NET_TOOLS_FLIP_SERVER_STREAMER_INTERFACE_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include "base/compiler_specific.h"
@@ -31,7 +34,7 @@
void AddToOutputOrder(const MemCacheIter& mci) {}
void InitSMInterface(SMInterface* sm_other_interface,
- int32 server_idx) override;
+ int32_t server_idx) override;
void InitSMConnection(SMConnectionPoolInterface* connection_pool,
SMInterface* sm_interface,
EpollServer* epoll_server,
@@ -44,26 +47,27 @@
size_t ProcessReadInput(const char* data, size_t len) override;
size_t ProcessWriteInput(const char* data, size_t len) override;
bool MessageFullyRead() const override;
- void SetStreamID(uint32 stream_id) override {}
+ void SetStreamID(uint32_t stream_id) override {}
bool Error() const override;
const char* ErrorAsString() const override;
void Reset() override;
- void ResetForNewInterface(int32 server_idx) override {}
+ void ResetForNewInterface(int32_t server_idx) override {}
void ResetForNewConnection() override;
void Cleanup() override;
int PostAcceptHook() override;
- void NewStream(uint32 stream_id,
- uint32 priority,
+ void NewStream(uint32_t stream_id,
+ uint32_t priority,
const std::string& filename) override {}
- void SendEOF(uint32 stream_id) override {}
- void SendErrorNotFound(uint32 stream_id) override {}
- virtual void SendOKResponse(uint32 stream_id, const std::string& output) {}
- size_t SendSynStream(uint32 stream_id, const BalsaHeaders& headers) override;
- size_t SendSynReply(uint32 stream_id, const BalsaHeaders& headers) override;
- void SendDataFrame(uint32 stream_id,
+ void SendEOF(uint32_t stream_id) override {}
+ void SendErrorNotFound(uint32_t stream_id) override {}
+ virtual void SendOKResponse(uint32_t stream_id, const std::string& output) {}
+ size_t SendSynStream(uint32_t stream_id,
+ const BalsaHeaders& headers) override;
+ size_t SendSynReply(uint32_t stream_id, const BalsaHeaders& headers) override;
+ void SendDataFrame(uint32_t stream_id,
const char* data,
- int64 len,
- uint32 flags,
+ int64_t len,
+ uint32_t flags,
bool compress) override {}
void set_is_request() override;
static std::string forward_ip_header() { return forward_ip_header_; }
@@ -72,19 +76,19 @@
}
private:
- void SendEOFImpl(uint32 stream_id) {}
- void SendErrorNotFoundImpl(uint32 stream_id) {}
- void SendOKResponseImpl(uint32 stream_id, std::string* output) {}
- size_t SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers) {
+ void SendEOFImpl(uint32_t stream_id) {}
+ void SendErrorNotFoundImpl(uint32_t stream_id) {}
+ void SendOKResponseImpl(uint32_t stream_id, std::string* output) {}
+ size_t SendSynReplyImpl(uint32_t stream_id, const BalsaHeaders& headers) {
return 0;
}
- size_t SendSynStreamImpl(uint32 stream_id, const BalsaHeaders& headers) {
+ size_t SendSynStreamImpl(uint32_t stream_id, const BalsaHeaders& headers) {
return 0;
}
- void SendDataFrameImpl(uint32 stream_id,
+ void SendDataFrameImpl(uint32_t stream_id,
const char* data,
- int64 len,
- uint32 flags,
+ int64_t len,
+ uint32_t flags,
bool compress) {}
void GetOutput() override {}
diff --git a/net/tools/flip_server/url_to_filename_encoder.cc b/net/tools/flip_server/url_to_filename_encoder.cc
index bf75fff7..b3d80e4b5 100644
--- a/net/tools/flip_server/url_to_filename_encoder.cc
+++ b/net/tools/flip_server/url_to_filename_encoder.cc
@@ -21,9 +21,9 @@
// A simple parser for long long values. Returns the parsed value if a
// valid integer is found; else returns deflt
// UInt64 and Int64 cannot handle decimal numbers with leading 0s.
-uint64 ParseLeadingHex64Value(const char* str, uint64 deflt) {
+uint64_t ParseLeadingHex64Value(const char* str, uint64_t deflt) {
char* error = NULL;
- const uint64 value = strtoull(str, &error, 16);
+ const uint64_t value = strtoull(str, &error, 16);
return (error == str) ? deflt : value;
}
@@ -196,7 +196,7 @@
case kFirstDigit:
if (base::IsHexDigit(ch)) {
hex_buffer[1] = ch;
- uint64 hex_value = ParseLeadingHex64Value(hex_buffer, 0);
+ uint64_t hex_value = ParseLeadingHex64Value(hex_buffer, 0);
decoded_url->append(1, static_cast<char>(hex_value));
state = kStart;
} else {
diff --git a/net/tools/flip_server/url_to_filename_encoder.h b/net/tools/flip_server/url_to_filename_encoder.h
index d07c129..583e2fb 100644
--- a/net/tools/flip_server/url_to_filename_encoder.h
+++ b/net/tools/flip_server/url_to_filename_encoder.h
@@ -79,6 +79,8 @@
#ifndef NET_TOOLS_FLIP_SERVER_URL_TO_FILENAME_ENCODER_H_
#define NET_TOOLS_FLIP_SERVER_URL_TO_FILENAME_ENCODER_H_
+#include <stddef.h>
+
#include <string>
#include "base/strings/string_util.h"
diff --git a/net/tools/gdig/file_net_log.h b/net/tools/gdig/file_net_log.h
index aca1d57..b39111d 100644
--- a/net/tools/gdig/file_net_log.h
+++ b/net/tools/gdig/file_net_log.h
@@ -7,7 +7,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/synchronization/lock.h"
#include "base/time/time.h"
#include "net/log/net_log.h"
diff --git a/net/tools/gdig/gdig.cc b/net/tools/gdig/gdig.cc
index 42a746cf..982436849 100644
--- a/net/tools/gdig/gdig.cc
+++ b/net/tools/gdig/gdig.cc
@@ -6,7 +6,6 @@
#include <string>
#include "base/at_exit.h"
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/cancelable_callback.h"
#include "base/command_line.h"
@@ -57,7 +56,7 @@
if (!net::ParseIPLiteralToNumber(ip, &ip_number))
return false;
- *ip_end_point = net::IPEndPoint(ip_number, static_cast<uint16>(port));
+ *ip_end_point = net::IPEndPoint(ip_number, static_cast<uint16_t>(port));
return true;
}
@@ -152,7 +151,7 @@
continue;
}
- int64 delta_in_milliseconds;
+ int64_t delta_in_milliseconds;
if (!base::StringToInt64(time_and_name[0], &delta_in_milliseconds)) {
fprintf(
stderr,
diff --git a/net/tools/get_server_time/get_server_time.cc b/net/tools/get_server_time/get_server_time.cc
index 60c2519..0cbabd7 100644
--- a/net/tools/get_server_time/get_server_time.cc
+++ b/net/tools/get_server_time/get_server_time.cc
@@ -14,13 +14,13 @@
#include <string>
#include "base/at_exit.h"
-#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/format_macros.h"
#include "base/i18n/time_formatting.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
@@ -54,17 +54,17 @@
// base::TimeTicks::Now() is documented to have a resolution of
// ~1-15ms.
-const int64 kTicksResolutionMs = 15;
+const int64_t kTicksResolutionMs = 15;
// For the sources that are supported (HTTP date headers, TLS
// handshake), the resolution of the server time is 1 second.
-const int64 kServerTimeResolutionMs = 1000;
+const int64_t kServerTimeResolutionMs = 1000;
// Assume base::Time::Now() has the same resolution as
// base::TimeTicks::Now().
//
// TODO(akalin): Figure out the real resolution.
-const int64 kTimeResolutionMs = kTicksResolutionMs;
+const int64_t kTimeResolutionMs = kTicksResolutionMs;
// Simply quits the current message loop when finished. Used to make
// URLFetcher synchronous.
@@ -80,14 +80,14 @@
}
void OnURLFetchDownloadProgress(const net::URLFetcher* source,
- int64 current,
- int64 total) override {
+ int64_t current,
+ int64_t total) override {
NOTREACHED();
}
void OnURLFetchUploadProgress(const net::URLFetcher* source,
- int64 current,
- int64 total) override {
+ int64_t current,
+ int64_t total) override {
NOTREACHED();
}
@@ -261,7 +261,7 @@
UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime(end_time)).c_str(),
end_ticks.ToInternalValue());
- const int64 delta_ticks_internal =
+ const int64_t delta_ticks_internal =
end_ticks.ToInternalValue() - start_ticks.ToInternalValue();
const base::TimeDelta delta_ticks = end_ticks - start_ticks;
diff --git a/net/tools/net_watcher/net_watcher.cc b/net/tools/net_watcher/net_watcher.cc
index 1b22804..9f07513c 100644
--- a/net/tools/net_watcher/net_watcher.cc
+++ b/net/tools/net_watcher/net_watcher.cc
@@ -7,11 +7,11 @@
#include <string>
#include "base/at_exit.h"
-#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_split.h"
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index 26caccff..eb593e19 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -7,7 +7,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/strings/string_number_conversions.h"
@@ -304,8 +303,8 @@
}
void set_smaller_flow_control_receive_window() {
- const uint32 kClientIFCW = 64 * 1024;
- const uint32 kServerIFCW = 1024 * 1024;
+ const uint32_t kClientIFCW = 64 * 1024;
+ const uint32_t kServerIFCW = 1024 * 1024;
set_client_initial_stream_flow_control_receive_window(kClientIFCW);
set_client_initial_session_flow_control_receive_window(
kSessionToStreamRatio * kClientIFCW);
@@ -314,26 +313,26 @@
kSessionToStreamRatio * kServerIFCW);
}
- void set_client_initial_stream_flow_control_receive_window(uint32 window) {
+ void set_client_initial_stream_flow_control_receive_window(uint32_t window) {
CHECK(client_.get() == nullptr);
DVLOG(1) << "Setting client initial stream flow control window: " << window;
client_config_.SetInitialStreamFlowControlWindowToSend(window);
}
- void set_client_initial_session_flow_control_receive_window(uint32 window) {
+ void set_client_initial_session_flow_control_receive_window(uint32_t window) {
CHECK(client_.get() == nullptr);
DVLOG(1) << "Setting client initial session flow control window: "
<< window;
client_config_.SetInitialSessionFlowControlWindowToSend(window);
}
- void set_server_initial_stream_flow_control_receive_window(uint32 window) {
+ void set_server_initial_stream_flow_control_receive_window(uint32_t window) {
CHECK(server_thread_.get() == nullptr);
DVLOG(1) << "Setting server initial stream flow control window: " << window;
server_config_.SetInitialStreamFlowControlWindowToSend(window);
}
- void set_server_initial_session_flow_control_receive_window(uint32 window) {
+ void set_server_initial_session_flow_control_receive_window(uint32_t window) {
CHECK(server_thread_.get() == nullptr);
DVLOG(1) << "Setting server initial session flow control window: "
<< window;
@@ -447,7 +446,7 @@
response_code, body);
}
- void SetPacketLossPercentage(int32 loss) {
+ void SetPacketLossPercentage(int32_t loss) {
// TODO(rtenneti): enable when we can do random packet loss tests in
// chrome's tree.
if (loss != 0 && loss != 100)
@@ -463,7 +462,7 @@
// server_writer_->set_fake_packet_delay(delay);
}
- void SetReorderPercentage(int32 reorder) {
+ void SetReorderPercentage(int32_t reorder) {
// TODO(rtenneti): enable when we can do random packet reorder tests in
// chrome's tree.
// client_writer_->set_fake_reorder_percentage(reorder);
@@ -1040,7 +1039,7 @@
// Ensure both stream and connection level are flow control blocked by setting
// the send window offset to 0.
- const uint64 flow_control_window =
+ const uint64_t flow_control_window =
server_config_.GetInitialStreamFlowControlWindowToSend();
QuicSpdyClientStream* stream = client_->GetOrCreateStream();
QuicSession* session = client_->client()->session();
@@ -1221,7 +1220,7 @@
TEST_P(EndToEndTest, ClientSuggestsRTT) {
// Client suggests initial RTT, verify it is used.
- const uint32 kInitialRTT = 20000;
+ const uint32_t kInitialRTT = 20000;
client_config_.SetInitialRoundTripTimeUsToSend(kInitialRTT);
ASSERT_TRUE(Initialize());
@@ -1270,9 +1269,9 @@
client_sent_packet_manager.GetRttStats()->smoothed_rtt().IsInfinite());
const RttStats& server_rtt_stats =
*session->connection()->sent_packet_manager().GetRttStats();
- EXPECT_EQ(static_cast<int64>(kMaxInitialRoundTripTimeUs),
+ EXPECT_EQ(static_cast<int64_t>(kMaxInitialRoundTripTimeUs),
server_rtt_stats.initial_rtt_us());
- EXPECT_GE(static_cast<int64>(kMaxInitialRoundTripTimeUs),
+ EXPECT_GE(static_cast<int64_t>(kMaxInitialRoundTripTimeUs),
server_rtt_stats.smoothed_rtt().ToMicroseconds());
server_thread_->Resume();
}
@@ -1301,7 +1300,7 @@
EXPECT_FALSE(
client_sent_packet_manager.GetRttStats()->smoothed_rtt().IsInfinite());
// Expect the default rtt of 100ms.
- EXPECT_EQ(static_cast<int64>(100 * kNumMicrosPerMilli),
+ EXPECT_EQ(static_cast<int64_t>(100 * kNumMicrosPerMilli),
server_sent_packet_manager.GetRttStats()->initial_rtt_us());
// Ensure the bandwidth is valid.
client_sent_packet_manager.BandwidthEstimate();
@@ -1535,14 +1534,14 @@
// Client and server can set different initial flow control receive windows.
// These are sent in CHLO/SHLO. Tests that these values are exchanged properly
// in the crypto handshake.
- const uint32 kClientStreamIFCW = 123456;
- const uint32 kClientSessionIFCW = 234567;
+ const uint32_t kClientStreamIFCW = 123456;
+ const uint32_t kClientSessionIFCW = 234567;
set_client_initial_stream_flow_control_receive_window(kClientStreamIFCW);
set_client_initial_session_flow_control_receive_window(kClientSessionIFCW);
- uint32 kServerStreamIFCW =
+ uint32_t kServerStreamIFCW =
GetParam().auto_tune_flow_control_window ? 32 * 1024 : 654321;
- uint32 kServerSessionIFCW =
+ uint32_t kServerSessionIFCW =
GetParam().auto_tune_flow_control_window ? 48 * 1024 : 765432;
set_server_initial_stream_flow_control_receive_window(kServerStreamIFCW);
set_server_initial_session_flow_control_receive_window(kServerSessionIFCW);
@@ -1591,9 +1590,9 @@
TEST_P(EndToEndTest, HeadersAndCryptoStreamsNoConnectionFlowControl) {
// The special headers and crypto streams should be subject to per-stream flow
// control limits, but should not be subject to connection level flow control.
- const uint32 kStreamIFCW =
+ const uint32_t kStreamIFCW =
GetParam().auto_tune_flow_control_window ? 32 * 1024 : 123456;
- const uint32 kSessionIFCW =
+ const uint32_t kSessionIFCW =
GetParam().auto_tune_flow_control_window ? 48 * 1024 : 234567;
set_client_initial_stream_flow_control_receive_window(kStreamIFCW);
set_client_initial_session_flow_control_receive_window(kSessionIFCW);
@@ -2020,7 +2019,7 @@
// The response body must be larger than the flow control window so the server
// must receive a window update from the client before it can finish sending
// it.
- uint32 response_body_size =
+ uint32_t response_body_size =
2 * client_config_.GetInitialStreamFlowControlWindowToSend();
GenerateBody(&response_body, response_body_size);
@@ -2039,7 +2038,7 @@
// update. This allows headers processing to trigger the error response
// before the request FIN is processed but receive the request FIN before the
// response is sent completely.
- const uint32 kRequestBodySize = kMaxPacketSize + 10;
+ const uint32_t kRequestBodySize = kMaxPacketSize + 10;
string request_body;
GenerateBody(&request_body, kRequestBodySize);
request.AddBody(request_body, false);
@@ -2073,7 +2072,7 @@
}
TEST_P(EndToEndTest, LargePostEarlyResponse) {
- const uint32 kWindowSize = 65536;
+ const uint32_t kWindowSize = 65536;
set_client_initial_stream_flow_control_receive_window(kWindowSize);
set_client_initial_session_flow_control_receive_window(kWindowSize);
set_server_initial_stream_flow_control_receive_window(kWindowSize);
@@ -2086,7 +2085,7 @@
// POST to a URL that gets an early error response, after the headers are
// received and before the body is received.
HTTPMessage request(HttpConstants::HTTP_1_1, HttpConstants::POST, "/garbage");
- const uint32 kBodySize = 2 * kWindowSize;
+ const uint32_t kBodySize = 2 * kWindowSize;
// Invalid content-length so the request will receive an early 500 response.
request.AddHeader("content-length", "-1");
request.set_skip_message_validation(true);
diff --git a/net/tools/quic/quic_client.cc b/net/tools/quic/quic_client.cc
index 48d8a4e..6e2b326 100644
--- a/net/tools/quic/quic_client.cc
+++ b/net/tools/quic/quic_client.cc
@@ -88,8 +88,8 @@
// If an initial flow control window has not explicitly been set, then use the
// same values that Chrome uses.
- const uint32 kSessionMaxRecvWindowSize = 15 * 1024 * 1024; // 15 MB
- const uint32 kStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
+ const uint32_t kSessionMaxRecvWindowSize = 15 * 1024 * 1024; // 15 MB
+ const uint32_t kStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
if (config()->GetInitialStreamFlowControlWindowToSend() ==
kMinimumFlowControlSendWindow) {
config()->SetInitialStreamFlowControlWindowToSend(kStreamMaxRecvWindowSize);
diff --git a/net/tools/quic/quic_client.h b/net/tools/quic/quic_client.h
index 21a7113..cb06c7f7 100644
--- a/net/tools/quic/quic_client.h
+++ b/net/tools/quic/quic_client.h
@@ -8,10 +8,12 @@
#ifndef NET_TOOLS_QUIC_QUIC_CLIENT_H_
#define NET_TOOLS_QUIC_QUIC_CLIENT_H_
+#include <stddef.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/command_line.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/ip_endpoint.h"
diff --git a/net/tools/quic/quic_client_base.h b/net/tools/quic/quic_client_base.h
index 49b9461d..046276a 100644
--- a/net/tools/quic/quic_client_base.h
+++ b/net/tools/quic/quic_client_base.h
@@ -10,7 +10,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/ip_endpoint.h"
#include "net/log/net_log.h"
diff --git a/net/tools/quic/quic_client_bin.cc b/net/tools/quic/quic_client_bin.cc
index d9b987c..96046e4b 100644
--- a/net/tools/quic/quic_client_bin.cc
+++ b/net/tools/quic/quic_client_bin.cc
@@ -81,7 +81,7 @@
// The IP or hostname the quic client will connect to.
string FLAGS_host = "";
// The port to connect to.
-int32 FLAGS_port = 0;
+int32_t FLAGS_port = 0;
// If set, send a POST with this body.
string FLAGS_body = "";
// If set, contents are converted from hex to ascii, before sending as body of
@@ -93,7 +93,7 @@
bool FLAGS_quiet = false;
// QUIC version to speak, e.g. 21. If not set, then all available versions are
// offered in the handshake.
-int32 FLAGS_quic_version = -1;
+int32_t FLAGS_quic_version = -1;
// If true, a version mismatch in the handshake is not considered a failure.
// Useful for probing a server to determine if it speaks any version of QUIC.
bool FLAGS_version_mismatch_ok = false;
@@ -101,7 +101,7 @@
// response, otherwise a failure.
bool FLAGS_redirect_is_success = true;
// Initial MTU of the connection.
-int32 FLAGS_initial_mtu = 0;
+int32_t FLAGS_initial_mtu = 0;
class FakeCertVerifier : public net::CertVerifier {
public:
@@ -125,7 +125,7 @@
bytes->clear();
if (hex.empty())
return true;
- std::vector<uint8> v;
+ std::vector<uint8_t> v;
if (!base::HexStringToBytes(hex.as_string(), &v))
return false;
if (!v.empty())
diff --git a/net/tools/quic/quic_client_session.h b/net/tools/quic/quic_client_session.h
index 13f900d..f08d517 100644
--- a/net/tools/quic/quic_client_session.h
+++ b/net/tools/quic/quic_client_session.h
@@ -9,7 +9,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/quic/quic_client_session_base.h"
#include "net/quic/quic_crypto_client_stream.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/tools/quic/quic_client_session_test.cc b/net/tools/quic/quic_client_session_test.cc
index e223734..7b43f96 100644
--- a/net/tools/quic/quic_client_session_test.cc
+++ b/net/tools/quic/quic_client_session_test.cc
@@ -42,7 +42,7 @@
namespace {
const char kServerHostname[] = "test.example.com";
-const uint16 kPort = 80;
+const uint16_t kPort = 80;
class ToolsQuicClientSessionTest
: public ::testing::TestWithParam<QuicVersion> {
diff --git a/net/tools/quic/quic_client_test.cc b/net/tools/quic/quic_client_test.cc
index 8235dce..8ab4a65 100644
--- a/net/tools/quic/quic_client_test.cc
+++ b/net/tools/quic/quic_client_test.cc
@@ -7,7 +7,6 @@
#include <dirent.h>
#include <stdio.h>
-#include "base/basictypes.h"
#include "base/strings/string_util.h"
#include "net/quic/test_tools/crypto_test_utils.h"
#include "net/quic/test_tools/quic_test_utils.h"
@@ -38,7 +37,7 @@
// Creates a new QuicClient and Initializes it. Caller is responsible for
// deletion.
-QuicClient* CreateAndInitializeQuicClient(EpollServer* eps, uint16 port) {
+QuicClient* CreateAndInitializeQuicClient(EpollServer* eps, uint16_t port) {
IPEndPoint server_address(IPEndPoint(net::test::Loopback4(), port));
QuicServerId server_id("hostname", server_address.port(),
PRIVACY_MODE_DISABLED);
diff --git a/net/tools/quic/quic_default_packet_writer.h b/net/tools/quic/quic_default_packet_writer.h
index 0b5e57f..f423ff0 100644
--- a/net/tools/quic/quic_default_packet_writer.h
+++ b/net/tools/quic/quic_default_packet_writer.h
@@ -5,7 +5,9 @@
#ifndef NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
#define NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/quic_packet_writer.h"
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc
index d42ad7f..bdd76cc5 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -8,6 +8,7 @@
#include "base/debug/stack_trace.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/stl_util.h"
#include "net/quic/quic_flags.h"
#include "net/quic/quic_utils.h"
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h
index 95b0d82..a7e169d 100644
--- a/net/tools/quic/quic_dispatcher.h
+++ b/net/tools/quic/quic_dispatcher.h
@@ -10,8 +10,8 @@
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/ip_endpoint.h"
#include "net/base/linked_hash_map.h"
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
index 2ce621a6..5506b6e 100644
--- a/net/tools/quic/quic_dispatcher_test.cc
+++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -7,6 +7,7 @@
#include <ostream>
#include <string>
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/quic/crypto/crypto_handshake.h"
#include "net/quic/crypto/quic_crypto_server_config.h"
diff --git a/net/tools/quic/quic_epoll_clock.h b/net/tools/quic/quic_epoll_clock.h
index b5eafc8..05b2b9fd 100644
--- a/net/tools/quic/quic_epoll_clock.h
+++ b/net/tools/quic/quic_epoll_clock.h
@@ -5,8 +5,8 @@
#ifndef NET_TOOLS_QUIC_QUIC_EPOLL_CLOCK_H_
#define NET_TOOLS_QUIC_QUIC_EPOLL_CLOCK_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/quic/quic_clock.h"
#include "net/quic/quic_time.h"
diff --git a/net/tools/quic/quic_epoll_connection_helper.cc b/net/tools/quic/quic_epoll_connection_helper.cc
index 5d412fe55..df7f762 100644
--- a/net/tools/quic/quic_epoll_connection_helper.cc
+++ b/net/tools/quic/quic_epoll_connection_helper.cc
@@ -44,7 +44,7 @@
public:
explicit EpollAlarmImpl(QuicEpollAlarm* alarm) : alarm_(alarm) {}
- int64 OnAlarm() override {
+ int64_t OnAlarm() override {
EpollAlarm::OnAlarm();
alarm_->Fire();
// Fire will take care of registering the alarm, if needed.
diff --git a/net/tools/quic/quic_epoll_connection_helper.h b/net/tools/quic/quic_epoll_connection_helper.h
index 66a27bb..cc99b60 100644
--- a/net/tools/quic/quic_epoll_connection_helper.h
+++ b/net/tools/quic/quic_epoll_connection_helper.h
@@ -11,6 +11,7 @@
#include <sys/types.h>
#include <set>
+#include "base/macros.h"
#include "net/quic/quic_connection.h"
#include "net/quic/quic_packet_writer.h"
#include "net/quic/quic_protocol.h"
diff --git a/net/tools/quic/quic_in_memory_cache.h b/net/tools/quic/quic_in_memory_cache.h
index fa3f520..e6ebada8 100644
--- a/net/tools/quic/quic_in_memory_cache.h
+++ b/net/tools/quic/quic_in_memory_cache.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/singleton.h"
#include "base/strings/string_piece.h"
#include "net/quic/spdy_utils.h"
diff --git a/net/tools/quic/quic_packet_reader.h b/net/tools/quic/quic_packet_reader.h
index e667d59..86ded5b3 100644
--- a/net/tools/quic/quic_packet_reader.h
+++ b/net/tools/quic/quic_packet_reader.h
@@ -10,7 +10,7 @@
#include <netinet/in.h>
#include <sys/socket.h>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
namespace net {
diff --git a/net/tools/quic/quic_packet_writer_wrapper.h b/net/tools/quic/quic_packet_writer_wrapper.h
index 1ab474a..f425b5c 100644
--- a/net/tools/quic/quic_packet_writer_wrapper.h
+++ b/net/tools/quic/quic_packet_writer_wrapper.h
@@ -5,6 +5,9 @@
#ifndef NET_TOOLS_QUIC_QUIC_PACKET_WRITER_WRAPPER_H_
#define NET_TOOLS_QUIC_QUIC_PACKET_WRITER_WRAPPER_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/quic/quic_packet_writer.h"
diff --git a/net/tools/quic/quic_per_connection_packet_writer.h b/net/tools/quic/quic_per_connection_packet_writer.h
index d79cb4b..8a3769af 100644
--- a/net/tools/quic/quic_per_connection_packet_writer.h
+++ b/net/tools/quic/quic_per_connection_packet_writer.h
@@ -5,6 +5,9 @@
#ifndef NET_TOOLS_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_
#define NET_TOOLS_QUIC_QUIC_PER_CONNECTION_PACKET_WRITER_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/quic_connection.h"
#include "net/quic/quic_packet_writer.h"
diff --git a/net/tools/quic/quic_server.cc b/net/tools/quic/quic_server.cc
index 7fd2140..fc1395b 100644
--- a/net/tools/quic/quic_server.cc
+++ b/net/tools/quic/quic_server.cc
@@ -74,8 +74,8 @@
// If an initial flow control window has not explicitly been set, then use a
// sensible value for a server: 1 MB for session, 64 KB for each stream.
- const uint32 kInitialSessionFlowControlWindow = 1 * 1024 * 1024; // 1 MB
- const uint32 kInitialStreamFlowControlWindow = 64 * 1024; // 64 KB
+ const uint32_t kInitialSessionFlowControlWindow = 1 * 1024 * 1024; // 1 MB
+ const uint32_t kInitialStreamFlowControlWindow = 64 * 1024; // 64 KB
if (config_.GetInitialStreamFlowControlWindowToSend() ==
kMinimumFlowControlSendWindow) {
config_.SetInitialStreamFlowControlWindowToSend(
diff --git a/net/tools/quic/quic_server.h b/net/tools/quic/quic_server.h
index 14912a4..bb5ace0 100644
--- a/net/tools/quic/quic_server.h
+++ b/net/tools/quic/quic_server.h
@@ -11,7 +11,9 @@
#ifndef NET_TOOLS_QUIC_QUIC_SERVER_H_
#define NET_TOOLS_QUIC_QUIC_SERVER_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/crypto/quic_crypto_server_config.h"
diff --git a/net/tools/quic/quic_server_bin.cc b/net/tools/quic/quic_server_bin.cc
index 651480c..5e04ccb 100644
--- a/net/tools/quic/quic_server_bin.cc
+++ b/net/tools/quic/quic_server_bin.cc
@@ -8,7 +8,6 @@
#include <iostream>
#include "base/at_exit.h"
-#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/run_loop.h"
@@ -20,7 +19,7 @@
#include "net/tools/quic/quic_server.h"
// The port the quic server will listen on.
-int32 FLAGS_port = 6121;
+int32_t FLAGS_port = 6121;
net::ProofSource* CreateProofSource(const base::FilePath& cert_path,
const base::FilePath& key_path) {
diff --git a/net/tools/quic/quic_server_session.cc b/net/tools/quic/quic_server_session.cc
index 2c39919c..5d58f66 100644
--- a/net/tools/quic/quic_server_session.cc
+++ b/net/tools/quic/quic_server_session.cc
@@ -60,7 +60,7 @@
last_bandwidth_resumption || max_bandwidth_resumption;
if (cached_network_params != nullptr && bandwidth_resumption_enabled_ &&
cached_network_params->serving_region() == serving_region_) {
- int64 seconds_since_estimate =
+ int64_t seconds_since_estimate =
connection()->clock()->WallNow().ToUNIXSeconds() -
cached_network_params->timestamp();
bool estimate_within_last_hour =
@@ -108,10 +108,10 @@
// client, or not enough packets have been sent, then return early.
const QuicSentPacketManager& sent_packet_manager =
connection()->sent_packet_manager();
- int64 srtt_ms =
+ int64_t srtt_ms =
sent_packet_manager.GetRttStats()->smoothed_rtt().ToMilliseconds();
- int64 now_ms = now.Subtract(last_scup_time_).ToMilliseconds();
- int64 packets_since_last_scup =
+ int64_t now_ms = now.Subtract(last_scup_time_).ToMilliseconds();
+ int64_t packets_since_last_scup =
connection()->packet_number_of_last_sent_packet() -
last_scup_packet_number_;
if (now_ms < (kMinIntervalBetweenServerConfigUpdatesRTTs * srtt_ms) ||
@@ -132,7 +132,7 @@
// we sent to the client, and if so, send the new one.
QuicBandwidth new_bandwidth_estimate = bandwidth_recorder.BandwidthEstimate();
- int64 bandwidth_delta =
+ int64_t bandwidth_delta =
std::abs(new_bandwidth_estimate.ToBitsPerSecond() -
bandwidth_estimate_sent_to_client_.ToBitsPerSecond());
@@ -152,7 +152,7 @@
// Include max bandwidth in the update.
QuicBandwidth max_bandwidth_estimate =
bandwidth_recorder.MaxBandwidthEstimate();
- int32 max_bandwidth_timestamp = bandwidth_recorder.MaxBandwidthTimestamp();
+ int32_t max_bandwidth_timestamp = bandwidth_recorder.MaxBandwidthTimestamp();
// Fill the proto before passing it to the crypto stream to send.
CachedNetworkParameters cached_network_params;
diff --git a/net/tools/quic/quic_server_session.h b/net/tools/quic/quic_server_session.h
index e6eb784..bb3788a 100644
--- a/net/tools/quic/quic_server_session.h
+++ b/net/tools/quic/quic_server_session.h
@@ -7,12 +7,14 @@
#ifndef NET_TOOLS_QUIC_QUIC_SERVER_SESSION_H_
#define NET_TOOLS_QUIC_QUIC_SERVER_SESSION_H_
+#include <stdint.h>
+
#include <set>
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/quic/quic_crypto_server_stream.h"
#include "net/quic/quic_protocol.h"
@@ -138,7 +140,7 @@
QuicTime last_scup_time_;
// Number of packets sent to the peer, at the time we last sent a SCUP.
- int64 last_scup_packet_number_;
+ int64_t last_scup_packet_number_;
DISALLOW_COPY_AND_ASSIGN(QuicServerSession);
};
diff --git a/net/tools/quic/quic_server_session_test.cc b/net/tools/quic/quic_server_session_test.cc
index 6fb9f86..d20462e 100644
--- a/net/tools/quic/quic_server_session_test.cc
+++ b/net/tools/quic/quic_server_session_test.cc
@@ -4,6 +4,7 @@
#include "net/tools/quic/quic_server_session.h"
+#include "base/macros.h"
#include "net/quic/crypto/quic_crypto_server_config.h"
#include "net/quic/crypto/quic_random.h"
#include "net/quic/proto/cached_network_parameters.pb.h"
@@ -345,9 +346,9 @@
EXPECT_TRUE(
QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get()));
- int32 bandwidth_estimate_kbytes_per_second = 123;
- int32 max_bandwidth_estimate_kbytes_per_second = 134;
- int32 max_bandwidth_estimate_timestamp = 1122334455;
+ int32_t bandwidth_estimate_kbytes_per_second = 123;
+ int32_t max_bandwidth_estimate_kbytes_per_second = 134;
+ int32_t max_bandwidth_estimate_timestamp = 1122334455;
const string serving_region = "not a real region";
session_->set_serving_region(serving_region);
@@ -388,7 +389,7 @@
// Bandwidth estimate has now changed sufficiently and enough time has passed,
// but not enough packets have been sent.
- int64 srtt_ms =
+ int64_t srtt_ms =
sent_packet_manager->GetRttStats()->smoothed_rtt().ToMilliseconds();
now = now.Add(QuicTime::Delta::FromMilliseconds(
kMinIntervalBetweenServerConfigUpdatesRTTs * srtt_ms));
diff --git a/net/tools/quic/quic_simple_client.h b/net/tools/quic/quic_simple_client.h
index 8b445623..25546d52 100644
--- a/net/tools/quic/quic_simple_client.h
+++ b/net/tools/quic/quic_simple_client.h
@@ -8,10 +8,12 @@
#ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_
#define NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_
+#include <stddef.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/command_line.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/ip_endpoint.h"
diff --git a/net/tools/quic/quic_simple_client_bin.cc b/net/tools/quic/quic_simple_client_bin.cc
index 39e80ba..7e57bfc 100644
--- a/net/tools/quic/quic_simple_client_bin.cc
+++ b/net/tools/quic/quic_simple_client_bin.cc
@@ -81,7 +81,7 @@
// The IP or hostname the quic client will connect to.
string FLAGS_host = "";
// The port to connect to.
-int32 FLAGS_port = 0;
+int32_t FLAGS_port = 0;
// If set, send a POST with this body.
string FLAGS_body = "";
// If set, contents are converted from hex to ascii, before sending as body of
@@ -93,7 +93,7 @@
bool FLAGS_quiet = false;
// QUIC version to speak, e.g. 21. If not set, then all available versions are
// offered in the handshake.
-int32 FLAGS_quic_version = -1;
+int32_t FLAGS_quic_version = -1;
// If true, a version mismatch in the handshake is not considered a failure.
// Useful for probing a server to determine if it speaks any version of QUIC.
bool FLAGS_version_mismatch_ok = false;
@@ -101,7 +101,7 @@
// response, otherwise a failure.
bool FLAGS_redirect_is_success = true;
// Initial MTU of the connection.
-int32 FLAGS_initial_mtu = 0;
+int32_t FLAGS_initial_mtu = 0;
class FakeCertVerifier : public net::CertVerifier {
public:
@@ -125,7 +125,7 @@
bytes->clear();
if (hex.empty())
return true;
- std::vector<uint8> v;
+ std::vector<uint8_t> v;
if (!base::HexStringToBytes(hex.as_string(), &v))
return false;
if (!v.empty())
diff --git a/net/tools/quic/quic_simple_client_test.cc b/net/tools/quic/quic_simple_client_test.cc
index 2d24553..096ff0f5 100644
--- a/net/tools/quic/quic_simple_client_test.cc
+++ b/net/tools/quic/quic_simple_client_test.cc
@@ -4,7 +4,6 @@
#include "net/tools/quic/quic_simple_client.h"
-#include "base/basictypes.h"
#include "base/strings/string_util.h"
#include "net/quic/test_tools/crypto_test_utils.h"
#include "net/quic/test_tools/quic_test_utils.h"
diff --git a/net/tools/quic/quic_simple_per_connection_packet_writer.h b/net/tools/quic/quic_simple_per_connection_packet_writer.h
index c1441baa..1914ba9 100644
--- a/net/tools/quic/quic_simple_per_connection_packet_writer.h
+++ b/net/tools/quic/quic_simple_per_connection_packet_writer.h
@@ -5,6 +5,9 @@
#ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_PER_CONNECTION_PACKET_WRITER_H_
#define NET_QUIC_TOOLS_QUIC_SIMPLE_PER_CONNECTION_PACKET_WRITER_H_
+#include <stddef.h>
+
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/quic/quic_connection.h"
#include "net/quic/quic_packet_writer.h"
diff --git a/net/tools/quic/quic_simple_server.cc b/net/tools/quic/quic_simple_server.cc
index 08f8572..970749d 100644
--- a/net/tools/quic/quic_simple_server.cc
+++ b/net/tools/quic/quic_simple_server.cc
@@ -89,8 +89,8 @@
// If an initial flow control window has not explicitly been set, then use a
// sensible value for a server: 1 MB for session, 64 KB for each stream.
- const uint32 kInitialSessionFlowControlWindow = 1 * 1024 * 1024; // 1 MB
- const uint32 kInitialStreamFlowControlWindow = 64 * 1024; // 64 KB
+ const uint32_t kInitialSessionFlowControlWindow = 1 * 1024 * 1024; // 1 MB
+ const uint32_t kInitialStreamFlowControlWindow = 64 * 1024; // 64 KB
if (config_.GetInitialStreamFlowControlWindowToSend() ==
kMinimumFlowControlSendWindow) {
config_.SetInitialStreamFlowControlWindowToSend(
@@ -125,7 +125,7 @@
// because the default usage of QuicSimpleServer is as a test server with
// one or two clients. Adjust higher for use with many clients.
rc = socket->SetReceiveBufferSize(
- static_cast<int32>(kDefaultSocketReceiveBuffer));
+ static_cast<int32_t>(kDefaultSocketReceiveBuffer));
if (rc < 0) {
LOG(ERROR) << "SetReceiveBufferSize() failed: " << ErrorToString(rc);
return rc;
diff --git a/net/tools/quic/quic_simple_server.h b/net/tools/quic/quic_simple_server.h
index a07eadc..bb63c7aa 100644
--- a/net/tools/quic/quic_simple_server.h
+++ b/net/tools/quic/quic_simple_server.h
@@ -8,7 +8,7 @@
#ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_
#define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
diff --git a/net/tools/quic/quic_simple_server_bin.cc b/net/tools/quic/quic_simple_server_bin.cc
index 26b58b8..e7ec276 100644
--- a/net/tools/quic/quic_simple_server_bin.cc
+++ b/net/tools/quic/quic_simple_server_bin.cc
@@ -8,7 +8,6 @@
#include <iostream>
#include "base/at_exit.h"
-#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/run_loop.h"
@@ -20,7 +19,7 @@
#include "net/tools/quic/quic_simple_server.h"
// The port the quic server will listen on.
-int32 FLAGS_port = 6121;
+int32_t FLAGS_port = 6121;
net::ProofSource* CreateProofSource(const base::FilePath& cert_path,
const base::FilePath& key_path) {
diff --git a/net/tools/quic/quic_simple_server_packet_writer.h b/net/tools/quic/quic_simple_server_packet_writer.h
index 7bf934b..6e4cf8a 100644
--- a/net/tools/quic/quic_simple_server_packet_writer.h
+++ b/net/tools/quic/quic_simple_server_packet_writer.h
@@ -5,8 +5,10 @@
#ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_PACKET_WRITER_H_
#define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_PACKET_WRITER_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+
#include "base/callback.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/quic_connection.h"
diff --git a/net/tools/quic/quic_simple_server_stream.h b/net/tools/quic/quic_simple_server_stream.h
index 8e6c94f..c063a31 100644
--- a/net/tools/quic/quic_simple_server_stream.h
+++ b/net/tools/quic/quic_simple_server_stream.h
@@ -5,9 +5,11 @@
#ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_
#define NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_
+#include <stddef.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_spdy_stream.h"
#include "net/spdy/spdy_framer.h"
diff --git a/net/tools/quic/quic_socket_utils.cc b/net/tools/quic/quic_socket_utils.cc
index 262c608..1853a6bf 100644
--- a/net/tools/quic/quic_socket_utils.cc
+++ b/net/tools/quic/quic_socket_utils.cc
@@ -11,7 +11,6 @@
#include <sys/uio.h>
#include <string>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/quic/quic_protocol.h"
@@ -27,15 +26,15 @@
if (hdr->msg_controllen > 0) {
for (cmsghdr* cmsg = CMSG_FIRSTHDR(hdr); cmsg != nullptr;
cmsg = CMSG_NXTHDR(hdr, cmsg)) {
- const uint8* addr_data = nullptr;
+ const uint8_t* addr_data = nullptr;
int len = 0;
if (cmsg->cmsg_type == IPV6_PKTINFO) {
in6_pktinfo* info = reinterpret_cast<in6_pktinfo*> CMSG_DATA(cmsg);
- addr_data = reinterpret_cast<const uint8*>(&info->ipi6_addr);
+ addr_data = reinterpret_cast<const uint8_t*>(&info->ipi6_addr);
len = sizeof(in6_addr);
} else if (cmsg->cmsg_type == IP_PKTINFO) {
in_pktinfo* info = reinterpret_cast<in_pktinfo*> CMSG_DATA(cmsg);
- addr_data = reinterpret_cast<const uint8*>(&info->ipi_addr);
+ addr_data = reinterpret_cast<const uint8_t*>(&info->ipi_addr);
len = sizeof(in_addr);
} else {
continue;
diff --git a/net/tools/quic/quic_socket_utils.h b/net/tools/quic/quic_socket_utils.h
index 2c8fe43..2d152f9a 100644
--- a/net/tools/quic/quic_socket_utils.h
+++ b/net/tools/quic/quic_socket_utils.h
@@ -9,9 +9,10 @@
#include <stddef.h>
#include <sys/socket.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/quic_bandwidth.h"
#include "net/quic/quic_types.h"
diff --git a/net/tools/quic/quic_spdy_client_stream.h b/net/tools/quic/quic_spdy_client_stream.h
index 0391b5b..d56eb55 100644
--- a/net/tools/quic/quic_spdy_client_stream.h
+++ b/net/tools/quic/quic_spdy_client_stream.h
@@ -5,10 +5,12 @@
#ifndef NET_TOOLS_QUIC_QUIC_SPDY_CLIENT_STREAM_H_
#define NET_TOOLS_QUIC_QUIC_SPDY_CLIENT_STREAM_H_
+#include <stddef.h>
#include <sys/types.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_spdy_stream.h"
diff --git a/net/tools/quic/quic_spdy_client_stream_test.cc b/net/tools/quic/quic_spdy_client_stream_test.cc
index e375c49..eaefac58 100644
--- a/net/tools/quic/quic_spdy_client_stream_test.cc
+++ b/net/tools/quic/quic_spdy_client_stream_test.cc
@@ -4,6 +4,7 @@
#include "net/tools/quic/quic_spdy_client_stream.h"
+#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
#include "net/quic/quic_utils.h"
#include "net/quic/spdy_utils.h"
diff --git a/net/tools/quic/quic_time_wait_list_manager.cc b/net/tools/quic/quic_time_wait_list_manager.cc
index 9909420..fb834577 100644
--- a/net/tools/quic/quic_time_wait_list_manager.cc
+++ b/net/tools/quic/quic_time_wait_list_manager.cc
@@ -7,6 +7,7 @@
#include <errno.h>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "net/base/ip_endpoint.h"
diff --git a/net/tools/quic/quic_time_wait_list_manager.h b/net/tools/quic/quic_time_wait_list_manager.h
index e36d866..777ab0eb 100644
--- a/net/tools/quic/quic_time_wait_list_manager.h
+++ b/net/tools/quic/quic_time_wait_list_manager.h
@@ -9,9 +9,11 @@
#ifndef NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_
#define NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_
+#include <stddef.h>
+
#include <deque>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/linked_hash_map.h"
#include "net/quic/quic_blocked_writer_interface.h"
#include "net/quic/quic_connection.h"
diff --git a/net/tools/quic/quic_time_wait_list_manager_test.cc b/net/tools/quic/quic_time_wait_list_manager_test.cc
index f77c9b3..90d7d332 100644
--- a/net/tools/quic/quic_time_wait_list_manager_test.cc
+++ b/net/tools/quic/quic_time_wait_list_manager_test.cc
@@ -89,7 +89,7 @@
class MockFakeTimeEpollServer : public FakeTimeEpollServer {
public:
MOCK_METHOD2(RegisterAlarm,
- void(int64 timeout_in_us, EpollAlarmCallbackInterface* alarm));
+ void(int64_t timeout_in_us, EpollAlarmCallbackInterface* alarm));
};
class QuicTimeWaitListManagerTest : public ::testing::Test {
@@ -331,8 +331,8 @@
epoll_server_.set_now_in_usec(time_wait_period.Add(offset).ToMicroseconds());
// After all the old connection_ids are cleaned up, check the next alarm
// interval.
- int64 next_alarm_time = epoll_server_.ApproximateNowInUsec() +
- time_wait_period.Subtract(offset).ToMicroseconds();
+ int64_t next_alarm_time = epoll_server_.ApproximateNowInUsec() +
+ time_wait_period.Subtract(offset).ToMicroseconds();
EXPECT_CALL(epoll_server_, RegisterAlarm(next_alarm_time, _));
for (size_t connection_id = 1; connection_id <= kConnectionIdCount;
@@ -461,7 +461,7 @@
// Now set the current time as time_wait_period + offset usecs.
epoll_server_.set_now_in_usec(time_wait_period.Add(offset).ToMicroseconds());
// After the connection_ids are cleaned up, check the next alarm interval.
- int64 next_alarm_time =
+ int64_t next_alarm_time =
epoll_server_.ApproximateNowInUsec() + time_wait_period.ToMicroseconds();
EXPECT_CALL(epoll_server_, RegisterAlarm(next_alarm_time, _));
@@ -510,7 +510,7 @@
QuicConnectionId current_connection_id = 0;
// Add exactly the maximum number of connections
- for (int64 i = 0; i < FLAGS_quic_time_wait_list_max_connections; ++i) {
+ for (int64_t i = 0; i < FLAGS_quic_time_wait_list_max_connections; ++i) {
++current_connection_id;
EXPECT_FALSE(IsConnectionIdInTimeWait(current_connection_id));
EXPECT_CALL(visitor_,
@@ -522,7 +522,7 @@
// Now keep adding. Since we're already at the max, every new connection-id
// will evict the oldest one.
- for (int64 i = 0; i < FLAGS_quic_time_wait_list_max_connections; ++i) {
+ for (int64_t i = 0; i < FLAGS_quic_time_wait_list_max_connections; ++i) {
++current_connection_id;
const QuicConnectionId id_to_evict =
current_connection_id - FLAGS_quic_time_wait_list_max_connections;
diff --git a/net/tools/quic/spdy_balsa_utils.h b/net/tools/quic/spdy_balsa_utils.h
index 99e0bf40..6cbdffa2 100644
--- a/net/tools/quic/spdy_balsa_utils.h
+++ b/net/tools/quic/spdy_balsa_utils.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
#include "net/spdy/spdy_framer.h"
#include "net/spdy/spdy_header_block.h"
diff --git a/net/tools/quic/synchronous_host_resolver.cc b/net/tools/quic/synchronous_host_resolver.cc
index d8523e8..b0ec18e 100644
--- a/net/tools/quic/synchronous_host_resolver.cc
+++ b/net/tools/quic/synchronous_host_resolver.cc
@@ -6,6 +6,7 @@
#include "base/at_exit.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
diff --git a/net/tools/quic/test_tools/http_message.cc b/net/tools/quic/test_tools/http_message.cc
index 0d18cd13c..1ea56382 100644
--- a/net/tools/quic/test_tools/http_message.cc
+++ b/net/tools/quic/test_tools/http_message.cc
@@ -6,7 +6,6 @@
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
diff --git a/net/tools/quic/test_tools/http_message.h b/net/tools/quic/test_tools/http_message.h
index a31c5c9..de0ee3a 100644
--- a/net/tools/quic/test_tools/http_message.h
+++ b/net/tools/quic/test_tools/http_message.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/tools/balsa/balsa_enums.h"
#include "net/tools/balsa/balsa_headers.h"
diff --git a/net/tools/quic/test_tools/limited_mtu_test_writer.h b/net/tools/quic/test_tools/limited_mtu_test_writer.h
index f3021651..3104082 100644
--- a/net/tools/quic/test_tools/limited_mtu_test_writer.h
+++ b/net/tools/quic/test_tools/limited_mtu_test_writer.h
@@ -5,7 +5,9 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_LIMITED_MTU_TEST_WRITER_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_LIMITED_MTU_TEST_WRITER_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+
+#include "base/macros.h"
#include "net/quic/quic_protocol.h"
#include "net/tools/quic/quic_packet_writer_wrapper.h"
diff --git a/net/tools/quic/test_tools/mock_epoll_server.cc b/net/tools/quic/test_tools/mock_epoll_server.cc
index 2b4f467..b5cd974 100644
--- a/net/tools/quic/test_tools/mock_epoll_server.cc
+++ b/net/tools/quic/test_tools/mock_epoll_server.cc
@@ -12,7 +12,7 @@
FakeTimeEpollServer::~FakeTimeEpollServer() {}
-int64 FakeTimeEpollServer::NowInUsec() const {
+int64_t FakeTimeEpollServer::NowInUsec() const {
return now_in_usec_;
}
@@ -29,7 +29,7 @@
event_queue_.begin()->first <= NowInUsec() &&
((until_in_usec_ == -1) ||
(event_queue_.begin()->first < until_in_usec_))) {
- int64 event_time_in_usec = event_queue_.begin()->first;
+ int64_t event_time_in_usec = event_queue_.begin()->first;
events[num_events] = event_queue_.begin()->second;
if (event_time_in_usec > NowInUsec()) {
set_now_in_usec(event_time_in_usec);
diff --git a/net/tools/quic/test_tools/mock_epoll_server.h b/net/tools/quic/test_tools/mock_epoll_server.h
index 38c8be5..e10fc49 100644
--- a/net/tools/quic/test_tools/mock_epoll_server.h
+++ b/net/tools/quic/test_tools/mock_epoll_server.h
@@ -5,7 +5,11 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_MOCK_EPOLL_SERVER_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_MOCK_EPOLL_SERVER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include "base/logging.h"
+#include "base/macros.h"
#include "net/tools/epoll_server/epoll_server.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -22,12 +26,12 @@
~FakeTimeEpollServer() override;
// Replaces the EpollServer NowInUsec.
- int64 NowInUsec() const override;
+ int64_t NowInUsec() const override;
- void set_now_in_usec(int64 nius) { now_in_usec_ = nius; }
+ void set_now_in_usec(int64_t nius) { now_in_usec_ = nius; }
// Advances the virtual 'now' by advancement_usec.
- void AdvanceBy(int64 advancement_usec) {
+ void AdvanceBy(int64_t advancement_usec) {
set_now_in_usec(NowInUsec() + advancement_usec);
}
@@ -36,20 +40,20 @@
// Note that the WaitForEventsAndExecuteCallbacks invocation
// may cause NowInUs to advance beyond what was specified here.
// If that is not desired, use the AdvanceByExactly calls.
- void AdvanceByAndWaitForEventsAndExecuteCallbacks(int64 advancement_usec) {
+ void AdvanceByAndWaitForEventsAndExecuteCallbacks(int64_t advancement_usec) {
AdvanceBy(advancement_usec);
WaitForEventsAndExecuteCallbacks();
}
private:
- int64 now_in_usec_;
+ int64_t now_in_usec_;
DISALLOW_COPY_AND_ASSIGN(FakeTimeEpollServer);
};
class MockEpollServer : public FakeTimeEpollServer {
public: // type definitions
- typedef base::hash_multimap<int64, struct epoll_event> EventQueue;
+ typedef base::hash_multimap<int64_t, struct epoll_event> EventQueue;
MockEpollServer();
~MockEpollServer() override;
@@ -59,7 +63,7 @@
// to add an event for a time which has already been passed..
// .. upon the next time that the callbacks are invoked,
// all events which are in the 'past' will be delivered.
- void AddEvent(int64 time_in_usec, const struct epoll_event& ee) {
+ void AddEvent(int64_t time_in_usec, const struct epoll_event& ee) {
event_queue_.insert(std::make_pair(time_in_usec, ee));
}
@@ -67,13 +71,13 @@
// and ensure that the next invocation of
// WaitForEventsAndExecuteCallbacks goes no farther than
// advancement_usec from the current time.
- void AdvanceByExactly(int64 advancement_usec) {
+ void AdvanceByExactly(int64_t advancement_usec) {
until_in_usec_ = NowInUsec() + advancement_usec;
set_now_in_usec(NowInUsec() + advancement_usec);
}
// As above, except calls WaitForEventsAndExecuteCallbacks.
- void AdvanceByExactlyAndCallCallbacks(int64 advancement_usec) {
+ void AdvanceByExactlyAndCallCallbacks(int64_t advancement_usec) {
AdvanceByExactly(advancement_usec);
WaitForEventsAndExecuteCallbacks();
}
@@ -98,7 +102,7 @@
private: // members
EventQueue event_queue_;
- int64 until_in_usec_;
+ int64_t until_in_usec_;
DISALLOW_COPY_AND_ASSIGN(MockEpollServer);
};
diff --git a/net/tools/quic/test_tools/mock_quic_server_session_visitor.h b/net/tools/quic/test_tools/mock_quic_server_session_visitor.h
index 38d4371..63c2385 100644
--- a/net/tools/quic/test_tools/mock_quic_server_session_visitor.h
+++ b/net/tools/quic/test_tools/mock_quic_server_session_visitor.h
@@ -5,6 +5,7 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SERVER_SESSION_VISITOR_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SERVER_SESSION_VISITOR_H_
+#include "base/macros.h"
#include "net/tools/quic/quic_server_session.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.cc b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
index 59cc9f3..5e1bfb8 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.cc
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
@@ -55,7 +55,7 @@
fake_packet_delay_(QuicTime::Delta::Zero()),
fake_bandwidth_(QuicBandwidth::Zero()),
buffer_size_(0) {
- uint32 seed = base::RandInt(0, std::numeric_limits<int32>::max());
+ uint32_t seed = base::RandInt(0, std::numeric_limits<int32_t>::max());
VLOG(1) << "Seeding packet loss with " << seed;
simple_random_.set_seed(seed);
}
@@ -81,20 +81,21 @@
base::AutoLock locked(config_mutex_);
if (fake_drop_first_n_packets_ > 0 &&
- num_calls_to_write_ <= static_cast<uint64>(fake_drop_first_n_packets_)) {
+ num_calls_to_write_ <=
+ static_cast<uint64_t>(fake_drop_first_n_packets_)) {
DVLOG(1) << "Dropping first " << fake_drop_first_n_packets_
<< " packets (packet number " << num_calls_to_write_ << ")";
return WriteResult(WRITE_STATUS_OK, buf_len);
}
if (fake_packet_loss_percentage_ > 0 &&
simple_random_.RandUint64() % 100 <
- static_cast<uint64>(fake_packet_loss_percentage_)) {
+ static_cast<uint64_t>(fake_packet_loss_percentage_)) {
DVLOG(1) << "Dropping packet.";
return WriteResult(WRITE_STATUS_OK, buf_len);
}
if (fake_blocked_socket_percentage_ > 0 &&
simple_random_.RandUint64() % 100 <
- static_cast<uint64>(fake_blocked_socket_percentage_)) {
+ static_cast<uint64_t>(fake_blocked_socket_percentage_)) {
CHECK(on_can_write_.get() != nullptr);
DVLOG(1) << "Blocking socket.";
if (!write_unblocked_alarm_->IsSet()) {
@@ -162,7 +163,7 @@
// Determine if we should re-order.
if (delayed_packets_.size() > 1 && fake_packet_reorder_percentage_ > 0 &&
simple_random_.RandUint64() % 100 <
- static_cast<uint64>(fake_packet_reorder_percentage_)) {
+ static_cast<uint64_t>(fake_packet_reorder_percentage_)) {
DVLOG(1) << "Reordering packets.";
++iter;
// Swap the send times when re-ordering packets.
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.h b/net/tools/quic/test_tools/packet_dropping_test_writer.h
index 716571c3..ed5dc82f 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.h
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.h
@@ -5,11 +5,14 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <list>
#include <string>
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "net/quic/quic_alarm.h"
@@ -62,14 +65,14 @@
void OnCanWrite();
// The percent of time a packet is simulated as being lost.
- void set_fake_packet_loss_percentage(int32 fake_packet_loss_percentage) {
+ void set_fake_packet_loss_percentage(int32_t fake_packet_loss_percentage) {
base::AutoLock locked(config_mutex_);
fake_packet_loss_percentage_ = fake_packet_loss_percentage;
}
// Simulate dropping the first n packets unconditionally.
// Subsequent packets will be lost at fake_packet_loss_percentage_ if set.
- void set_fake_drop_first_n_packets(int32 fake_drop_first_n_packets) {
+ void set_fake_drop_first_n_packets(int32_t fake_drop_first_n_packets) {
base::AutoLock locked(config_mutex_);
fake_drop_first_n_packets_ = fake_drop_first_n_packets;
}
@@ -77,14 +80,14 @@
// The percent of time WritePacket will block and set WriteResult's status
// to WRITE_STATUS_BLOCKED.
void set_fake_blocked_socket_percentage(
- int32 fake_blocked_socket_percentage) {
+ int32_t fake_blocked_socket_percentage) {
DCHECK(clock_);
base::AutoLock locked(config_mutex_);
fake_blocked_socket_percentage_ = fake_blocked_socket_percentage;
}
// The percent of time a packet is simulated as being reordered.
- void set_fake_reorder_percentage(int32 fake_packet_reorder_percentage) {
+ void set_fake_reorder_percentage(int32_t fake_packet_reorder_percentage) {
DCHECK(clock_);
base::AutoLock locked(config_mutex_);
DCHECK(!fake_packet_delay_.IsZero());
@@ -111,7 +114,7 @@
}
// Useful for reproducing very flaky issues.
- void set_seed(uint64 seed) { simple_random_.set_seed(seed); }
+ void set_seed(uint64_t seed) { simple_random_.set_seed(seed); }
private:
// Writes out the next packet to the contained writer and returns the time
@@ -144,13 +147,13 @@
// Stored packets delayed by fake packet delay or bandwidth restrictions.
DelayedPacketList delayed_packets_;
QuicByteCount cur_buffer_size_;
- uint64 num_calls_to_write_;
+ uint64_t num_calls_to_write_;
base::Lock config_mutex_;
- int32 fake_packet_loss_percentage_;
- int32 fake_drop_first_n_packets_;
- int32 fake_blocked_socket_percentage_;
- int32 fake_packet_reorder_percentage_;
+ int32_t fake_packet_loss_percentage_;
+ int32_t fake_drop_first_n_packets_;
+ int32_t fake_blocked_socket_percentage_;
+ int32_t fake_packet_reorder_percentage_;
QuicTime::Delta fake_packet_delay_;
QuicBandwidth fake_bandwidth_;
QuicByteCount buffer_size_;
diff --git a/net/tools/quic/test_tools/quic_client_peer.h b/net/tools/quic/test_tools/quic_client_peer.h
index 32f96a7..9d9d103 100644
--- a/net/tools/quic/test_tools/quic_client_peer.h
+++ b/net/tools/quic/test_tools/quic_client_peer.h
@@ -5,7 +5,7 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_CLIENT_PEER_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_CLIENT_PEER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
namespace net {
diff --git a/net/tools/quic/test_tools/quic_dispatcher_peer.h b/net/tools/quic/test_tools/quic_dispatcher_peer.h
index 91ae56b..936e061b 100644
--- a/net/tools/quic/test_tools/quic_dispatcher_peer.h
+++ b/net/tools/quic/test_tools/quic_dispatcher_peer.h
@@ -7,6 +7,7 @@
#include "net/tools/quic/quic_dispatcher.h"
+#include "base/macros.h"
#include "net/base/ip_endpoint.h"
namespace net {
diff --git a/net/tools/quic/test_tools/quic_in_memory_cache_peer.h b/net/tools/quic/test_tools/quic_in_memory_cache_peer.h
index b5996bd..e7241099 100644
--- a/net/tools/quic/test_tools/quic_in_memory_cache_peer.h
+++ b/net/tools/quic/test_tools/quic_in_memory_cache_peer.h
@@ -5,6 +5,7 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_IN_MEMORY_CACHE_PEER_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_IN_MEMORY_CACHE_PEER_H_
+#include "base/macros.h"
#include "net/tools/quic/quic_in_memory_cache.h"
namespace net {
diff --git a/net/tools/quic/test_tools/quic_server_peer.h b/net/tools/quic/test_tools/quic_server_peer.h
index a9d4f56..ae3c149 100644
--- a/net/tools/quic/test_tools/quic_server_peer.h
+++ b/net/tools/quic/test_tools/quic_server_peer.h
@@ -5,7 +5,7 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_SERVER_PEER_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_SERVER_PEER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
namespace net {
diff --git a/net/tools/quic/test_tools/quic_test_client.cc b/net/tools/quic/test_tools/quic_test_client.cc
index ec657250..dcdfd85 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -314,7 +314,7 @@
return response_header_size_;
}
-int64 QuicTestClient::response_body_size() const {
+int64_t QuicTestClient::response_body_size() const {
return response_body_size_;
}
@@ -450,8 +450,8 @@
}
void QuicTestClient::WaitForResponseForMs(int timeout_ms) {
- int64 timeout_us = timeout_ms * base::Time::kMicrosecondsPerMillisecond;
- int64 old_timeout_us = epoll_server()->timeout_in_us();
+ int64_t timeout_us = timeout_ms * base::Time::kMicrosecondsPerMillisecond;
+ int64_t old_timeout_us = epoll_server()->timeout_in_us();
if (timeout_us > 0) {
epoll_server()->set_timeout_in_us(timeout_us);
}
@@ -471,8 +471,8 @@
}
void QuicTestClient::WaitForInitialResponseForMs(int timeout_ms) {
- int64 timeout_us = timeout_ms * base::Time::kMicrosecondsPerMillisecond;
- int64 old_timeout_us = epoll_server()->timeout_in_us();
+ int64_t timeout_us = timeout_ms * base::Time::kMicrosecondsPerMillisecond;
+ int64_t old_timeout_us = epoll_server()->timeout_in_us();
if (timeout_us > 0) {
epoll_server()->set_timeout_in_us(timeout_us);
}
@@ -516,7 +516,7 @@
return response_trailers_;
}
-int64 QuicTestClient::response_size() const {
+int64_t QuicTestClient::response_size() const {
return bytes_read_;
}
diff --git a/net/tools/quic/test_tools/quic_test_client.h b/net/tools/quic/test_tools/quic_test_client.h
index 319075d9..d4f27e9 100644
--- a/net/tools/quic/test_tools/quic_test_client.h
+++ b/net/tools/quic/test_tools/quic_test_client.h
@@ -5,9 +5,12 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/proto/cached_network_parameters.pb.h"
@@ -110,9 +113,9 @@
bool response_complete() const override;
bool response_headers_complete() const override;
const BalsaHeaders* response_headers() const override;
- int64 response_size() const override;
+ int64_t response_size() const override;
int response_header_size() const override;
- int64 response_body_size() const override;
+ int64_t response_body_size() const override;
size_t bytes_read() const override;
size_t bytes_written() const override;
bool buffer_body() const override;
@@ -235,12 +238,12 @@
SpdyPriority priority_;
std::string response_;
- uint64 bytes_read_;
- uint64 bytes_written_;
+ uint64_t bytes_read_;
+ uint64_t bytes_written_;
// The number of uncompressed HTTP header bytes received.
int response_header_size_;
// The number of HTTP body bytes received.
- int64 response_body_size_;
+ int64_t response_body_size_;
// True if we tried to connect already since the last call to Disconnect().
bool connect_attempted_;
// The client will auto-connect exactly once before sending data. If
diff --git a/net/tools/quic/test_tools/quic_test_server.h b/net/tools/quic/test_tools/quic_test_server.h
index 9e460e8d..09e3141 100644
--- a/net/tools/quic/test_tools/quic_test_server.h
+++ b/net/tools/quic/test_tools/quic_test_server.h
@@ -7,7 +7,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/quic_session.h"
diff --git a/net/tools/quic/test_tools/server_thread.h b/net/tools/quic/test_tools/server_thread.h
index cf87b75..e6cb97d 100644
--- a/net/tools/quic/test_tools/server_thread.h
+++ b/net/tools/quic/test_tools/server_thread.h
@@ -5,6 +5,7 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_
+#include "base/macros.h"
#include "base/threading/simple_thread.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/quic_config.h"
diff --git a/net/tools/quic/test_tools/simple_client.cc b/net/tools/quic/test_tools/simple_client.cc
index f6328ffb..8d3d51b 100644
--- a/net/tools/quic/test_tools/simple_client.cc
+++ b/net/tools/quic/test_tools/simple_client.cc
@@ -31,7 +31,7 @@
return 0;
}
-int64 SimpleClient::response_body_size() const {
+int64_t SimpleClient::response_body_size() const {
return 0;
}
diff --git a/net/tools/quic/test_tools/simple_client.h b/net/tools/quic/test_tools/simple_client.h
index 1c85dac..3222101 100644
--- a/net/tools/quic/test_tools/simple_client.h
+++ b/net/tools/quic/test_tools/simple_client.h
@@ -5,6 +5,9 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_SIMPLE_CLIENT_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_SIMPLE_CLIENT_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
@@ -115,7 +118,7 @@
virtual bool response_complete() const = 0;
// Returns the number of bytes read from the server during this request.
- virtual int64 response_size() const = 0;
+ virtual int64_t response_size() const = 0;
// Returns the number of header bytes received during this request, if
// meaningful for the protocol.
@@ -123,7 +126,7 @@
// Returns the number of body bytes received during this request, if
// meaningful for the protocol.
- virtual int64 response_body_size() const;
+ virtual int64_t response_body_size() const;
// Returns the response body, if there was one. If there was no response, or
// if buffer_body() is false, returns an empty string.
diff --git a/net/tools/stress_cache/stress_cache.cc b/net/tools/stress_cache/stress_cache.cc
index 29ddff2..0ba3ff7 100644
--- a/net/tools/stress_cache/stress_cache.cc
+++ b/net/tools/stress_cache/stress_cache.cc
@@ -296,7 +296,7 @@
// to know which instance of the application wrote them.
void StressTheCache(int iteration) {
int cache_size = 0x2000000; // 32MB.
- uint32 mask = 0xfff; // 4096 entries.
+ uint32_t mask = 0xfff; // 4096 entries.
base::FilePath path;
PathService::Get(base::DIR_TEMP, &path);
diff --git a/net/udp/udp_client_socket.h b/net/udp/udp_client_socket.h
index b10912d95..fc15904 100644
--- a/net/udp/udp_client_socket.h
+++ b/net/udp/udp_client_socket.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include "base/macros.h"
#include "net/base/rand_callback.h"
#include "net/log/net_log.h"
#include "net/udp/datagram_client_socket.h"
diff --git a/net/udp/udp_server_socket.h b/net/udp/udp_server_socket.h
index 3b075774..668ebcc4 100644
--- a/net/udp/udp_server_socket.h
+++ b/net/udp/udp_server_socket.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include "base/macros.h"
#include "net/base/completion_callback.h"
#include "net/base/ip_address_number.h"
#include "net/udp/datagram_server_socket.h"
diff --git a/net/udp/udp_socket_posix.h b/net/udp/udp_socket_posix.h
index 7ed60a7c..2219f2e6 100644
--- a/net/udp/udp_socket_posix.h
+++ b/net/udp/udp_socket_posix.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
diff --git a/net/udp/udp_socket_win.h b/net/udp/udp_socket_win.h
index b3ef3d6..ea72e28b 100644
--- a/net/udp/udp_socket_win.h
+++ b/net/udp/udp_socket_win.h
@@ -10,6 +10,7 @@
#include <winsock2.h>
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
diff --git a/net/url_request/data_protocol_handler.h b/net/url_request/data_protocol_handler.h
index cc0f7b85..bb4e093 100644
--- a/net/url_request/data_protocol_handler.h
+++ b/net/url_request/data_protocol_handler.h
@@ -5,8 +5,8 @@
#ifndef NET_URL_REQUEST_DATA_PROTOCOL_HANDLER_H_
#define NET_URL_REQUEST_DATA_PROTOCOL_HANDLER_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/url_request/url_request_job_factory.h"
namespace net {
diff --git a/net/url_request/file_protocol_handler.h b/net/url_request/file_protocol_handler.h
index 4ac81d35..4a66df15 100644
--- a/net/url_request/file_protocol_handler.h
+++ b/net/url_request/file_protocol_handler.h
@@ -5,8 +5,8 @@
#ifndef NET_URL_REQUEST_FILE_PROTOCOL_HANDLER_H_
#define NET_URL_REQUEST_FILE_PROTOCOL_HANDLER_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/url_request/url_request_job_factory.h"
diff --git a/net/url_request/ftp_protocol_handler.h b/net/url_request/ftp_protocol_handler.h
index a951e05..d13bf0b0 100644
--- a/net/url_request/ftp_protocol_handler.h
+++ b/net/url_request/ftp_protocol_handler.h
@@ -5,8 +5,8 @@
#ifndef NET_URL_REQUEST_FTP_PROTOCOL_HANDLER_H_
#define NET_URL_REQUEST_FTP_PROTOCOL_HANDLER_H_
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/url_request/url_request_job_factory.h"
diff --git a/net/url_request/http_user_agent_settings.h b/net/url_request/http_user_agent_settings.h
index 40eb1a6..54bdfac 100644
--- a/net/url_request/http_user_agent_settings.h
+++ b/net/url_request/http_user_agent_settings.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
class GURL;
diff --git a/net/url_request/sdch_dictionary_fetcher.cc b/net/url_request/sdch_dictionary_fetcher.cc
index 25ae1f2..1141aab 100644
--- a/net/url_request/sdch_dictionary_fetcher.cc
+++ b/net/url_request/sdch_dictionary_fetcher.cc
@@ -11,6 +11,7 @@
#include "base/auto_reset.h"
#include "base/bind.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/thread_task_runner_handle.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
diff --git a/net/url_request/static_http_user_agent_settings.h b/net/url_request/static_http_user_agent_settings.h
index 57bbd07..991af6af6 100644
--- a/net/url_request/static_http_user_agent_settings.h
+++ b/net/url_request/static_http_user_agent_settings.h
@@ -7,8 +7,8 @@
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/url_request/http_user_agent_settings.h"
diff --git a/net/url_request/test_url_fetcher_factory.cc b/net/url_request/test_url_fetcher_factory.cc
index 048b8dd..fb90566 100644
--- a/net/url_request/test_url_fetcher_factory.cc
+++ b/net/url_request/test_url_fetcher_factory.cc
@@ -72,8 +72,8 @@
void TestURLFetcher::SetUploadFilePath(
const std::string& upload_content_type,
const base::FilePath& file_path,
- uint64 range_offset,
- uint64 range_length,
+ uint64_t range_offset,
+ uint64_t range_length,
scoped_refptr<base::TaskRunner> file_task_runner) {
upload_file_path_ = file_path;
}
diff --git a/net/url_request/test_url_fetcher_factory.h b/net/url_request/test_url_fetcher_factory.h
index 75cdebf..014bf42 100644
--- a/net/url_request/test_url_fetcher_factory.h
+++ b/net/url_request/test_url_fetcher_factory.h
@@ -12,10 +12,10 @@
#include <string>
#include <utility>
-#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
@@ -94,8 +94,8 @@
void SetUploadFilePath(
const std::string& upload_content_type,
const base::FilePath& file_path,
- uint64 range_offset,
- uint64 range_length,
+ uint64_t range_offset,
+ uint64_t range_length,
scoped_refptr<base::TaskRunner> file_task_runner) override;
void SetUploadStreamFactory(
const std::string& upload_content_type,
@@ -232,7 +232,7 @@
bool write_response_file_;
bool fake_was_fetched_via_proxy_;
bool fake_was_cached_;
- int64 fake_response_bytes_;
+ int64_t fake_response_bytes_;
scoped_refptr<HttpResponseHeaders> fake_response_headers_;
HttpRequestHeaders fake_extra_request_headers_;
int fake_max_retries_;
diff --git a/net/url_request/test_url_request_interceptor.cc b/net/url_request/test_url_request_interceptor.cc
index 72aeea26..7b098f6 100644
--- a/net/url_request/test_url_request_interceptor.cc
+++ b/net/url_request/test_url_request_interceptor.cc
@@ -5,6 +5,7 @@
#include "net/url_request/test_url_request_interceptor.h"
#include "base/files/file_util.h"
+#include "base/macros.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_restrictions.h"
#include "net/url_request/url_request.h"
diff --git a/net/url_request/test_url_request_interceptor.h b/net/url_request/test_url_request_interceptor.h
index 4b084c5..c2ec40fc 100644
--- a/net/url_request/test_url_request_interceptor.h
+++ b/net/url_request/test_url_request_interceptor.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
class GURL;
diff --git a/net/url_request/url_fetcher.h b/net/url_request/url_fetcher.h
index f13b40310..c3a1a6fa 100644
--- a/net/url_request/url_fetcher.h
+++ b/net/url_request/url_fetcher.h
@@ -150,8 +150,8 @@
virtual void SetUploadFilePath(
const std::string& upload_content_type,
const base::FilePath& file_path,
- uint64 range_offset,
- uint64 range_length,
+ uint64_t range_offset,
+ uint64_t range_length,
scoped_refptr<base::TaskRunner> file_task_runner) = 0;
// Sets data only needed by POSTs. All callers making POST requests should
diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
index 1624912..7a2c5e32 100644
--- a/net/url_request/url_fetcher_core.cc
+++ b/net/url_request/url_fetcher_core.cc
@@ -155,8 +155,8 @@
void URLFetcherCore::SetUploadFilePath(
const std::string& upload_content_type,
const base::FilePath& file_path,
- uint64 range_offset,
- uint64 range_length,
+ uint64_t range_offset,
+ uint64_t range_length,
scoped_refptr<base::TaskRunner> file_task_runner) {
AssertHasNoUploadData();
DCHECK(!is_chunked_upload_);
@@ -659,7 +659,7 @@
}
if (original_url_throttler_entry_.get()) {
- int64 delay =
+ int64_t delay =
original_url_throttler_entry_->ReserveSendingTimeForNextRequest(
GetBackoffReleaseTime());
if (delay != 0) {
@@ -899,12 +899,12 @@
void URLFetcherCore::InformDelegateUploadProgress() {
DCHECK(network_task_runner_->BelongsToCurrentThread());
if (request_.get()) {
- int64 current = request_->GetUploadProgress().position();
+ int64_t current = request_->GetUploadProgress().position();
if (current_upload_bytes_ != current) {
current_upload_bytes_ = current;
- int64 total = -1;
+ int64_t total = -1;
if (!is_chunked_upload_) {
- total = static_cast<int64>(request_->GetUploadProgress().size());
+ total = static_cast<int64_t>(request_->GetUploadProgress().size());
// Total may be zero if the UploadDataStream::Init has not been called
// yet. Don't send the upload progress until the size is initialized.
if (!total)
@@ -920,7 +920,8 @@
}
void URLFetcherCore::InformDelegateUploadProgressInDelegateThread(
- int64 current, int64 total) {
+ int64_t current,
+ int64_t total) {
DCHECK(delegate_task_runner_->BelongsToCurrentThread());
if (delegate_)
delegate_->OnURLFetchUploadProgress(fetcher_, current, total);
@@ -942,7 +943,8 @@
}
void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread(
- int64 current, int64 total) {
+ int64_t current,
+ int64_t total) {
DCHECK(delegate_task_runner_->BelongsToCurrentThread());
if (delegate_)
delegate_->OnURLFetchDownloadProgress(fetcher_, current, total);
diff --git a/net/url_request/url_fetcher_core.h b/net/url_request/url_fetcher_core.h
index 0af6d14..ad40799 100644
--- a/net/url_request/url_fetcher_core.h
+++ b/net/url_request/url_fetcher_core.h
@@ -10,11 +10,11 @@
#include <set>
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/debug/stack_trace.h"
#include "base/files/file_path.h"
#include "base/lazy_instance.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/timer/timer.h"
@@ -68,8 +68,8 @@
const std::string& upload_content);
void SetUploadFilePath(const std::string& upload_content_type,
const base::FilePath& file_path,
- uint64 range_offset,
- uint64 range_length,
+ uint64_t range_offset,
+ uint64_t range_length,
scoped_refptr<base::TaskRunner> file_task_runner);
void SetUploadStreamFactory(
const std::string& upload_content_type,
@@ -215,10 +215,11 @@
// Notify Delegate about the progress of upload/download.
void InformDelegateUploadProgress();
- void InformDelegateUploadProgressInDelegateThread(int64 current, int64 total);
+ void InformDelegateUploadProgressInDelegateThread(int64_t current,
+ int64_t total);
void InformDelegateDownloadProgress();
- void InformDelegateDownloadProgressInDelegateThread(int64 current,
- int64 total);
+ void InformDelegateDownloadProgressInDelegateThread(int64_t current,
+ int64_t total);
// Check if any upload data is set or not.
void AssertHasNoUploadData() const;
@@ -258,9 +259,9 @@
bool upload_content_set_; // SetUploadData has been called
std::string upload_content_; // HTTP POST payload
base::FilePath upload_file_path_; // Path to file containing POST payload
- uint64 upload_range_offset_; // Offset from the beginning of the file
+ uint64_t upload_range_offset_; // Offset from the beginning of the file
// to be uploaded.
- uint64 upload_range_length_; // The length of the part of file to be
+ uint64_t upload_range_length_; // The length of the part of file to be
// uploaded.
URLFetcher::CreateUploadStreamCallback
upload_stream_factory_; // Callback to create HTTP POST payload.
@@ -328,11 +329,11 @@
// When crbug.com/119629 is fixed, scoped_ptr is not necessary here.
scoped_ptr<base::RepeatingTimer> upload_progress_checker_timer_;
// Number of bytes sent so far.
- int64 current_upload_bytes_;
+ int64_t current_upload_bytes_;
// Number of bytes received so far.
- int64 current_response_bytes_;
+ int64_t current_response_bytes_;
// Total expected bytes to receive (-1 if it cannot be determined).
- int64 total_response_bytes_;
+ int64_t total_response_bytes_;
// TODO(willchan): Get rid of this after debugging crbug.com/90971.
base::debug::StackTrace stack_trace_;
diff --git a/net/url_request/url_fetcher_delegate.cc b/net/url_request/url_fetcher_delegate.cc
index 4f7cd653..0d2edd9 100644
--- a/net/url_request/url_fetcher_delegate.cc
+++ b/net/url_request/url_fetcher_delegate.cc
@@ -6,11 +6,13 @@
namespace net {
-void URLFetcherDelegate::OnURLFetchDownloadProgress(
- const URLFetcher* source, int64 current, int64 total) {}
+void URLFetcherDelegate::OnURLFetchDownloadProgress(const URLFetcher* source,
+ int64_t current,
+ int64_t total) {}
-void URLFetcherDelegate::OnURLFetchUploadProgress(
- const URLFetcher* source, int64 current, int64 total) {}
+void URLFetcherDelegate::OnURLFetchUploadProgress(const URLFetcher* source,
+ int64_t current,
+ int64_t total) {}
URLFetcherDelegate::~URLFetcherDelegate() {}
diff --git a/net/url_request/url_fetcher_delegate.h b/net/url_request/url_fetcher_delegate.h
index e1b1352..1f5eb5dbe 100644
--- a/net/url_request/url_fetcher_delegate.h
+++ b/net/url_request/url_fetcher_delegate.h
@@ -5,9 +5,10 @@
#ifndef NET_URL_REQUEST_URL_FETCHER_DELEGATE_H_
#define NET_URL_REQUEST_URL_FETCHER_DELEGATE_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
@@ -26,13 +27,15 @@
// denotes the number of bytes received up to the call, and |total| is the
// expected total size of the response (or -1 if not determined).
virtual void OnURLFetchDownloadProgress(const URLFetcher* source,
- int64 current, int64 total);
+ int64_t current,
+ int64_t total);
// This will be called when uploading of POST or PUT requests proceeded.
// |current| denotes the number of bytes sent so far, and |total| is the
// total size of uploading data (or -1 if chunked upload is enabled).
virtual void OnURLFetchUploadProgress(const URLFetcher* source,
- int64 current, int64 total);
+ int64_t current,
+ int64_t total);
protected:
virtual ~URLFetcherDelegate();
diff --git a/net/url_request/url_fetcher_response_writer.h b/net/url_request/url_fetcher_response_writer.h
index fb99522..891123a6 100644
--- a/net/url_request/url_fetcher_response_writer.h
+++ b/net/url_request/url_fetcher_response_writer.h
@@ -7,8 +7,8 @@
#include <string>
-#include "base/basictypes.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index e4085fc..ea6a54d 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -12,6 +12,7 @@
#include "base/debug/leak_tracker.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "base/supports_user_data.h"
@@ -521,7 +522,7 @@
const URLRequestStatus& status() const { return status_; }
// Returns a globally unique identifier for this request.
- uint64 identifier() const { return identifier_; }
+ uint64_t identifier() const { return identifier_; }
// This method is called to start the request. The delegate will receive
// a OnResponseStarted callback when the request is started. The request
diff --git a/net/url_request/url_request_backoff_manager.cc b/net/url_request/url_request_backoff_manager.cc
index f1010ef..86fa965 100644
--- a/net/url_request/url_request_backoff_manager.cc
+++ b/net/url_request/url_request_backoff_manager.cc
@@ -12,9 +12,9 @@
namespace net {
-const uint16 URLRequestBackoffManager::kMinimumBackoffInSeconds = 1;
-const uint16 URLRequestBackoffManager::kMaximumBackoffInSeconds = 50000;
-const uint16 URLRequestBackoffManager::kNewEntriesBetweenCollecting = 200;
+const uint16_t URLRequestBackoffManager::kMinimumBackoffInSeconds = 1;
+const uint16_t URLRequestBackoffManager::kMaximumBackoffInSeconds = 50000;
+const uint16_t URLRequestBackoffManager::kNewEntriesBetweenCollecting = 200;
URLRequestBackoffManager::URLRequestBackoffManager()
: new_entries_since_last_gc_(0) {
@@ -113,7 +113,7 @@
std::string value;
void* iter = NULL;
while (headers->EnumerateHeader(&iter, name, &value)) {
- int64 seconds;
+ int64_t seconds;
base::StringToInt64(value, &seconds);
if (seconds >= kMinimumBackoffInSeconds &&
seconds <= kMaximumBackoffInSeconds) {
diff --git a/net/url_request/url_request_backoff_manager.h b/net/url_request/url_request_backoff_manager.h
index 232ebdc..2aceb742 100644
--- a/net/url_request/url_request_backoff_manager.h
+++ b/net/url_request/url_request_backoff_manager.h
@@ -5,10 +5,12 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_BACKOFF_MANAGER_H_
#define NET_URL_REQUEST_URL_REQUEST_BACKOFF_MANAGER_H_
+#include <stdint.h>
+
#include <map>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
@@ -40,11 +42,11 @@
public NetworkChangeNotifier::ConnectionTypeObserver {
public:
// Minimum number of seconds that a Backoff header can specify.
- static const uint16 kMinimumBackoffInSeconds;
+ static const uint16_t kMinimumBackoffInSeconds;
// Maximum number of seconds that a Backoff header can specify.
- static const uint16 kMaximumBackoffInSeconds;
+ static const uint16_t kMaximumBackoffInSeconds;
// Number of throttled requests that will be made between garbage collection.
- static const uint16 kNewEntriesBetweenCollecting;
+ static const uint16_t kNewEntriesBetweenCollecting;
URLRequestBackoffManager();
~URLRequestBackoffManager() override;
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h
index b9f1276d..bb1486e 100644
--- a/net/url_request/url_request_context.h
+++ b/net/url_request/url_request_context.h
@@ -13,6 +13,7 @@
#include <set>
#include <string>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index 1998750..734292b 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -7,9 +7,9 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
diff --git a/net/url_request/url_request_context_builder.h b/net/url_request/url_request_context_builder.h
index 735947dd..6e8b45a 100644
--- a/net/url_request/url_request_context_builder.h
+++ b/net/url_request/url_request_context_builder.h
@@ -14,10 +14,12 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_
#define NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
@@ -79,8 +81,8 @@
// These fields mirror those in HttpNetworkSession::Params;
bool ignore_certificate_errors;
HostMappingRules* host_mapping_rules;
- uint16 testing_fixed_http_port;
- uint16 testing_fixed_https_port;
+ uint16_t testing_fixed_http_port;
+ uint16_t testing_fixed_https_port;
NextProtoVector next_protos;
std::string trusted_spdy_proxy;
bool use_alternative_services;
diff --git a/net/url_request/url_request_context_storage.h b/net/url_request/url_request_context_storage.h
index 77c2807a..f05e186 100644
--- a/net/url_request/url_request_context_storage.h
+++ b/net/url_request/url_request_context_storage.h
@@ -5,7 +5,7 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_
#define NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
diff --git a/net/url_request/url_request_data_job.h b/net/url_request/url_request_data_job.h
index 0b3c7fa..9fb033d 100644
--- a/net/url_request/url_request_data_job.h
+++ b/net/url_request/url_request_data_job.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_simple_job.h"
diff --git a/net/url_request/url_request_file_dir_job.h b/net/url_request/url_request_file_dir_job.h
index f7a7b45..a5db178 100644
--- a/net/url_request/url_request_file_dir_job.h
+++ b/net/url_request/url_request_file_dir_job.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/directory_lister.h"
#include "net/base/net_errors.h"
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index 729f28c7..d853c9fd 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -184,8 +184,7 @@
}
}
-void URLRequestFileJob::OnSeekComplete(int64 result) {
-}
+void URLRequestFileJob::OnSeekComplete(int64_t result) {}
void URLRequestFileJob::OnReadComplete(IOBuffer* buf, int result) {
}
@@ -276,7 +275,7 @@
}
}
-void URLRequestFileJob::DidSeek(int64 result) {
+void URLRequestFileJob::DidSeek(int64_t result) {
OnSeekComplete(result);
if (result != byte_range_.first_byte_position()) {
NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED,
diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h
index 97c6c21..6aa2bbe 100644
--- a/net/url_request/url_request_file_job.h
+++ b/net/url_request/url_request_file_job.h
@@ -5,10 +5,13 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_
#define NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "net/base/net_errors.h"
@@ -46,13 +49,13 @@
void SetExtraRequestHeaders(const HttpRequestHeaders& headers) override;
// An interface for subclasses who wish to monitor read operations.
- virtual void OnSeekComplete(int64 result);
+ virtual void OnSeekComplete(int64_t result);
virtual void OnReadComplete(IOBuffer* buf, int result);
protected:
~URLRequestFileJob() override;
- int64 remaining_bytes() const { return remaining_bytes_; }
+ int64_t remaining_bytes() const { return remaining_bytes_; }
// The OS-specific full path name of the file
base::FilePath file_path_;
@@ -65,7 +68,7 @@
FileMetaInfo();
// Size of the file.
- int64 file_size;
+ int64_t file_size;
// Mime type associated with the file.
std::string mime_type;
// Result returned from GetMimeTypeFromFile(), i.e. flag showing whether
@@ -89,7 +92,7 @@
// Callback after seeking to the beginning of |byte_range_| in the file
// on a background thread.
- void DidSeek(int64 result);
+ void DidSeek(int64_t result);
// Callback after data is asynchronously read from the file into |buf|.
void DidRead(scoped_refptr<IOBuffer> buf, int result);
@@ -100,7 +103,7 @@
std::vector<HttpByteRange> byte_ranges_;
HttpByteRange byte_range_;
- int64 remaining_bytes_;
+ int64_t remaining_bytes_;
Error range_parse_result_;
diff --git a/net/url_request/url_request_file_job_unittest.cc b/net/url_request/url_request_file_job_unittest.cc
index 17af363f..d8e0691 100644
--- a/net/url_request/url_request_file_job_unittest.cc
+++ b/net/url_request/url_request_file_job_unittest.cc
@@ -33,7 +33,7 @@
NetworkDelegate* network_delegate,
const base::FilePath& file_path,
const scoped_refptr<base::TaskRunner>& file_task_runner,
- int64* seek_position,
+ int64_t* seek_position,
std::string* observed_content)
: URLRequestFileJob(request,
network_delegate,
@@ -48,7 +48,7 @@
~TestURLRequestFileJob() override {}
protected:
- void OnSeekComplete(int64 result) override {
+ void OnSeekComplete(int64_t result) override {
ASSERT_EQ(*seek_position_, 0);
*seek_position_ = result;
}
@@ -57,7 +57,7 @@
observed_content_->append(std::string(buf->data(), result));
}
- int64* const seek_position_;
+ int64_t* const seek_position_;
std::string* const observed_content_;
};
@@ -66,7 +66,7 @@
class TestJobFactory : public URLRequestJobFactory {
public:
TestJobFactory(const base::FilePath& path,
- int64* seek_position,
+ int64_t* seek_position,
std::string* observed_content)
: path_(path),
seek_position_(seek_position),
@@ -119,7 +119,7 @@
const base::FilePath path_;
// These are mutable because MaybeCreateJobWithProtocolHandler is const.
- mutable int64* seek_position_;
+ mutable int64_t* seek_position_;
mutable std::string* observed_content_;
};
@@ -183,7 +183,7 @@
ASSERT_TRUE(CreateTempFileWithContent(content, directory, &path));
{
- int64 seek_position;
+ int64_t seek_position;
std::string observed_content;
TestJobFactory factory(path, &seek_position, &observed_content);
context_.set_job_factory(&factory);
diff --git a/net/url_request/url_request_filter.h b/net/url_request/url_request_filter.h
index 9dfac65..0bd2f59 100644
--- a/net/url_request/url_request_filter.h
+++ b/net/url_request/url_request_filter.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/containers/hash_tables.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/url_request/url_request_interceptor.h"
diff --git a/net/url_request/url_request_filter_unittest.cc b/net/url_request/url_request_filter_unittest.cc
index fc319bb..784f9a6 100644
--- a/net/url_request/url_request_filter_unittest.cc
+++ b/net/url_request/url_request_filter_unittest.cc
@@ -4,6 +4,7 @@
#include "net/url_request/url_request_filter.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/request_priority.h"
#include "net/url_request/url_request.h"
diff --git a/net/url_request/url_request_ftp_job.h b/net/url_request/url_request_ftp_job.h
index 6315d8f..227a33b 100644
--- a/net/url_request/url_request_ftp_job.h
+++ b/net/url_request/url_request_ftp_job.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/auth.h"
#include "net/base/net_export.h"
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 4ff32e91..2155ea9a 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/file_version_info.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/profiler/scoped_tracker.h"
@@ -68,7 +69,7 @@
base::Time GetRequestTime() const override;
bool IsCachedContent() const override;
SdchManager::DictionarySet* SdchDictionariesAdvertised() const override;
- int64 GetByteReadCount() const override;
+ int64_t GetByteReadCount() const override;
int GetResponseCode() const override;
const URLRequestContext* GetURLRequestContext() const override;
void RecordPacketStats(StatisticSelector statistic) const override;
@@ -117,7 +118,7 @@
return job_->dictionaries_advertised_.get();
}
-int64 URLRequestHttpJob::HttpFilterContext::GetByteReadCount() const {
+int64_t URLRequestHttpJob::HttpFilterContext::GetByteReadCount() const {
return job_->prefilter_bytes_read();
}
@@ -1323,7 +1324,8 @@
if (rv == ERR_CONTENT_LENGTH_MISMATCH ||
rv == ERR_INCOMPLETE_CHUNKED_ENCODING) {
if (request_ && request_->response_headers()) {
- int64 expected_length = request_->response_headers()->GetContentLength();
+ int64_t expected_length =
+ request_->response_headers()->GetContentLength();
VLOG(1) << __FUNCTION__ << "() "
<< "\"" << request_->url().spec() << "\""
<< " content-length = " << expected_length
@@ -1371,7 +1373,7 @@
return transaction_->GetFullRequestHeaders(headers);
}
-int64 URLRequestHttpJob::GetTotalReceivedBytes() const {
+int64_t URLRequestHttpJob::GetTotalReceivedBytes() const {
int64_t total_received_bytes =
total_received_bytes_from_previous_transactions_;
if (transaction_)
diff --git a/net/url_request/url_request_http_job.h b/net/url_request/url_request_http_job.h
index d39d739d..79b4aa9 100644
--- a/net/url_request/url_request_http_job.h
+++ b/net/url_request/url_request_http_job.h
@@ -5,12 +5,14 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_
#define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_
+#include <stddef.h>
#include <stdint.h>
#include <string>
#include <vector>
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
@@ -135,7 +137,7 @@
int ReadRawData(IOBuffer* buf, int buf_size) override;
void StopCaching() override;
bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override;
- int64 GetTotalReceivedBytes() const override;
+ int64_t GetTotalReceivedBytes() const override;
int64_t GetTotalSentBytes() const override;
void DoneReading() override;
void DoneReadingRedirectResponse() override;
@@ -238,7 +240,7 @@
// The number of bytes that have been accounted for in packets (where some of
// those packets may possibly have had their time of arrival recorded).
- int64 bytes_observed_in_packets_;
+ int64_t bytes_observed_in_packets_;
// The request time may not be available when we are being destroyed, so we
// snapshot it early on.
diff --git a/net/url_request/url_request_intercepting_job_factory.h b/net/url_request/url_request_intercepting_job_factory.h
index 056b385..7dcb353c 100644
--- a/net/url_request/url_request_intercepting_job_factory.h
+++ b/net/url_request/url_request_intercepting_job_factory.h
@@ -7,8 +7,8 @@
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/url_request/url_request_job_factory.h"
diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h
index d53a8493..2fbf70e 100644
--- a/net/url_request/url_request_job.h
+++ b/net/url_request/url_request_job.h
@@ -214,8 +214,8 @@
bool is_done() const { return done_; }
// Get/Set expected content size
- int64 expected_content_size() const { return expected_content_size_; }
- void set_expected_content_size(const int64& size) {
+ int64_t expected_content_size() const { return expected_content_size_; }
+ void set_expected_content_size(const int64_t& size) {
expected_content_size_ = size;
}
@@ -345,11 +345,11 @@
// The number of bytes read before passing to the filter. This value reflects
// bytes read even when there is no filter.
- int64 prefilter_bytes_read() const { return prefilter_bytes_read_; }
+ int64_t prefilter_bytes_read() const { return prefilter_bytes_read_; }
// The number of bytes read after passing through the filter. This value
// reflects bytes read even when there is no filter.
- int64 postfilter_bytes_read() const { return postfilter_bytes_read_; }
+ int64_t postfilter_bytes_read() const { return postfilter_bytes_read_; }
// Turns an integer result code into an Error and a count of bytes read.
// The semantics are:
@@ -426,8 +426,8 @@
// NotifyDone so that it is kept in sync with the request.
bool done_;
- int64 prefilter_bytes_read_;
- int64 postfilter_bytes_read_;
+ int64_t prefilter_bytes_read_;
+ int64_t postfilter_bytes_read_;
// The data stream filter which is enabled on demand.
scoped_ptr<Filter> filter_;
@@ -452,7 +452,7 @@
bool has_handled_response_;
// Expected content size
- int64 expected_content_size_;
+ int64_t expected_content_size_;
// Set when a redirect is deferred.
RedirectInfo deferred_redirect_info_;
diff --git a/net/url_request/url_request_job_factory.h b/net/url_request/url_request_job_factory.h
index 96f218a..4df4cd7 100644
--- a/net/url_request/url_request_job_factory.h
+++ b/net/url_request/url_request_job_factory.h
@@ -7,8 +7,8 @@
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/threading/non_thread_safe.h"
#include "net/base/net_export.h"
diff --git a/net/url_request/url_request_job_factory_impl.h b/net/url_request/url_request_job_factory_impl.h
index cba11248..6aafa74 100644
--- a/net/url_request/url_request_job_factory_impl.h
+++ b/net/url_request/url_request_job_factory_impl.h
@@ -8,8 +8,8 @@
#include <map>
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/url_request/url_request_job_factory.h"
diff --git a/net/url_request/url_request_job_manager.h b/net/url_request/url_request_job_manager.h
index 422a98216..ab67c8a9 100644
--- a/net/url_request/url_request_job_manager.h
+++ b/net/url_request/url_request_job_manager.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "base/threading/thread_checker.h"
#include "net/base/net_export.h"
#include "net/url_request/url_request.h"
diff --git a/net/url_request/url_request_netlog_params.cc b/net/url_request/url_request_netlog_params.cc
index 6573f2b..14fb4531 100644
--- a/net/url_request/url_request_netlog_params.cc
+++ b/net/url_request/url_request_netlog_params.cc
@@ -15,7 +15,7 @@
const std::string* method,
int load_flags,
RequestPriority priority,
- int64 upload_id,
+ int64_t upload_id,
NetLogCaptureMode /* capture_mode */) {
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("url", url->possibly_invalid_spec());
diff --git a/net/url_request/url_request_netlog_params.h b/net/url_request/url_request_netlog_params.h
index 82c4aaa..13dd2d1 100644
--- a/net/url_request/url_request_netlog_params.h
+++ b/net/url_request/url_request_netlog_params.h
@@ -5,6 +5,8 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_NETLOG_PARAMS_H_
#define NET_URL_REQUEST_URL_REQUEST_NETLOG_PARAMS_H_
+#include <stdint.h>
+
#include <string>
#include "net/base/net_export.h"
@@ -25,7 +27,7 @@
const std::string* method,
int load_flags,
RequestPriority priority,
- int64 upload_id,
+ int64_t upload_id,
NetLogCaptureMode /* capture_mode */);
} // namespace net
diff --git a/net/url_request/url_request_simple_job.cc b/net/url_request/url_request_simple_job.cc
index c12555d4..0f7104ff 100644
--- a/net/url_request/url_request_simple_job.cc
+++ b/net/url_request/url_request_simple_job.cc
@@ -26,7 +26,7 @@
void CopyData(const scoped_refptr<IOBuffer>& buf,
int buf_size,
const scoped_refptr<base::RefCountedMemory>& data,
- int64 data_offset) {
+ int64_t data_offset) {
memcpy(buf->data(), data->front() + data_offset, buf_size);
}
@@ -66,7 +66,7 @@
URLRequestSimpleJob::~URLRequestSimpleJob() {}
int URLRequestSimpleJob::ReadRawData(IOBuffer* buf, int buf_size) {
- buf_size = std::min(static_cast<int64>(buf_size),
+ buf_size = std::min(static_cast<int64_t>(buf_size),
byte_range_.last_byte_position() - next_data_offset_ + 1);
if (buf_size == 0)
return 0;
diff --git a/net/url_request/url_request_simple_job.h b/net/url_request/url_request_simple_job.h
index 06f718e..14f92a9a 100644
--- a/net/url_request/url_request_simple_job.h
+++ b/net/url_request/url_request_simple_job.h
@@ -5,6 +5,8 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_SIMPLE_JOB_H_
#define NET_URL_REQUEST_URL_REQUEST_SIMPLE_JOB_H_
+#include <stdint.h>
+
#include <string>
#include "base/memory/ref_counted.h"
@@ -71,7 +73,7 @@
std::string mime_type_;
std::string charset_;
scoped_refptr<base::RefCountedMemory> data_;
- int64 next_data_offset_;
+ int64_t next_data_offset_;
scoped_refptr<base::TaskRunner> task_runner_;
base::WeakPtrFactory<URLRequestSimpleJob> weak_factory_;
};
diff --git a/net/url_request/url_request_simple_job_unittest.cc b/net/url_request/url_request_simple_job_unittest.cc
index 08c08fb..f123bed 100644
--- a/net/url_request/url_request_simple_job_unittest.cc
+++ b/net/url_request/url_request_simple_job_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/bind_helpers.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h
index 819421dad..63e36c1 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -11,7 +11,6 @@
#include <map>
#include <string>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc
index 8b7aa79..8b8fae9 100644
--- a/net/url_request/url_request_throttler_entry.cc
+++ b/net/url_request/url_request_throttler_entry.cc
@@ -167,7 +167,7 @@
return reject_request;
}
-int64 URLRequestThrottlerEntry::ReserveSendingTimeForNextRequest(
+int64_t URLRequestThrottlerEntry::ReserveSendingTimeForNextRequest(
const base::TimeTicks& earliest_time) {
base::TimeTicks now = ImplGetTimeNow();
diff --git a/net/url_request/url_request_throttler_entry.h b/net/url_request/url_request_throttler_entry.h
index 264766a..bd64c26 100644
--- a/net/url_request/url_request_throttler_entry.h
+++ b/net/url_request/url_request_throttler_entry.h
@@ -5,10 +5,12 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_
#define NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_H_
+#include <stdint.h>
+
#include <queue>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/time/time.h"
#include "net/base/backoff_entry.h"
#include "net/log/net_log.h"
@@ -86,7 +88,7 @@
// Implementation of URLRequestThrottlerEntryInterface.
bool ShouldRejectRequest(const URLRequest& request) const override;
- int64 ReserveSendingTimeForNextRequest(
+ int64_t ReserveSendingTimeForNextRequest(
const base::TimeTicks& earliest_time) override;
base::TimeTicks GetExponentialBackoffReleaseTime() const override;
void UpdateWithResponse(int status_code) override;
diff --git a/net/url_request/url_request_throttler_entry_interface.h b/net/url_request/url_request_throttler_entry_interface.h
index f08d352..44a5612 100644
--- a/net/url_request/url_request_throttler_entry_interface.h
+++ b/net/url_request/url_request_throttler_entry_interface.h
@@ -5,9 +5,11 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
#define NET_URL_REQUEST_URL_REQUEST_THROTTLER_ENTRY_INTERFACE_H_
+#include <stdint.h>
+
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
@@ -41,7 +43,7 @@
// milliseconds. The return value is always positive or 0.
// Although it is not mandatory, respecting the value returned by this method
// is helpful to avoid traffic overload.
- virtual int64 ReserveSendingTimeForNextRequest(
+ virtual int64_t ReserveSendingTimeForNextRequest(
const base::TimeTicks& earliest_time) = 0;
// Returns the time after which requests are allowed.
diff --git a/net/url_request/url_request_throttler_manager.h b/net/url_request/url_request_throttler_manager.h
index dbc48ac..855ef931 100644
--- a/net/url_request/url_request_throttler_manager.h
+++ b/net/url_request/url_request_throttler_manager.h
@@ -9,7 +9,7 @@
#include <set>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h"
#include "base/threading/platform_thread.h"
diff --git a/net/url_request/url_request_throttler_simulation_unittest.cc b/net/url_request/url_request_throttler_simulation_unittest.cc
index 17183f73..d5ef39a 100644
--- a/net/url_request/url_request_throttler_simulation_unittest.cc
+++ b/net/url_request/url_request_throttler_simulation_unittest.cc
@@ -17,6 +17,7 @@
#include <vector>
#include "base/environment.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/rand_util.h"
#include "base/time/time.h"
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index cf34139..6811c8f2 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -22,6 +22,7 @@
#include "base/format_macros.h"
#include "base/json/json_reader.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
diff --git a/net/url_request/view_cache_helper.h b/net/url_request/view_cache_helper.h
index 18db22e2..4ab0031 100644
--- a/net/url_request/view_cache_helper.h
+++ b/net/url_request/view_cache_helper.h
@@ -5,8 +5,11 @@
#ifndef NET_URL_REQUEST_VIEW_CACHE_HELPER_H_
#define NET_URL_REQUEST_VIEW_CACHE_HELPER_H_
+#include <stddef.h>
+
#include <string>
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "net/base/completion_callback.h"
#include "net/base/io_buffer.h"
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index f26a012..0fb1787 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -15,6 +15,7 @@
#include "base/big_endian.h"
#include "base/bind.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_macros.h"
diff --git a/net/websockets/websocket_channel.h b/net/websockets/websocket_channel.h
index 612c8d95..a5642704 100644
--- a/net/websockets/websocket_channel.h
+++ b/net/websockets/websocket_channel.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_
#include <stdint.h>
+
#include <queue>
#include <string>
#include <vector>
diff --git a/net/websockets/websocket_channel_test.cc b/net/websockets/websocket_channel_test.cc
index da5acddc..90d26df 100644
--- a/net/websockets/websocket_channel_test.cc
+++ b/net/websockets/websocket_channel_test.cc
@@ -17,6 +17,7 @@
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
diff --git a/net/websockets/websocket_deflate_parameters.h b/net/websockets/websocket_deflate_parameters.h
index a377e52..1898e1d 100644
--- a/net/websockets/websocket_deflate_parameters.h
+++ b/net/websockets/websocket_deflate_parameters.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_DEFLATE_PARAMETERS_H_
#include <stdint.h>
+
#include <string>
#include "base/logging.h"
diff --git a/net/websockets/websocket_deflate_predictor.h b/net/websockets/websocket_deflate_predictor.h
index 4b7b7783..38566dd 100644
--- a/net/websockets/websocket_deflate_predictor.h
+++ b/net/websockets/websocket_deflate_predictor.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_DEFLATE_PREDICTOR_H_
#include <stddef.h>
+
#include <vector>
#include "base/memory/scoped_ptr.h"
diff --git a/net/websockets/websocket_deflate_predictor_impl.h b/net/websockets/websocket_deflate_predictor_impl.h
index ea751fe1..6086431 100644
--- a/net/websockets/websocket_deflate_predictor_impl.h
+++ b/net/websockets/websocket_deflate_predictor_impl.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_DEFLATE_PREDICTOR_IMPL_H_
#include <stddef.h>
+
#include <vector>
#include "base/memory/scoped_ptr.h"
diff --git a/net/websockets/websocket_deflate_stream.h b/net/websockets/websocket_deflate_stream.h
index 470be41..6143d0d 100644
--- a/net/websockets/websocket_deflate_stream.h
+++ b/net/websockets/websocket_deflate_stream.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_DEFLATE_STREAM_H_
#include <stddef.h>
+
#include <string>
#include <vector>
diff --git a/net/websockets/websocket_deflate_stream_test.cc b/net/websockets/websocket_deflate_stream_test.cc
index 28d34999..a470e2a2 100644
--- a/net/websockets/websocket_deflate_stream_test.cc
+++ b/net/websockets/websocket_deflate_stream_test.cc
@@ -13,6 +13,7 @@
#include <vector>
#include "base/bind.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
diff --git a/net/websockets/websocket_deflater.h b/net/websockets/websocket_deflater.h
index e0b7ca6..9b34c857 100644
--- a/net/websockets/websocket_deflater.h
+++ b/net/websockets/websocket_deflater.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_DEFLATER_H_
#include <stddef.h>
+
#include <deque>
#include <vector>
diff --git a/net/websockets/websocket_end_to_end_test.cc b/net/websockets/websocket_end_to_end_test.cc
index c8cb10e..bb1d951 100644
--- a/net/websockets/websocket_end_to_end_test.cc
+++ b/net/websockets/websocket_end_to_end_test.cc
@@ -15,6 +15,7 @@
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/location.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
diff --git a/net/websockets/websocket_event_interface.h b/net/websockets/websocket_event_interface.h
index 64340d45..25e12a0 100644
--- a/net/websockets/websocket_event_interface.h
+++ b/net/websockets/websocket_event_interface.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_
#include <stdint.h>
+
#include <string>
#include <vector>
diff --git a/net/websockets/websocket_extension_parser.h b/net/websockets/websocket_extension_parser.h
index 007040de..365cbf6 100644
--- a/net/websockets/websocket_extension_parser.h
+++ b/net/websockets/websocket_extension_parser.h
@@ -5,10 +5,13 @@
#ifndef NET_WEBSOCKETS_WEBSOCKET_EXTENSION_PARSER_H_
#define NET_WEBSOCKETS_WEBSOCKET_EXTENSION_PARSER_H_
+#include <stddef.h>
+
#include <string>
#include <vector>
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/websockets/websocket_extension.h"
diff --git a/net/websockets/websocket_frame.h b/net/websockets/websocket_frame.h
index 438f249..7e85a3c9 100644
--- a/net/websockets/websocket_frame.h
+++ b/net/websockets/websocket_frame.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_FRAME_H_
#include <stdint.h>
+
#include <vector>
#include "base/macros.h"
diff --git a/net/websockets/websocket_frame_parser.h b/net/websockets/websocket_frame_parser.h
index ac296cd..250541b 100644
--- a/net/websockets/websocket_frame_parser.h
+++ b/net/websockets/websocket_frame_parser.h
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+
#include <vector>
#include "base/macros.h"
diff --git a/net/websockets/websocket_handshake_request_info.h b/net/websockets/websocket_handshake_request_info.h
index e5ef3369..871d130 100644
--- a/net/websockets/websocket_handshake_request_info.h
+++ b/net/websockets/websocket_handshake_request_info.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
#include "net/http/http_request_headers.h"
diff --git a/net/websockets/websocket_handshake_response_info.h b/net/websockets/websocket_handshake_response_info.h
index 66aff44..42a2662d 100644
--- a/net/websockets/websocket_handshake_response_info.h
+++ b/net/websockets/websocket_handshake_response_info.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
diff --git a/net/websockets/websocket_handshake_stream_create_helper.h b/net/websockets/websocket_handshake_stream_create_helper.h
index 83bb1ac..2494f1406c 100644
--- a/net/websockets/websocket_handshake_stream_create_helper.h
+++ b/net/websockets/websocket_handshake_stream_create_helper.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/websockets/websocket_handshake_stream_base.h"
diff --git a/net/websockets/websocket_handshake_stream_create_helper_test.cc b/net/websockets/websocket_handshake_stream_create_helper_test.cc
index 17a388a..de16ae1 100644
--- a/net/websockets/websocket_handshake_stream_create_helper_test.cc
+++ b/net/websockets/websocket_handshake_stream_create_helper_test.cc
@@ -7,6 +7,7 @@
#include <string>
#include <vector>
+#include "base/macros.h"
#include "net/base/completion_callback.h"
#include "net/base/net_errors.h"
#include "net/http/http_request_headers.h"
diff --git a/net/websockets/websocket_inflater.h b/net/websockets/websocket_inflater.h
index d062867..e695fa1d 100644
--- a/net/websockets/websocket_inflater.h
+++ b/net/websockets/websocket_inflater.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_INFLATER_H_
#include <stddef.h>
+
#include <deque>
#include <utility>
#include <vector>
diff --git a/net/websockets/websocket_stream_create_test_base.cc b/net/websockets/websocket_stream_create_test_base.cc
index fa70198..5c0a299 100644
--- a/net/websockets/websocket_stream_create_test_base.cc
+++ b/net/websockets/websocket_stream_create_test_base.cc
@@ -5,6 +5,7 @@
#include "net/websockets/websocket_stream_create_test_base.h"
#include "base/callback.h"
+#include "base/macros.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/websockets/websocket_basic_handshake_stream.h"
diff --git a/net/websockets/websocket_stream_create_test_base.h b/net/websockets/websocket_stream_create_test_base.h
index 8fbb48d..ca4d85057 100644
--- a/net/websockets/websocket_stream_create_test_base.h
+++ b/net/websockets/websocket_stream_create_test_base.h
@@ -9,6 +9,7 @@
#include <utility>
#include <vector>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "base/timer/timer.h"
diff --git a/net/websockets/websocket_stream_test.cc b/net/websockets/websocket_stream_test.cc
index 9467e09c..962de90 100644
--- a/net/websockets/websocket_stream_test.cc
+++ b/net/websockets/websocket_stream_test.cc
@@ -10,6 +10,7 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_samples.h"
#include "base/metrics/statistics_recorder.h"
diff --git a/net/websockets/websocket_test_util.h b/net/websockets/websocket_test_util.h
index 49abf74..054c6766 100644
--- a/net/websockets/websocket_test_util.h
+++ b/net/websockets/websocket_test_util.h
@@ -6,6 +6,7 @@
#define NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_
#include <stdint.h>
+
#include <string>
#include "base/macros.h"