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

Unified Diff: net/quic/core/crypto/aes_128_gcm_12_decrypter_test.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/aead_base_encrypter.cc ('k') | net/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
diff --git a/net/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc b/net/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
index c57d6707bfa1870184299a6b8268be47eaebd4b7..2a14d177f02bb8ccbe9f123f5eb6e5465704771c 100644
--- a/net/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
+++ b/net/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
@@ -10,7 +10,6 @@
#include "net/quic/platform/api/quic_text_utils.h"
#include "net/quic/test_tools/quic_test_utils.h"
-using base::StringPiece;
using std::string;
namespace {
@@ -200,11 +199,12 @@ namespace test {
// DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the plaintext.
QuicData* DecryptWithNonce(Aes128Gcm12Decrypter* decrypter,
- StringPiece nonce,
- StringPiece associated_data,
- StringPiece ciphertext) {
+ QuicStringPiece nonce,
+ QuicStringPiece associated_data,
+ QuicStringPiece ciphertext) {
QuicPacketNumber packet_number;
- StringPiece nonce_prefix(nonce.data(), nonce.size() - sizeof(packet_number));
+ QuicStringPiece nonce_prefix(nonce.data(),
+ nonce.size() - sizeof(packet_number));
decrypter->SetNoncePrefix(nonce_prefix);
memcpy(&packet_number, nonce.data() + nonce_prefix.size(),
sizeof(packet_number));
@@ -265,7 +265,7 @@ TEST(Aes128Gcm12DecrypterTest, Decrypt) {
// This deliberately tests that the decrypter can handle an AAD that
// is set to nullptr, as opposed to a zero-length, non-nullptr
// pointer.
- aad.length() ? aad : StringPiece(), ciphertext));
+ aad.length() ? aad : QuicStringPiece(), ciphertext));
if (!decrypted.get()) {
EXPECT_FALSE(has_pt);
continue;
« no previous file with comments | « net/quic/core/crypto/aead_base_encrypter.cc ('k') | net/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698