summaryrefslogtreecommitdiffstats
path: root/net/socket_stream
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-19 05:19:45 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-19 05:19:45 +0000
commit0f12f892066a9cb8396e67aa0a6e956d7a625cc5 (patch)
treeb6116108926ab884f75f102ebca279a642ff964e /net/socket_stream
parent12dc10faf13ff52d6e63baf7b5fcc05002c8f831 (diff)
downloadchromium_src-0f12f892066a9cb8396e67aa0a6e956d7a625cc5.zip
chromium_src-0f12f892066a9cb8396e67aa0a6e956d7a625cc5.tar.gz
chromium_src-0f12f892066a9cb8396e67aa0a6e956d7a625cc5.tar.bz2
Try to fix flaky websocket tests.
Some websoket layout tests became flaky from r41818. This is because it adds websocket throttling in WebSocketJob. Make sure Close() will call OnClose() even if it is waiting resolving or waiting in throttling queue, so that WebSocketJob is removed from throttling queue and wake up next WebSocketJob. BUG=38397 TEST=layout tests websocket/tests passes Review URL: http://codereview.chromium.org/1096001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42074 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream')
-rw-r--r--net/socket_stream/socket_stream.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index b6d3a65..1d10ad5 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -167,9 +167,8 @@ void SocketStream::Close() {
"The current MessageLoop must exist";
DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) <<
"The current MessageLoop must be TYPE_IO";
- if (!socket_.get() || !socket_->IsConnected() || next_state_ == STATE_NONE)
- return;
- socket_->Disconnect();
+ if (socket_.get() && socket_->IsConnected())
+ socket_->Disconnect();
next_state_ = STATE_CLOSE;
// Close asynchronously, so that delegate won't be called
// back before returning Close().