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

Unified Diff: trunk/src/net/websockets/websocket_stream.cc

Issue 388493002: Revert 282307 "Map WebSocket URL schemes to HTTP URL schemes for..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 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 | « trunk/src/net/websockets/websocket_stream.h ('k') | trunk/src/net/websockets/websocket_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/net/websockets/websocket_stream.cc
===================================================================
--- trunk/src/net/websockets/websocket_stream.cc (revision 282330)
+++ trunk/src/net/websockets/websocket_stream.cc (working copy)
@@ -10,7 +10,6 @@
#include "base/metrics/sparse_histogram.h"
#include "net/base/load_flags.h"
#include "net/http/http_request_headers.h"
-#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
@@ -134,20 +133,9 @@
break;
}
}
- ReportFailureWithMessage(failure_message_);
+ connect_delegate_->OnFailure(failure_message_);
}
- void ReportFailureWithMessage(const std::string& failure_message) {
- connect_delegate_->OnFailure(failure_message);
- }
-
- void OnFinishOpeningHandshake() {
- WebSocketDispatchOnFinishOpeningHandshake(connect_delegate(),
- url_request_.url(),
- url_request_.response_headers(),
- url_request_.response_time());
- }
-
WebSocketStream::ConnectDelegate* connect_delegate() const {
return connect_delegate_.get();
}
@@ -210,16 +198,7 @@
return;
case HTTP_UNAUTHORIZED:
- result_ = FAILED;
- owner_->OnFinishOpeningHandshake();
- owner_->ReportFailureWithMessage(
- "HTTP Authentication failed; no valid credentials available");
- return;
-
case HTTP_PROXY_AUTHENTICATION_REQUIRED:
- result_ = FAILED;
- owner_->OnFinishOpeningHandshake();
- owner_->ReportFailureWithMessage("Proxy authentication failed");
return;
default:
@@ -306,20 +285,4 @@
return request.PassAs<WebSocketStreamRequest>();
}
-void WebSocketDispatchOnFinishOpeningHandshake(
- WebSocketStream::ConnectDelegate* connect_delegate,
- const GURL& url,
- const scoped_refptr<HttpResponseHeaders>& headers,
- base::Time response_time) {
- DCHECK(connect_delegate);
- if (headers) {
- connect_delegate->OnFinishOpeningHandshake(make_scoped_ptr(
- new WebSocketHandshakeResponseInfo(url,
- headers->response_code(),
- headers->GetStatusText(),
- headers,
- response_time)));
- }
-}
-
} // namespace net
« no previous file with comments | « trunk/src/net/websockets/websocket_stream.h ('k') | trunk/src/net/websockets/websocket_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698