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

Unified Diff: net/quic/core/crypto/null_decrypter.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/crypto/null_decrypter.h ('k') | net/quic/core/crypto/null_decrypter_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/null_decrypter.cc
diff --git a/net/quic/core/crypto/null_decrypter.cc b/net/quic/core/crypto/null_decrypter.cc
index 6f05b4f3c1a2565ae7fcd64f608d9ca7b65d1a51..7bb583979962dbd2ebd5e7dc971e59cf61770db7 100644
--- a/net/quic/core/crypto/null_decrypter.cc
+++ b/net/quic/core/crypto/null_decrypter.cc
@@ -11,7 +11,6 @@
#include "net/quic/core/quic_utils.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
-using base::StringPiece;
using std::string;
namespace net {
@@ -19,15 +18,15 @@ namespace net {
NullDecrypter::NullDecrypter(Perspective perspective)
: perspective_(perspective) {}
-bool NullDecrypter::SetKey(StringPiece key) {
+bool NullDecrypter::SetKey(QuicStringPiece key) {
return key.empty();
}
-bool NullDecrypter::SetNoncePrefix(StringPiece nonce_prefix) {
+bool NullDecrypter::SetNoncePrefix(QuicStringPiece nonce_prefix) {
return nonce_prefix.empty();
}
-bool NullDecrypter::SetPreliminaryKey(StringPiece key) {
+bool NullDecrypter::SetPreliminaryKey(QuicStringPiece key) {
QUIC_BUG << "Should not be called";
return false;
}
@@ -39,8 +38,8 @@ bool NullDecrypter::SetDiversificationNonce(const DiversificationNonce& nonce) {
bool NullDecrypter::DecryptPacket(QuicVersion version,
QuicPacketNumber /*packet_number*/,
- StringPiece associated_data,
- StringPiece ciphertext,
+ QuicStringPiece associated_data,
+ QuicStringPiece ciphertext,
char* output,
size_t* output_length,
size_t max_output_length) {
@@ -51,7 +50,7 @@ bool NullDecrypter::DecryptPacket(QuicVersion version,
return false;
}
- StringPiece plaintext = reader.ReadRemainingPayload();
+ QuicStringPiece plaintext = reader.ReadRemainingPayload();
if (plaintext.length() > max_output_length) {
QUIC_BUG << "Output buffer must be larger than the plaintext.";
return false;
@@ -65,12 +64,12 @@ bool NullDecrypter::DecryptPacket(QuicVersion version,
return true;
}
-StringPiece NullDecrypter::GetKey() const {
- return StringPiece();
+QuicStringPiece NullDecrypter::GetKey() const {
+ return QuicStringPiece();
}
-StringPiece NullDecrypter::GetNoncePrefix() const {
- return StringPiece();
+QuicStringPiece NullDecrypter::GetNoncePrefix() const {
+ return QuicStringPiece();
}
const char* NullDecrypter::cipher_name() const {
@@ -92,8 +91,8 @@ bool NullDecrypter::ReadHash(QuicDataReader* reader, uint128* hash) {
}
uint128 NullDecrypter::ComputeHash(QuicVersion version,
- const StringPiece data1,
- const StringPiece data2) const {
+ const QuicStringPiece data1,
+ const QuicStringPiece data2) const {
uint128 correct_hash;
if (version > QUIC_VERSION_36) {
if (perspective_ == Perspective::IS_CLIENT) {
« no previous file with comments | « net/quic/core/crypto/null_decrypter.h ('k') | net/quic/core/crypto/null_decrypter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698