Chromium Code Reviews| Index: net/quic/crypto/quic_crypto_server_config.cc |
| diff --git a/net/quic/crypto/quic_crypto_server_config.cc b/net/quic/crypto/quic_crypto_server_config.cc |
| index 4a5dc8a75806da293e0f8948080064d720228354..d86532cacdcdd2eae48d9398a322f084d697d49a 100644 |
| --- a/net/quic/crypto/quic_crypto_server_config.cc |
| +++ b/net/quic/crypto/quic_crypto_server_config.cc |
| @@ -1175,8 +1175,8 @@ void QuicCryptoServerConfig::BuildRejection( |
| // token. |
| const size_t max_unverified_size = |
| client_hello.size() * kMultiplier - kREJOverheadBytes; |
| - COMPILE_ASSERT(kClientHelloMinimumSize * kMultiplier >= kREJOverheadBytes, |
| - overhead_calculation_may_underflow); |
| + static_assert(kClientHelloMinimumSize * kMultiplier >= kREJOverheadBytes, |
| + "overhead calculation may underflow"); |
|
Deprecated (see juliatuttle)
2015/01/05 22:22:39
Technically I think that's overflow?
Mostyn Bramley-Moore
2015/01/06 00:07:07
Done.
|
| if (info.valid_source_address_token || |
| signature.size() + compressed.size() < max_unverified_size) { |
| out->SetStringPiece(kCertificateTag, compressed); |
| @@ -1251,7 +1251,8 @@ QuicCryptoServerConfig::ParseConfigProtobuf( |
| " Got " << orbit.size() << " want " << kOrbitSize; |
| return nullptr; |
| } |
| - COMPILE_ASSERT(sizeof(config->orbit) == kOrbitSize, orbit_incorrect_size); |
| + static_assert(sizeof(config->orbit) == kOrbitSize, |
| + "orbit has incorrect size"); |
| memcpy(config->orbit, orbit.data(), sizeof(config->orbit)); |
| { |
| @@ -1615,7 +1616,7 @@ string QuicCryptoServerConfig::NewServerNonce(QuicRandom* rand, |
| const uint32 timestamp = static_cast<uint32>(now.ToUNIXSeconds()); |
| uint8 server_nonce[kServerNoncePlaintextSize]; |
| - COMPILE_ASSERT(sizeof(server_nonce) > sizeof(timestamp), nonce_too_small); |
| + static_assert(sizeof(server_nonce) > sizeof(timestamp), "nonce too small"); |
| server_nonce[0] = static_cast<uint8>(timestamp >> 24); |
| server_nonce[1] = static_cast<uint8>(timestamp >> 16); |
| server_nonce[2] = static_cast<uint8>(timestamp >> 8); |
| @@ -1652,8 +1653,8 @@ HandshakeFailureReason QuicCryptoServerConfig::ValidateServerNonce( |
| memcpy(server_nonce + 4, server_nonce_orbit_, sizeof(server_nonce_orbit_)); |
| memcpy(server_nonce + 4 + sizeof(server_nonce_orbit_), plaintext.data() + 4, |
| 20); |
| - COMPILE_ASSERT(4 + sizeof(server_nonce_orbit_) + 20 == sizeof(server_nonce), |
| - bad_nonce_buffer_length); |
| + static_assert(4 + sizeof(server_nonce_orbit_) + 20 == sizeof(server_nonce), |
| + "bad nonce buffer length"); |
| InsertStatus nonce_error; |
| { |