summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorricea <ricea@chromium.org>2015-02-26 04:18:55 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-26 12:19:46 +0000
commit24c195f8b43b0eb75d1744e4d1eb95d7bd2fb2a6 (patch)
tree3092c0e34c7be319d62e094132434ab51cb2484b /net
parent9d3e646a9cc0ef50320b5c30847886a3e0171adc (diff)
downloadchromium_src-24c195f8b43b0eb75d1744e4d1eb95d7bd2fb2a6.zip
chromium_src-24c195f8b43b0eb75d1744e4d1eb95d7bd2fb2a6.tar.gz
chromium_src-24c195f8b43b0eb75d1744e4d1eb95d7bd2fb2a6.tar.bz2
Revert "[WebSocket] Add NOINLINE function calls to see the stack trace."
Bug 399535 is fixed so we no longer need the additional functions added to debug it. This reverts commit 27b2b57ce6d4e03728b3addf305f00d114b32e19. BUG=399535 Review URL: https://codereview.chromium.org/954393002 Cr-Commit-Position: refs/heads/master@{#318221}
Diffstat (limited to 'net')
-rw-r--r--net/websockets/websocket_basic_handshake_stream.cc53
-rw-r--r--net/websockets/websocket_basic_handshake_stream.h2
2 files changed, 4 insertions, 51 deletions
diff --git a/net/websockets/websocket_basic_handshake_stream.cc b/net/websockets/websocket_basic_handshake_stream.cc
index 7d99311..ecddd50 100644
--- a/net/websockets/websocket_basic_handshake_stream.cc
+++ b/net/websockets/websocket_basic_handshake_stream.cc
@@ -52,31 +52,6 @@ namespace {
const char kConnectionErrorStatusLine[] = "HTTP/1.1 503 Connection Error";
-// TODO(yhirano): Remove these functions once http://crbug.com/399535 is fixed.
-NOINLINE void RunCallbackWithOk(const CompletionCallback& callback,
- int result) {
- DCHECK_EQ(result, OK);
- callback.Run(OK);
-}
-
-NOINLINE void RunCallbackWithInvalidResponseCausedByRedirect(
- const CompletionCallback& callback,
- int result) {
- DCHECK_EQ(result, ERR_INVALID_RESPONSE);
- callback.Run(ERR_INVALID_RESPONSE);
-}
-
-NOINLINE void RunCallbackWithInvalidResponse(
- const CompletionCallback& callback,
- int result) {
- DCHECK_EQ(result, ERR_INVALID_RESPONSE);
- callback.Run(ERR_INVALID_RESPONSE);
-}
-
-NOINLINE void RunCallback(const CompletionCallback& callback, int result) {
- callback.Run(result);
-}
-
} // namespace
// TODO(ricea): If more extensions are added, replace this with a more general
@@ -463,8 +438,7 @@ int WebSocketBasicHandshakeStream::ReadResponseHeaders(
callback));
if (rv == ERR_IO_PENDING)
return rv;
- bool is_redirect = false;
- return ValidateResponse(rv, &is_redirect);
+ return ValidateResponse(rv);
}
int WebSocketBasicHandshakeStream::ReadResponseBody(
@@ -578,25 +552,7 @@ void WebSocketBasicHandshakeStream::SetWebSocketKeyForTesting(
void WebSocketBasicHandshakeStream::ReadResponseHeadersCallback(
const CompletionCallback& callback,
int result) {
- bool is_redirect = false;
- int rv = ValidateResponse(result, &is_redirect);
-
- // TODO(yhirano): Simplify this statement once http://crbug.com/399535 is
- // fixed.
- switch (rv) {
- case OK:
- RunCallbackWithOk(callback, rv);
- break;
- case ERR_INVALID_RESPONSE:
- if (is_redirect)
- RunCallbackWithInvalidResponseCausedByRedirect(callback, rv);
- else
- RunCallbackWithInvalidResponse(callback, rv);
- break;
- default:
- RunCallback(callback, rv);
- break;
- }
+ callback.Run(ValidateResponse(result));
}
void WebSocketBasicHandshakeStream::OnFinishOpeningHandshake() {
@@ -607,17 +563,14 @@ void WebSocketBasicHandshakeStream::OnFinishOpeningHandshake() {
http_response_info_->response_time);
}
-int WebSocketBasicHandshakeStream::ValidateResponse(int rv,
- bool* is_redirect) {
+int WebSocketBasicHandshakeStream::ValidateResponse(int rv) {
DCHECK(http_response_info_);
- *is_redirect = false;
// Most net errors happen during connection, so they are not seen by this
// method. The histogram for error codes is created in
// Delegate::OnResponseStarted in websocket_stream.cc instead.
if (rv >= 0) {
const HttpResponseHeaders* headers = http_response_info_->headers.get();
const int response_code = headers->response_code();
- *is_redirect = HttpResponseHeaders::IsRedirectResponseCode(response_code);
UMA_HISTOGRAM_SPARSE_SLOWLY("Net.WebSocket.ResponseCode", response_code);
switch (response_code) {
case HTTP_SWITCHING_PROTOCOLS:
diff --git a/net/websockets/websocket_basic_handshake_stream.h b/net/websockets/websocket_basic_handshake_stream.h
index 67458b0..634674a 100644
--- a/net/websockets/websocket_basic_handshake_stream.h
+++ b/net/websockets/websocket_basic_handshake_stream.h
@@ -87,7 +87,7 @@ class NET_EXPORT_PRIVATE WebSocketBasicHandshakeStream
void OnFinishOpeningHandshake();
// Validates the response and sends the finished handshake event.
- int ValidateResponse(int rv, bool* is_redirect);
+ int ValidateResponse(int rv);
// Check that the headers are well-formed for a 101 response, and returns
// OK if they are, otherwise returns ERR_INVALID_RESPONSE.