summaryrefslogtreecommitdiffstats
path: root/net/websockets
diff options
context:
space:
mode:
authorvadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-11 01:48:50 +0000
committervadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-11 01:48:50 +0000
commit33fca12d265b8129e6cff8fc1fc9ad7b34a19bab (patch)
treeef737a2c12192c512ea7e05460c758e42200590a /net/websockets
parent5cddcd140cbe8fc9a8e10e67142cee75dc99684b (diff)
downloadchromium_src-33fca12d265b8129e6cff8fc1fc9ad7b34a19bab.zip
chromium_src-33fca12d265b8129e6cff8fc1fc9ad7b34a19bab.tar.gz
chromium_src-33fca12d265b8129e6cff8fc1fc9ad7b34a19bab.tar.bz2
Revert 239921 "Revert 239759 "The comment in base64.h implies th..."
***************** Reverting the revert. Congrats, the original CL wasn't the cause for the failure; sorry for the mess. ***************** > Revert 239759 "The comment in base64.h implies that base::Base64..." > > > The comment in base64.h implies that base::Base64Encode() can return false, but > > this cannot happen in practice. Fix the comment. > > > > The implementation of Base64Encode() attempts to check for the return value > > MODP_B64_ERROR as a failure, but modp_b64_encode() cannot return this > > value. Remove the check. > > > > Remove unneeded integer cast. > > > > Change the return type to void. > > > > BUG=323357 > > TEST=base_unittests, compile all > > TBR=jochen@chromium.org,miket@chromium.org,joi@chromium.org,akalin@chromium.org,sergeyu@chromium.org > > > > Review URL: https://codereview.chromium.org/86913002 > > TBR=ricea@chromium.org > > Review URL: https://codereview.chromium.org/101113004 TBR=vadimt@chromium.org Review URL: https://codereview.chromium.org/111883004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239944 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets')
-rw-r--r--net/websockets/websocket_basic_handshake_stream.cc3
-rw-r--r--net/websockets/websocket_handshake_handler.cc6
2 files changed, 3 insertions, 6 deletions
diff --git a/net/websockets/websocket_basic_handshake_stream.cc b/net/websockets/websocket_basic_handshake_stream.cc
index 1a8154b..8c0e42e 100644
--- a/net/websockets/websocket_basic_handshake_stream.cc
+++ b/net/websockets/websocket_basic_handshake_stream.cc
@@ -33,8 +33,7 @@ std::string GenerateHandshakeChallenge() {
std::string raw_challenge(websockets::kRawChallengeLength, '\0');
crypto::RandBytes(string_as_array(&raw_challenge), raw_challenge.length());
std::string encoded_challenge;
- bool encode_success = base::Base64Encode(raw_challenge, &encoded_challenge);
- DCHECK(encode_success);
+ base::Base64Encode(raw_challenge, &encoded_challenge);
return encoded_challenge;
}
diff --git a/net/websockets/websocket_handshake_handler.cc b/net/websockets/websocket_handshake_handler.cc
index 641b196..787dde6 100644
--- a/net/websockets/websocket_handshake_handler.cc
+++ b/net/websockets/websocket_handshake_handler.cc
@@ -351,8 +351,7 @@ void ComputeSecWebSocketAccept(const std::string& key,
std::string hash =
base::SHA1HashString(key + websockets::kWebSocketGuid);
- bool encode_success = base::Base64Encode(hash, accept);
- DCHECK(encode_success);
+ base::Base64Encode(hash, accept);
}
bool WebSocketHandshakeResponseHandler::ParseResponseInfo(
@@ -405,8 +404,7 @@ bool WebSocketHandshakeResponseHandler::ParseResponseHeaderBlock(
std::string hash =
base::SHA1HashString(challenge + websockets::kWebSocketGuid);
std::string websocket_accept;
- bool encode_success = base::Base64Encode(hash, &websocket_accept);
- DCHECK(encode_success);
+ base::Base64Encode(hash, &websocket_accept);
std::string response_message = base::StringPrintf(
"%s %s\r\n", websockets::kHttpProtocolVersion, status->second.c_str());