Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: net/tools/quic/chlo_extractor.cc

Issue 2236973002: Landing Recent QUIC changes until 4AM, Aug 7, 2016 UTC-4 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: flip quic_sequencer_buffer_retire_block_in_time to true Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/test_tools/simple_quic_framer.cc ('k') | net/tools/quic/chlo_extractor_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/tools/quic/chlo_extractor.h" 5 #include "net/tools/quic/chlo_extractor.h"
6 6
7 #include "net/quic/core/crypto/crypto_framer.h" 7 #include "net/quic/core/crypto/crypto_framer.h"
8 #include "net/quic/core/crypto/crypto_handshake_message.h" 8 #include "net/quic/core/crypto/crypto_handshake_message.h"
9 #include "net/quic/core/crypto/crypto_protocol.h" 9 #include "net/quic/core/crypto/crypto_protocol.h"
10 #include "net/quic/core/crypto/quic_decrypter.h" 10 #include "net/quic/core/crypto/quic_decrypter.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 bool ChloFramerVisitor::OnPaddingFrame(const QuicPaddingFrame& frame) { 143 bool ChloFramerVisitor::OnPaddingFrame(const QuicPaddingFrame& frame) {
144 return true; 144 return true;
145 } 145 }
146 146
147 void ChloFramerVisitor::OnError(CryptoFramer* framer) {} 147 void ChloFramerVisitor::OnError(CryptoFramer* framer) {}
148 148
149 void ChloFramerVisitor::OnHandshakeMessage( 149 void ChloFramerVisitor::OnHandshakeMessage(
150 const CryptoHandshakeMessage& message) { 150 const CryptoHandshakeMessage& message) {
151 delegate_->OnChlo(framer_->version(), connection_id_, message); 151 if (delegate_ != nullptr) {
152 delegate_->OnChlo(framer_->version(), connection_id_, message);
153 }
152 found_chlo_ = true; 154 found_chlo_ = true;
153 } 155 }
154 156
155 } // namespace 157 } // namespace
156 158
157 // static 159 // static
158 bool ChloExtractor::Extract(const QuicEncryptedPacket& packet, 160 bool ChloExtractor::Extract(const QuicEncryptedPacket& packet,
159 const QuicVersionVector& versions, 161 const QuicVersionVector& versions,
160 Delegate* delegate) { 162 Delegate* delegate) {
161 QuicFramer framer(versions, QuicTime::Zero(), Perspective::IS_SERVER); 163 QuicFramer framer(versions, QuicTime::Zero(), Perspective::IS_SERVER);
162 ChloFramerVisitor visitor(&framer, delegate); 164 ChloFramerVisitor visitor(&framer, delegate);
163 framer.set_visitor(&visitor); 165 framer.set_visitor(&visitor);
164 if (!framer.ProcessPacket(packet)) { 166 if (!framer.ProcessPacket(packet)) {
165 return false; 167 return false;
166 } 168 }
167 return visitor.found_chlo(); 169 return visitor.found_chlo();
168 } 170 }
169 171
170 } // namespace net 172 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/simple_quic_framer.cc ('k') | net/tools/quic/chlo_extractor_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698