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

Unified Diff: content/renderer/p2p/ipc_socket_factory.cc

Issue 288923014: Send SignalClose to the clients of P2PSocket, if TCP socket is failed to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/p2p/ipc_socket_factory.cc
diff --git a/content/renderer/p2p/ipc_socket_factory.cc b/content/renderer/p2p/ipc_socket_factory.cc
index 59d94ff6837c0f04ff221ef1b51044d0a1f1bb17..d0354943491a691c0bed4ccc59a8d73b5e20ce26 100644
--- a/content/renderer/p2p/ipc_socket_factory.cc
+++ b/content/renderer/p2p/ipc_socket_factory.cc
@@ -474,8 +474,12 @@ void IpcPacketSocket::OnSendComplete() {
void IpcPacketSocket::OnError() {
DCHECK_EQ(base::MessageLoop::current(), message_loop_);
+ bool was_closed = (state_ == IS_ERROR || state_ == IS_CLOSED);
state_ = IS_ERROR;
error_ = ECONNABORTED;
+ if (!was_closed) {
+ SignalClose(this, 0);
+ }
}
void IpcPacketSocket::OnDataReceived(const net::IPEndPoint& address,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698