| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/quic/crypto/crypto_handshake_message.h" | 5 #include "net/quic/crypto/crypto_handshake_message.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "net/quic/crypto/crypto_framer.h" | 9 #include "net/quic/crypto/crypto_framer.h" |
| 10 #include "net/quic/crypto/crypto_protocol.h" | 10 #include "net/quic/crypto/crypto_protocol.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 tag_ = 0; | 48 tag_ = 0; |
| 49 tag_value_map_.clear(); | 49 tag_value_map_.clear(); |
| 50 minimum_size_ = 0; | 50 minimum_size_ = 0; |
| 51 serialized_.reset(); | 51 serialized_.reset(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 const QuicData& CryptoHandshakeMessage::GetSerialized() const { | 54 const QuicData& CryptoHandshakeMessage::GetSerialized() const { |
| 55 if (!serialized_.get()) { | 55 if (!serialized_.get()) { |
| 56 serialized_.reset(CryptoFramer::ConstructHandshakeMessage(*this)); | 56 serialized_.reset(CryptoFramer::ConstructHandshakeMessage(*this)); |
| 57 } | 57 } |
| 58 return *serialized_.get(); | 58 return *serialized_; |
| 59 } | 59 } |
| 60 | 60 |
| 61 void CryptoHandshakeMessage::MarkDirty() { | 61 void CryptoHandshakeMessage::MarkDirty() { |
| 62 serialized_.reset(); | 62 serialized_.reset(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void CryptoHandshakeMessage::SetTaglist(QuicTag tag, ...) { | 65 void CryptoHandshakeMessage::SetTaglist(QuicTag tag, ...) { |
| 66 // Warning, if sizeof(QuicTag) > sizeof(int) then this function will break | 66 // Warning, if sizeof(QuicTag) > sizeof(int) then this function will break |
| 67 // because the terminating 0 will only be promoted to int. | 67 // because the terminating 0 will only be promoted to int. |
| 68 static_assert(sizeof(QuicTag) <= sizeof(int), | 68 static_assert(sizeof(QuicTag) <= sizeof(int), |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); | 308 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); |
| 309 } | 309 } |
| 310 ret += "\n"; | 310 ret += "\n"; |
| 311 } | 311 } |
| 312 --indent; | 312 --indent; |
| 313 ret += string(2 * indent, ' ') + ">"; | 313 ret += string(2 * indent, ' ') + ">"; |
| 314 return ret; | 314 return ret; |
| 315 } | 315 } |
| 316 | 316 |
| 317 } // namespace net | 317 } // namespace net |
| OLD | NEW |