| Index: net/socket_stream/socket_stream.cc
|
| diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
|
| index 4c5b13a27fb4555d43efee63e2ea8661de373129..d89c074a061fe00a0db631fdbeab487b541c93f6 100644
|
| --- a/net/socket_stream/socket_stream.cc
|
| +++ b/net/socket_stream/socket_stream.cc
|
| @@ -290,14 +290,14 @@ void SocketStream::Finish(int result) {
|
| result = ERR_CONNECTION_CLOSED;
|
| DCHECK_EQ(next_state_, STATE_NONE);
|
| DVLOG(1) << "Finish result=" << ErrorToString(result);
|
| - if (delegate_)
|
| - delegate_->OnError(this, result);
|
|
|
| metrics_->OnClose();
|
| Delegate* delegate = delegate_;
|
| delegate_ = NULL;
|
| if (delegate) {
|
| - delegate->OnClose(this);
|
| + delegate->OnError(this, result);
|
| + if (result != ERR_PROTOCOL_SWITCHED)
|
| + delegate->OnClose(this);
|
| }
|
| Release();
|
| }
|
|
|