| Index: net/quic/crypto/crypto_framer.cc
|
| diff --git a/net/quic/crypto/crypto_framer.cc b/net/quic/crypto/crypto_framer.cc
|
| index 5cb16743e6905ad927a14ad1944237985b67ee63..16e3bc86c857150d339858cb2a6a4391be533ca6 100644
|
| --- a/net/quic/crypto/crypto_framer.cc
|
| +++ b/net/quic/crypto/crypto_framer.cc
|
| @@ -44,14 +44,12 @@ class OneShotVisitor : public CryptoFramerVisitorInterface {
|
|
|
| } // namespace
|
|
|
| -CryptoFramer::CryptoFramer()
|
| - : visitor_(NULL),
|
| - num_entries_(0),
|
| - values_len_(0) {
|
| +CryptoFramer::CryptoFramer() : visitor_(NULL), num_entries_(0), values_len_(0) {
|
| Clear();
|
| }
|
|
|
| -CryptoFramer::~CryptoFramer() {}
|
| +CryptoFramer::~CryptoFramer() {
|
| +}
|
|
|
| // static
|
| CryptoHandshakeMessage* CryptoFramer::ParseMessage(StringPiece in) {
|
| @@ -107,7 +105,6 @@ QuicData* CryptoFramer::ConstructHandshakeMessage(
|
| return NULL;
|
| }
|
|
|
| -
|
| QuicDataWriter writer(len);
|
| if (!writer.WriteUInt32(message.tag())) {
|
| DCHECK(false) << "Failed to write message tag.";
|
| @@ -125,7 +122,8 @@ QuicData* CryptoFramer::ConstructHandshakeMessage(
|
| uint32 end_offset = 0;
|
| // Tags and offsets
|
| for (QuicTagValueMap::const_iterator it = message.tag_value_map().begin();
|
| - it != message.tag_value_map().end(); ++it) {
|
| + it != message.tag_value_map().end();
|
| + ++it) {
|
| if (it->first == kPAD && need_pad_tag) {
|
| // Existing PAD tags are only checked when padding needs to be added
|
| // because parts of the code may need to reserialize received messages
|
| @@ -160,7 +158,8 @@ QuicData* CryptoFramer::ConstructHandshakeMessage(
|
|
|
| // Values
|
| for (QuicTagValueMap::const_iterator it = message.tag_value_map().begin();
|
| - it != message.tag_value_map().end(); ++it) {
|
| + it != message.tag_value_map().end();
|
| + ++it) {
|
| if (it->first > kPAD && need_pad_value) {
|
| need_pad_value = false;
|
| if (!writer.WriteRepeatedByte('-', pad_length)) {
|
| @@ -222,7 +221,7 @@ QuicErrorCode CryptoFramer::Process(StringPiece input) {
|
| values_len_ = 0;
|
| case STATE_READING_TAGS_AND_LENGTHS: {
|
| if (reader.BytesRemaining() <
|
| - num_entries_ * (kQuicTagSize + kCryptoEndOffsetSize)) {
|
| + num_entries_ * (kQuicTagSize + kCryptoEndOffsetSize)) {
|
| break;
|
| }
|
|
|
| @@ -230,8 +229,8 @@ QuicErrorCode CryptoFramer::Process(StringPiece input) {
|
| for (unsigned i = 0; i < num_entries_; ++i) {
|
| QuicTag tag;
|
| reader.ReadUInt32(&tag);
|
| - if (i > 0 && tag <= tags_and_lengths_[i-1].first) {
|
| - if (tag == tags_and_lengths_[i-1].first) {
|
| + if (i > 0 && tag <= tags_and_lengths_[i - 1].first) {
|
| + if (tag == tags_and_lengths_[i - 1].first) {
|
| return QUIC_CRYPTO_DUPLICATE_TAG;
|
| }
|
| return QUIC_CRYPTO_TAGS_OUT_OF_ORDER;
|
| @@ -254,8 +253,9 @@ QuicErrorCode CryptoFramer::Process(StringPiece input) {
|
| if (reader.BytesRemaining() < values_len_) {
|
| break;
|
| }
|
| - for (vector<pair<QuicTag, size_t> >::const_iterator
|
| - it = tags_and_lengths_.begin(); it != tags_and_lengths_.end();
|
| + for (vector<pair<QuicTag, size_t> >::const_iterator it =
|
| + tags_and_lengths_.begin();
|
| + it != tags_and_lengths_.end();
|
| it++) {
|
| StringPiece value;
|
| reader.ReadStringPiece(&value, it->second);
|
|
|