summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
Diffstat (limited to 'net/http')
-rw-r--r--net/http/des.cc8
-rw-r--r--net/http/des.h10
-rw-r--r--net/http/des_unittest.cc24
-rw-r--r--net/http/disk_based_cert_cache.h3
-rw-r--r--net/http/disk_cache_based_quic_server_info.cc2
-rw-r--r--net/http/disk_cache_based_quic_server_info.h1
-rw-r--r--net/http/disk_cache_based_quic_server_info_unittest.cc1
-rw-r--r--net/http/failing_http_transaction_factory.cc2
-rw-r--r--net/http/http_auth.cc1
-rw-r--r--net/http/http_auth_cache.h2
-rw-r--r--net/http/http_auth_controller.h1
-rw-r--r--net/http/http_auth_filter.h1
-rw-r--r--net/http/http_auth_filter_unittest.cc1
-rw-r--r--net/http/http_auth_gssapi_posix.cc1
-rw-r--r--net/http/http_auth_gssapi_posix.h1
-rw-r--r--net/http/http_auth_gssapi_posix_unittest.cc1
-rw-r--r--net/http/http_auth_handler_basic_unittest.cc1
-rw-r--r--net/http/http_auth_handler_digest.h2
-rw-r--r--net/http/http_auth_handler_digest_unittest.cc1
-rw-r--r--net/http/http_auth_handler_factory.h1
-rw-r--r--net/http/http_auth_handler_ntlm.cc2
-rw-r--r--net/http/http_auth_handler_ntlm.h10
-rw-r--r--net/http/http_auth_handler_ntlm_portable.cc121
-rw-r--r--net/http/http_auth_sspi_win_unittest.cc1
-rw-r--r--net/http/http_basic_state.cc1
-rw-r--r--net/http/http_basic_state.h2
-rw-r--r--net/http/http_basic_stream.h2
-rw-r--r--net/http/http_byte_range.cc12
-rw-r--r--net/http/http_byte_range.h31
-rw-r--r--net/http/http_byte_range_unittest.cc19
-rw-r--r--net/http/http_cache.cc1
-rw-r--r--net/http/http_cache.h2
-rw-r--r--net/http/http_cache_transaction.cc8
-rw-r--r--net/http/http_cache_transaction.h2
-rw-r--r--net/http/http_cache_unittest.cc9
-rw-r--r--net/http/http_chunked_decoder.h2
-rw-r--r--net/http/http_chunked_decoder_unittest.cc1
-rw-r--r--net/http/http_content_disposition.h2
-rw-r--r--net/http/http_network_layer.h2
-rw-r--r--net/http/http_network_layer_unittest.cc1
-rw-r--r--net/http/http_network_session.cc8
-rw-r--r--net/http/http_network_session.h8
-rw-r--r--net/http/http_network_session_peer.h1
-rw-r--r--net/http/http_network_transaction.cc6
-rw-r--r--net/http/http_network_transaction.h2
-rw-r--r--net/http/http_network_transaction_unittest.cc2
-rw-r--r--net/http/http_proxy_client_socket.cc4
-rw-r--r--net/http/http_proxy_client_socket.h6
-rw-r--r--net/http/http_proxy_client_socket_pool.h2
-rw-r--r--net/http/http_proxy_client_socket_wrapper.cc4
-rw-r--r--net/http/http_proxy_client_socket_wrapper.h8
-rw-r--r--net/http/http_request_headers.h2
-rw-r--r--net/http/http_request_info.h1
-rw-r--r--net/http/http_response_body_drainer.h2
-rw-r--r--net/http/http_response_body_drainer_unittest.cc1
-rw-r--r--net/http/http_response_headers.cc33
-rw-r--r--net/http/http_response_headers.h17
-rw-r--r--net/http/http_response_info.cc8
-rw-r--r--net/http/http_security_headers_unittest.cc26
-rw-r--r--net/http/http_server_properties.h12
-rw-r--r--net/http/http_server_properties_impl.cc8
-rw-r--r--net/http/http_server_properties_impl.h7
-rw-r--r--net/http/http_server_properties_impl_unittest.cc19
-rw-r--r--net/http/http_server_properties_manager.cc16
-rw-r--r--net/http/http_server_properties_manager.h6
-rw-r--r--net/http/http_server_properties_manager_unittest.cc12
-rw-r--r--net/http/http_status_line_validator.h4
-rw-r--r--net/http/http_stream.h2
-rw-r--r--net/http/http_stream_factory.cc6
-rw-r--r--net/http/http_stream_factory.h2
-rw-r--r--net/http/http_stream_factory_impl.h3
-rw-r--r--net/http/http_stream_factory_impl_job.h1
-rw-r--r--net/http/http_stream_factory_impl_request.h2
-rw-r--r--net/http/http_stream_factory_impl_unittest.cc2
-rw-r--r--net/http/http_stream_parser.cc10
-rw-r--r--net/http/http_stream_parser.h7
-rw-r--r--net/http/http_stream_parser_unittest.cc40
-rw-r--r--net/http/http_util.cc6
-rw-r--r--net/http/http_util.h2
-rw-r--r--net/http/http_util_unittest.cc7
-rw-r--r--net/http/http_version.h14
-rw-r--r--net/http/md4.cc4
-rw-r--r--net/http/md4.h4
-rw-r--r--net/http/mock_sspi_library_win.cc2
-rw-r--r--net/http/proxy_client_socket.h1
-rw-r--r--net/http/transport_security_persister.h1
-rw-r--r--net/http/transport_security_state.cc36
-rw-r--r--net/http/transport_security_state.h1
-rw-r--r--net/http/transport_security_state_static.h9
-rw-r--r--net/http/url_security_manager.h2
-rw-r--r--net/http/url_security_manager_unittest.cc1
-rw-r--r--net/http/url_security_manager_win.cc1
92 files changed, 360 insertions, 327 deletions
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 @@ static uint8 DESSetKeyParity(uint8 x) {
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 @@ void DESMakeKey(const uint8* raw, uint8* key) {
#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 @@ void DESEncrypt(const uint8* key, const uint8* src, uint8* hash) {
#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 @@ namespace net {
// 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..63172bb 100644
--- a/net/http/des_unittest.cc
+++ b/net/http/des_unittest.cc
@@ -12,17 +12,16 @@ namespace net {
// 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 @@ TEST(DESTest, KnownAnswerTest1) {
// 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 d019f9b..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::DoOpen() {
}
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 3076f3a..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..6f6425e 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 854e7bf..be82407 100644
--- a/net/http/failing_http_transaction_factory.cc
+++ b/net/http/failing_http_transaction_factory.cc
@@ -127,7 +127,7 @@ bool FailingHttpTransaction::GetFullRequestHeaders(
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 1b96ba4..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 f05f818..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 2df9d57..b7d6e94 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..345149d 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..a23d73b 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 73502c9..cf4dcd5 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..6334fbe 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 60e5882..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 8b5179e..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 7a41d5a..2411f9f 100644
--- a/net/http/http_auth_handler_ntlm.cc
+++ b/net/http/http_auth_handler_ntlm.cc
@@ -47,7 +47,7 @@ int HttpAuthHandlerNTLM::GenerateAuthTokenImpl(
// 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 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerNTLM : public HttpAuthHandler {
#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 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerNTLM : public HttpAuthHandler {
// 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 @@ static bool SendLM() {
#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 @@ static void* WriteDWORD(void* buf, uint32 dword) {
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 @@ static void* WriteSecBuf(void* buf, uint16 length, uint32 offset) {
* 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 @@ static void* WriteUnicodeLE(
}
#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 @@ static uint32 ReadUint32(const uint8*& buf) {
//
// 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 @@ static void LM_Hash(const base::string16& password, uint8* hash) {
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 @@ static void LM_Hash(const base::string16& password, uint8* hash) {
// 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 @@ static void NTLM_Hash(const base::string16& password, uint8* hash) {
// 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 @@ static void LM_Response(const uint8* hash,
//-----------------------------------------------------------------------------
// 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 @@ static int GenerateType1Msg(void** out_buf, uint32* out_len) {
}
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 @@ static int ParseType2Msg(const void* in_buf, uint32 in_len, Type2Msg* msg) {
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 @@ static int ParseType2Msg(const void* in_buf, uint32 in_len, Type2Msg* msg) {
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 @@ static int ParseType2Msg(const void* in_buf, uint32 in_len, Type2Msg* msg) {
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 @@ static int ParseType2Msg(const void* in_buf, uint32 in_len, Type2Msg* msg) {
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 @@ static int GenerateType3Msg(const base::string16& domain,
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 @@ static int GenerateType3Msg(const base::string16& domain,
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 @@ static int GenerateType3Msg(const base::string16& domain,
//
// 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 @@ static int GenerateType3Msg(const base::string16& domain,
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 @@ static int GenerateType3Msg(const base::string16& domain,
// 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 @@ static int GenerateType3Msg(const base::string16& domain,
// 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 @@ HttpAuthHandlerNTLM::Factory::~Factory() {
}
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 @@ int HttpAuthHandlerNTLM::GetNextToken(const void* in_token,
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 103d0c2..0bb90ff 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 060f2fe..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 11a568e..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 b43cb2e..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 @@ HttpByteRange::HttpByteRange()
}
// 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 @@ HttpByteRange HttpByteRange::Bounded(int64 first_byte_position,
}
// 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 @@ std::string HttpByteRange::GetHeaderValue() const {
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 @@ class NET_EXPORT HttpByteRange {
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 @@ class NET_EXPORT HttpByteRange {
// 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..412c7f8 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 @@ namespace {
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, ValidRanges) {
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..ae49d56 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..3b9f28d 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 @@ int HttpCache::Transaction::DoCacheWriteDataComplete(int result) {
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 @@ void HttpCache::Transaction::RecordHistograms() {
}
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 76deac3..4d0b81d 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 @@ void Verify206Response(const std::string& response, int start, int end) {
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 @@ TEST(HttpCache, SimplePOST_LoadOnlyFromCache_Hit) {
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 @@ TEST(HttpCache, SimplePOST_WithRanges) {
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 06dd353..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 c96ba61..0f1b5ac 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..3026f2e 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..90df327 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..3bf68b4 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -57,18 +57,18 @@ ClientSocketPoolManager* CreateSocketPoolManager(
} // 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 @@ class NET_EXPORT HttpNetworkSession
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 f1598cc..8d02fed 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -109,8 +109,8 @@ scoped_ptr<base::Value> NetLogSSLVersionFallbackCallback(
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 @@ int HttpNetworkTransaction::HandleSSLHandshakeError(int error) {
}
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..d935637 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 5a3ec4b..562bff3 100644
--- a/net/http/http_proxy_client_socket.cc
+++ b/net/http/http_proxy_client_socket.cc
@@ -244,11 +244,11 @@ int HttpProxyClientSocket::Write(IOBuffer* buf, int buf_len,
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 @@ class HttpProxyClientSocket : public ProxyClientSocket {
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..fef16e3 100644
--- a/net/http/http_proxy_client_socket_wrapper.cc
+++ b/net/http/http_proxy_client_socket_wrapper.cc
@@ -294,7 +294,7 @@ int HttpProxyClientSocketWrapper::Write(IOBuffer* buf,
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 @@ int HttpProxyClientSocketWrapper::SetReceiveBufferSize(int32 size) {
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 @@ class HttpProxyClientSocketWrapper : public ProxyClientSocket {
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 e6f25ed..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 a587a42..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..c0f8039 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -361,10 +361,9 @@ void HttpResponseHeaders::ReplaceStatusLine(const std::string& new_status) {
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 @@ void HttpResponseHeaders::UpdateWithNewRange(
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 @@ HttpVersion HttpResponseHeaders::ParseVersion(
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 @@ bool HttpResponseHeaders::GetCacheControlDirective(const StringPiece& directive,
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 @@ bool HttpResponseHeaders::GetAgeValue(TimeDelta* result) const {
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 @@ bool HttpResponseHeaders::HasStrongValidators() const {
// 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 @@ int64 HttpResponseHeaders::GetInt64HeaderValue(
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 @@ int64 HttpResponseHeaders::GetInt64HeaderValue(
// 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 d24d12d..91c223e 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 @@ class NET_EXPORT HttpResponseHeaders
// |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 @@ class NET_EXPORT HttpResponseHeaders
// 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 @@ class NET_EXPORT HttpResponseHeaders
// |*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 @@ bool HttpResponseInfo::InitFromPickle(const base::Pickle& pickle,
}
// 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 @@ bool HttpResponseInfo::InitFromPickle(const base::Pickle& pickle,
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 @@ bool HttpResponseInfo::InitFromPickle(const base::Pickle& pickle,
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 @@ void HttpResponseInfo::Persist(base::Pickle* pickle,
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 net {
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 @@ std::string GetTestPinImpl(uint8 label, HashValueTag tag, bool quoted) {
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 @@ TEST_F(HttpSecurityHeadersTest, ValidSTSHeaders) {
"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 @@ TEST_F(HttpSecurityHeadersTest, ValidSTSHeaders) {
"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 @@ TEST_F(HttpSecurityHeadersTest, ValidSTSHeaders) {
"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 @@ TEST_F(HttpSecurityHeadersTest, ValidSTSHeaders) {
";; 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 @@ TEST_F(HttpSecurityHeadersTest, ValidSTSHeaders) {
";; 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 @@ TEST_F(HttpSecurityHeadersTest, ValidSTSHeaders) {
";; ; ; 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 @@ TEST_F(HttpSecurityHeadersTest, ValidSTSHeaders) {
"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 @@ static void TestValidPKPHeaders(HashValueTag tag) {
"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 @@ static void TestValidPKPHeaders(HashValueTag tag) {
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 @@ struct NET_EXPORT AlternativeService {
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 @@ struct NET_EXPORT AlternativeService {
AlternateProtocol protocol;
std::string host;
- uint16 port;
+ uint16_t port;
};
struct NET_EXPORT AlternativeServiceInfo {
@@ -149,7 +151,7 @@ struct NET_EXPORT AlternativeServiceInfo {
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 @@ class NET_EXPORT HttpServerProperties {
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..5e42585 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -22,7 +22,7 @@ namespace net {
namespace {
-const uint64 kBrokenAlternativeProtocolDelaySecs = 300;
+const uint64_t kBrokenAlternativeProtocolDelaySecs = 300;
} // namespace
@@ -71,7 +71,7 @@ void HttpServerPropertiesImpl::InitializeSpdyServers(
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 @@ void HttpServerPropertiesImpl::InitializeAlternativeServiceServers(
}
// 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 @@ bool HttpServerPropertiesImpl::SetSpdySetting(
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 093f5d2..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 @@ class NET_EXPORT HttpServerPropertiesImpl
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 @@ const SpdySettingsFlags kSpdySettingsFlags = SETTINGS_FLAG_PERSISTED;
struct SpdySettingsDataToVerify {
HostPortPair spdy_server;
- uint32 value;
+ uint32_t value;
};
class HttpServerPropertiesImplTest : public testing::Test {
@@ -73,7 +72,7 @@ class HttpServerPropertiesImplTest : public testing::Test {
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 @@ TEST_F(SpdySettingsServerPropertiesTest, SetSpdySetting) {
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 @@ TEST_F(SpdySettingsServerPropertiesTest, SetSpdySetting) {
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 @@ TEST_F(SpdySettingsServerPropertiesTest, SetSpdySetting) {
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 @@ TEST_F(SpdySettingsServerPropertiesTest, Clear) {
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 @@ TEST_F(SpdySettingsServerPropertiesTest, Clear) {
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 @@ TEST_F(SpdySettingsServerPropertiesTest, MRUOfGetSpdySettings) {
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 @@ namespace {
// 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 @@ bool HttpServerPropertiesManager::SetSpdySetting(
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 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceDict(
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 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceDict(
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 @@ void HttpServerPropertiesManager::SaveSpdySettingsToServerPrefs(
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 @@ void HttpServerPropertiesManager::SaveAlternativeServiceToServerPrefs(
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 @@ void HttpServerPropertiesManager::SaveNetworkStatsToServerPrefs(
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..ef88157 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 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
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 b093c61..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 @@ TEST_F(HttpServerPropertiesManagerTest, SetSpdySetting) {
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 @@ TEST_F(HttpServerPropertiesManagerTest, ClearSpdySetting) {
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 @@ TEST_F(HttpServerPropertiesManagerTest, ClearAllSpdySetting) {
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 @@ TEST_F(HttpServerPropertiesManagerTest, Clear) {
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 @@ TEST_F(HttpServerPropertiesManagerTest, AddToAlternativeServiceMap) {
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..1a12cd0 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 0038a8a..d6d76b4 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -59,7 +59,7 @@ void HttpStreamFactory::ProcessAlternativeService(
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 @@ void HttpStreamFactory::ProcessAlternateProtocol(
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 c2f4b6e..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 6ed8b2c..da1de97 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 e65dac8..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 @@ void RecordHeaderParserEvent(HttpHeaderParserEvent header_event) {
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 @@ bool HeadersContainMultipleCopiesOfField(const HttpResponseHeaders& headers,
}
scoped_ptr<base::Value> NetLogSendRequestBodyCallback(
- uint64 length,
+ uint64_t length,
bool is_chunked,
bool did_merge,
NetLogCaptureMode /* capture_mode */) {
@@ -287,7 +287,7 @@ int HttpStreamParser::SendRequest(const std::string& request_line,
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 @@ int HttpStreamParser::DoReadBodyComplete(int result) {
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 @@ bool HttpStreamParser::ShouldMergeRequestHeadersAndBody(
// 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 @@ class NET_EXPORT_PRIVATE HttpStreamParser {
// 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..2651edc 100644
--- a/net/http/http_stream_parser_unittest.cc
+++ b/net/http/http_stream_parser_unittest.cc
@@ -1035,12 +1035,12 @@ TEST(HttpStreamParser, ReceivedBytesNormal) {
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 @@ TEST(HttpStreamParser, ReceivedBytesExcludesNextResponse) {
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, ReceivedBytesExcludesNextResponse) {
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 @@ TEST(HttpStreamParser, ReceivedBytesMultiReadExcludesNextResponse) {
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 @@ TEST(HttpStreamParser, ReceivedBytesFromReadBufExcludesNextResponse) {
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, ReceivedBytesFromReadBufExcludesNextResponse) {
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 @@ TEST(HttpStreamParser, ReceivedBytesChunkedTransferExcludesNextResponse) {
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 @@ TEST(HttpStreamParser, ReceivedBytesMultipleReads) {
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 @@ TEST(HttpStreamParser, ReceivedBytesIncludesContinueHeader) {
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 @@ TEST(HttpStreamParser, ReceivedBytesIncludesContinueHeader) {
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 @@ bool HttpUtil::ParseRangeHeader(const std::string& ranges_specifier,
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 @@ bool HttpUtil::ParseRangeHeader(const std::string& ranges_specifier,
// 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 @@ TEST(HttpUtilTest, ParseRanges) {
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 @@ class HttpVersion {
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 @@ class HttpVersion {
}
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..7de9cb0 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 @@ namespace weak_crypto {
* 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 @@ SECURITY_STATUS MockSSPILibrary::InitializeSecurityContext(
// 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..b240689 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 27ecc23..d4e1e36 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 @@ std::string CanonicalizeHost(const std::string& host) {
// 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 @@ class BitReader {
// 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 @@ class BitReader {
}
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 @@ class BitReader {
// 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 @@ class HuffmanDecoder {
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 @@ class HuffmanDecoder {
}
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 @@ struct PreloadResult {
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 @@ bool DecodeHSTSPreloadRaw(const std::string& search_hostname,
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 @@ bool DecodeHSTSPreloadRaw(const std::string& search_hostname,
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 @@ static const struct Pinset kPinsets[] = {
// 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 @@ static const uint8 kHSTSHuffmanTree[] = {
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 d851b37..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"