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

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

Issue 6474012: Create a path to deliver SocketStream errors to the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test and test_shell code Created 9 years, 10 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: chrome/browser/renderer_host/socket_stream_dispatcher_host.cc
diff --git a/chrome/browser/renderer_host/socket_stream_dispatcher_host.cc b/chrome/browser/renderer_host/socket_stream_dispatcher_host.cc
index 95db4d8ac0a2b306f214c965583a40c55993074f..278c62c9d058d7bf00146e8b10d5ce46ceb46040 100644
--- a/chrome/browser/renderer_host/socket_stream_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/socket_stream_dispatcher_host.cc
@@ -100,6 +100,20 @@ 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 == chrome_common_net::kNoSocketId) {
+ LOG(ERROR) << "NoSocketId in OnError";
+ return;
+ }
+ if (!Send(new ViewMsg_SocketStream_Error(socket_id, error))) {
+ LOG(ERROR) << "ViewMsg_SocketStream_ReceivedData failed.";
+ DeleteSocketStreamHost(socket_id);
+ }
+}
+
// Message handlers called by OnMessageReceived.
void SocketStreamDispatcherHost::OnConnect(const GURL& url, int socket_id) {
DVLOG(1) << "SocketStreamDispatcherHost::OnConnect url=" << url

Powered by Google App Engine
This is Rietveld 408576698