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

Unified Diff: content/browser/renderer_host/websocket_host.cc

Issue 105833003: Fail WebSocket channel when handshake fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: content/browser/renderer_host/websocket_host.cc
diff --git a/content/browser/renderer_host/websocket_host.cc b/content/browser/renderer_host/websocket_host.cc
index aff172cb86943a48a576a5faa7eb6b13fcada432..b1a0bab3bfd5af67fda8ac7b617c34bca52f9152 100644
--- a/content/browser/renderer_host/websocket_host.cc
+++ b/content/browser/renderer_host/websocket_host.cc
@@ -92,6 +92,7 @@ class WebSocketEventHandler : public net::WebSocketEventInterface {
virtual ChannelState OnFlowControl(int64 quota) OVERRIDE;
virtual ChannelState OnDropChannel(uint16 code,
const std::string& reason) OVERRIDE;
+ virtual ChannelState OnFailChannel(const std::string& message) OVERRIDE;
private:
WebSocketDispatcherHost* const dispatcher_;
@@ -150,6 +151,13 @@ ChannelState WebSocketEventHandler::OnDropChannel(uint16 code,
return StateCast(dispatcher_->DoDropChannel(routing_id_, code, reason));
}
+ChannelState WebSocketEventHandler::OnFailChannel(const std::string& message) {
+ DVLOG(3) << "WebSocketEventHandler::OnFailChannel"
+ << " routing_id=" << routing_id_
+ << " message=\"" << message << "\"";
+ return StateCast(dispatcher_->NotifyFailure(routing_id_, message));
+}
+
} // namespace
WebSocketHost::WebSocketHost(int routing_id,
« no previous file with comments | « content/browser/renderer_host/websocket_dispatcher_host.cc ('k') | net/http/http_stream_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698