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

Unified Diff: net/quic/core/crypto/p256_key_exchange.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/p256_key_exchange.h ('k') | net/quic/core/crypto/p256_key_exchange_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/p256_key_exchange.cc
diff --git a/net/quic/core/crypto/p256_key_exchange.cc b/net/quic/core/crypto/p256_key_exchange.cc
index 1e4d956ed99ca271f51c63f3ecfb6b9d47190d8f..09cff164ffae034a1416204f9b1e2affef802336 100644
--- a/net/quic/core/crypto/p256_key_exchange.cc
+++ b/net/quic/core/crypto/p256_key_exchange.cc
@@ -15,7 +15,6 @@
#include "third_party/boringssl/src/include/openssl/err.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
-using base::StringPiece;
using std::string;
namespace net {
@@ -29,7 +28,7 @@ P256KeyExchange::P256KeyExchange(bssl::UniquePtr<EC_KEY> private_key,
P256KeyExchange::~P256KeyExchange() {}
// static
-P256KeyExchange* P256KeyExchange::New(StringPiece key) {
+P256KeyExchange* P256KeyExchange::New(QuicStringPiece key) {
if (key.empty()) {
QUIC_DLOG(INFO) << "Private key is empty";
return nullptr;
@@ -83,7 +82,7 @@ KeyExchange* P256KeyExchange::NewKeyPair(QuicRandom* /*rand*/) const {
return P256KeyExchange::New(private_value);
}
-bool P256KeyExchange::CalculateSharedKey(StringPiece peer_public_value,
+bool P256KeyExchange::CalculateSharedKey(QuicStringPiece peer_public_value,
string* out_result) const {
if (peer_public_value.size() != kUncompressedP256PointBytes) {
QUIC_DLOG(INFO) << "Peer public value is invalid";
@@ -113,9 +112,9 @@ bool P256KeyExchange::CalculateSharedKey(StringPiece peer_public_value,
return true;
}
-StringPiece P256KeyExchange::public_value() const {
- return StringPiece(reinterpret_cast<const char*>(public_key_),
- sizeof(public_key_));
+QuicStringPiece P256KeyExchange::public_value() const {
+ return QuicStringPiece(reinterpret_cast<const char*>(public_key_),
+ sizeof(public_key_));
}
QuicTag P256KeyExchange::tag() const {
« no previous file with comments | « net/quic/core/crypto/p256_key_exchange.h ('k') | net/quic/core/crypto/p256_key_exchange_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698