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

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

Issue 10668018: Websocket should fire 'error' event if no server available (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: did some rebased work Created 7 years, 8 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/socket_stream_dispatcher_host.cc
diff --git a/content/browser/renderer_host/socket_stream_dispatcher_host.cc b/content/browser/renderer_host/socket_stream_dispatcher_host.cc
index 2eea8a88f2612c1bbfda2ca5a6b469c260a9109d..32d3a59eb408e8f44ab82353d98c023f95810990 100644
--- a/content/browser/renderer_host/socket_stream_dispatcher_host.cc
+++ b/content/browser/renderer_host/socket_stream_dispatcher_host.cc
@@ -101,6 +101,19 @@ void SocketStreamDispatcherHost::OnClose(net::SocketStream* socket) {
DeleteSocketStreamHost(socket_id);
}
+void SocketStreamDispatcherHost::OnError(const net::SocketStream* socket,
+ int error) {
+ int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket);
+ DVLOG(1) << "SocketStreamDispatcherHost::OnError socket_id=" << socket_id;
+ if (socket_id == content::kNoSocketId) {
+ LOG(ERROR) << "NoSocketId in OnError";
+ return;
+ }
tyoshino (SeeGerritForStatus) 2013/04/15 14:23:28 Not to surprise reader, please write some short co
Li Yin 2013/04/16 12:07:37 There is an issue here. OnError is almost called t
tyoshino (SeeGerritForStatus) 2013/04/17 08:15:49 Oh, right. We need to fix SocketStream. Could you
+ if (!Send(new SocketStreamMsg_Failed(socket_id, error))) {
+ LOG(ERROR) << "SocketStreamMsg_Failed failed.";
tyoshino (SeeGerritForStatus) 2013/04/15 14:23:28 Add DeleteSocketStreamHost(socket_id); ?
Li Yin 2013/04/16 12:07:37 Good catch. I'll fix it. Thanks.
+ }
+}
+
void SocketStreamDispatcherHost::OnSSLCertificateError(
net::SocketStream* socket, const net::SSLInfo& ssl_info, bool fatal) {
int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket);

Powered by Google App Engine
This is Rietveld 408576698