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

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

Issue 2603723002: Add a new QUIC platform API for text utilities. (Closed)
Patch Set: Tests 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
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..641f034ee2ec4eec8389d6699d52792504b31c66 100644
--- a/net/quic/core/quic_crypto_server_stream.cc
+++ b/net/quic/core/quic_crypto_server_stream.cc
@@ -17,6 +17,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 +422,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);
Jana 2016/12/27 23:52:48 Why's this resize not required anymore?
Ryan Hamilton 2016/12/28 01:48:38 All of this logic has moved into the new QuicTextU
- }
- }
+ QuicTextUtils::Base64Encode(digest, arraysize(digest), output);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698