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

Unified Diff: net/quic/core/crypto/common_cert_set.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/common_cert_set.h ('k') | net/quic/core/crypto/common_cert_set_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/common_cert_set.cc
diff --git a/net/quic/core/crypto/common_cert_set.cc b/net/quic/core/crypto/common_cert_set.cc
index 25bde99fc20a2c5d5a44e2a406b308fc40a0c00b..9ef68d8cc00339e56df8ec4c218c1fc9b1dc024e 100644
--- a/net/quic/core/crypto/common_cert_set.cc
+++ b/net/quic/core/crypto/common_cert_set.cc
@@ -10,7 +10,6 @@
#include "base/memory/singleton.h"
#include "net/quic/core/quic_utils.h"
-using base::StringPiece;
namespace net {
@@ -53,7 +52,7 @@ const uint64_t kSetHashes[] = {
// Compare returns a value less than, equal to or greater than zero if |a| is
// lexicographically less than, equal to or greater than |b|, respectively.
-int Compare(StringPiece a, const unsigned char* b, size_t b_len) {
+int Compare(QuicStringPiece a, const unsigned char* b, size_t b_len) {
size_t len = a.size();
if (len > b_len) {
len = b_len;
@@ -76,16 +75,16 @@ int Compare(StringPiece a, const unsigned char* b, size_t b_len) {
class CommonCertSetsQUIC : public CommonCertSets {
public:
// CommonCertSets interface.
- StringPiece GetCommonHashes() const override {
- return StringPiece(reinterpret_cast<const char*>(kSetHashes),
- sizeof(uint64_t) * arraysize(kSetHashes));
+ QuicStringPiece GetCommonHashes() const override {
+ return QuicStringPiece(reinterpret_cast<const char*>(kSetHashes),
+ sizeof(uint64_t) * arraysize(kSetHashes));
}
- StringPiece GetCert(uint64_t hash, uint32_t index) const override {
+ QuicStringPiece GetCert(uint64_t hash, uint32_t index) const override {
for (size_t i = 0; i < arraysize(kSets); i++) {
if (kSets[i].hash == hash) {
if (index < kSets[i].num_certs) {
- return StringPiece(
+ return QuicStringPiece(
reinterpret_cast<const char*>(kSets[i].certs[index]),
kSets[i].lens[index]);
}
@@ -93,11 +92,11 @@ class CommonCertSetsQUIC : public CommonCertSets {
}
}
- return StringPiece();
+ return QuicStringPiece();
}
- bool MatchCert(StringPiece cert,
- StringPiece common_set_hashes,
+ bool MatchCert(QuicStringPiece cert,
+ QuicStringPiece common_set_hashes,
uint64_t* out_hash,
uint32_t* out_index) const override {
if (common_set_hashes.size() % sizeof(uint64_t) != 0) {
« no previous file with comments | « net/quic/core/crypto/common_cert_set.h ('k') | net/quic/core/crypto/common_cert_set_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698