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

Unified Diff: Source/modules/websockets/WebSocketHandshake.cpp

Issue 139193002: Declaration of sha1HashSize variable in proper file (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Giving more descriptive name to constant Created 6 years, 11 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 | « no previous file | Source/wtf/SHA1.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/WebSocketHandshake.cpp
diff --git a/Source/modules/websockets/WebSocketHandshake.cpp b/Source/modules/websockets/WebSocketHandshake.cpp
index b0ed328eb15260c46a096eeea958649db3264814..cff98c34b7bb528afd2b700a68a3e4562a666c2c 100644
--- a/Source/modules/websockets/WebSocketHandshake.cpp
+++ b/Source/modules/websockets/WebSocketHandshake.cpp
@@ -121,14 +121,14 @@ static String generateSecWebSocketKey()
String WebSocketHandshake::getExpectedWebSocketAccept(const String& secWebSocketKey)
{
static const char webSocketKeyGUID[] = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
- static const size_t sha1HashSize = 20; // FIXME: This should be defined in SHA1.h.
SHA1 sha1;
CString keyData = secWebSocketKey.ascii();
sha1.addBytes(reinterpret_cast<const uint8_t*>(keyData.data()), keyData.length());
sha1.addBytes(reinterpret_cast<const uint8_t*>(webSocketKeyGUID), strlen(webSocketKeyGUID));
- Vector<uint8_t, sha1HashSize> hash;
+ Vector<uint8_t, SHA1::outputSizeBytes> hash;
sha1.computeHash(hash);
- return base64Encode(reinterpret_cast<const char*>(hash.data()), sha1HashSize);
+ return base64Encode(reinterpret_cast<const char*>(hash.data()),
+ SHA1::outputSizeBytes);
}
WebSocketHandshake::WebSocketHandshake(const KURL& url, const String& protocol, ExecutionContext* context)
« no previous file with comments | « no previous file | Source/wtf/SHA1.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698