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

Unified Diff: net/quic/core/quic_packets.cc

Issue 2740453006: Add QuicStringPiece which is actually StringPiece. (Closed)
Patch Set: fix compile error and rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_packets.h ('k') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_packets.cc
diff --git a/net/quic/core/quic_packets.cc b/net/quic/core/quic_packets.cc
index a5c44105ce5753c610c10b213e85e54e8da0e1a6..cdd6325627a23053f5b5b62476e561e5fd626779 100644
--- a/net/quic/core/quic_packets.cc
+++ b/net/quic/core/quic_packets.cc
@@ -11,7 +11,6 @@
#include "net/quic/platform/api/quic_str_cat.h"
#include "net/quic/platform/api/quic_text_utils.h"
-using base::StringPiece;
using std::string;
namespace net {
@@ -94,8 +93,8 @@ std::ostream& operator<<(std::ostream& os, const QuicPacketHeader& header) {
if (header.public_header.nonce != nullptr) {
os << ", diversification_nonce: "
<< QuicTextUtils::HexEncode(
- StringPiece(header.public_header.nonce->data(),
- header.public_header.nonce->size()));
+ QuicStringPiece(header.public_header.nonce->data(),
+ header.public_header.nonce->size()));
}
os << ", packet_number: " << header.packet_number << " }\n";
return os;
@@ -183,19 +182,19 @@ std::ostream& operator<<(std::ostream& os, const QuicReceivedPacket& s) {
return os;
}
-StringPiece QuicPacket::AssociatedData(QuicVersion version) const {
- return StringPiece(
+QuicStringPiece QuicPacket::AssociatedData(QuicVersion version) const {
+ return QuicStringPiece(
data(), GetStartOfEncryptedData(
version, connection_id_length_, includes_version_,
includes_diversification_nonce_, packet_number_length_));
}
-StringPiece QuicPacket::Plaintext(QuicVersion version) const {
+QuicStringPiece QuicPacket::Plaintext(QuicVersion version) const {
const size_t start_of_encrypted_data = GetStartOfEncryptedData(
version, connection_id_length_, includes_version_,
includes_diversification_nonce_, packet_number_length_);
- return StringPiece(data() + start_of_encrypted_data,
- length() - start_of_encrypted_data);
+ return QuicStringPiece(data() + start_of_encrypted_data,
+ length() - start_of_encrypted_data);
}
SerializedPacket::SerializedPacket(QuicPacketNumber packet_number,
« no previous file with comments | « net/quic/core/quic_packets.h ('k') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698