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

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

Issue 2517513004: Move QUIC error code utility methods to quic_error_codes.{h,cc}, and rename them slightly. No beha… (Closed)
Patch Set: Created 4 years, 1 month 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/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_simple_client_bin.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // clang-format off 5 // clang-format off
6 6
7 // Dumps out the decryptable contents of a QUIC packet in a human-readable way. 7 // Dumps out the decryptable contents of a QUIC packet in a human-readable way.
8 // If the packet is null encrypted, this will dump full packet contents. 8 // If the packet is null encrypted, this will dump full packet contents.
9 // Otherwise it will dump the public header, and fail with an error that the 9 // Otherwise it will dump the public header, and fail with an error that the
10 // packet is undecryptable. 10 // packet is undecryptable.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 } 59 }
60 60
61 namespace net { 61 namespace net {
62 62
63 class QuicPacketPrinter : public QuicFramerVisitorInterface { 63 class QuicPacketPrinter : public QuicFramerVisitorInterface {
64 public: 64 public:
65 explicit QuicPacketPrinter(QuicFramer* framer) : framer_(framer) {} 65 explicit QuicPacketPrinter(QuicFramer* framer) : framer_(framer) {}
66 66
67 void OnError(QuicFramer* framer) override { 67 void OnError(QuicFramer* framer) override {
68 cerr << "OnError: " << QuicUtils::ErrorToString(framer->error()) 68 cerr << "OnError: " << QuicErrorCodeToString(framer->error())
69 << " detail: " << framer->detailed_error() << "\n"; 69 << " detail: " << framer->detailed_error() << "\n";
70 } 70 }
71 bool OnProtocolVersionMismatch(QuicVersion received_version) override { 71 bool OnProtocolVersionMismatch(QuicVersion received_version) override {
72 framer_->set_version(received_version); 72 framer_->set_version(received_version);
73 cerr << "OnProtocolVersionMismatch: " 73 cerr << "OnProtocolVersionMismatch: "
74 << QuicVersionToString(received_version) << "\n"; 74 << QuicVersionToString(received_version) << "\n";
75 return true; 75 return true;
76 } 76 }
77 void OnPacket() override { cerr << "OnPacket\n"; } 77 void OnPacket() override { cerr << "OnPacket\n"; }
78 void OnPublicResetPacket(const QuicPublicResetPacket& packet) override { 78 void OnPublicResetPacket(const QuicPublicResetPacket& packet) override {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 if (net::QuicVersionToString(version) == FLAGS_quic_version) { 191 if (net::QuicVersionToString(version) == FLAGS_quic_version) {
192 framer.set_version(version); 192 framer.set_version(version);
193 } 193 }
194 } 194 }
195 } 195 }
196 net::QuicPacketPrinter visitor(&framer); 196 net::QuicPacketPrinter visitor(&framer);
197 framer.set_visitor(&visitor); 197 framer.set_visitor(&visitor);
198 net::QuicEncryptedPacket encrypted(hex.c_str(), hex.length()); 198 net::QuicEncryptedPacket encrypted(hex.c_str(), hex.length());
199 return framer.ProcessPacket(encrypted); 199 return framer.ProcessPacket(encrypted);
200 } 200 }
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_simple_client_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698