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

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

Issue 2603723002: Add a new QUIC platform API for text utilities. (Closed)
Patch Set: net/tools/quic/quic_packet_printer_bin.cc Created 4 years 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_crypto_client_stream.cc ('k') | net/quic/core/quic_flow_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_crypto_server_stream.cc
diff --git a/net/quic/core/quic_crypto_server_stream.cc b/net/quic/core/quic_crypto_server_stream.cc
index f1b604141e575e7c9585eba87f7d31a879916da0..6bf695118507d4698801950747c303a041cbade7 100644
--- a/net/quic/core/quic_crypto_server_stream.cc
+++ b/net/quic/core/quic_crypto_server_stream.cc
@@ -6,7 +6,6 @@
#include <memory>
-#include "base/base64.h"
#include "crypto/secure_hash.h"
#include "net/quic/core/crypto/crypto_protocol.h"
#include "net/quic/core/crypto/crypto_utils.h"
@@ -17,6 +16,7 @@
#include "net/quic/core/quic_flags.h"
#include "net/quic/core/quic_packets.h"
#include "net/quic/core/quic_session.h"
+#include "net/quic/platform/api/quic_text_utils.h"
using base::StringPiece;
using std::string;
@@ -421,19 +421,7 @@ bool QuicCryptoServerStream::GetBase64SHA256ClientChannelID(
uint8_t digest[32];
hash->Finish(digest, sizeof(digest));
- base::Base64Encode(
- string(reinterpret_cast<const char*>(digest), sizeof(digest)), output);
- // Remove padding.
- size_t len = output->size();
- if (len >= 2) {
- if ((*output)[len - 1] == '=') {
- len--;
- if ((*output)[len - 1] == '=') {
- len--;
- }
- output->resize(len);
- }
- }
+ QuicTextUtils::Base64Encode(digest, arraysize(digest), output);
return true;
}
« no previous file with comments | « net/quic/core/quic_crypto_client_stream.cc ('k') | net/quic/core/quic_flow_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698