diff options
author | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-19 06:20:20 +0000 |
---|---|---|
committer | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-19 06:20:20 +0000 |
commit | 34fda3e29292d492c9853b7f352569f2a3a39b2e (patch) | |
tree | 361e484c4416257feb9d9fe5ec65bbf4869d7406 /net/socket_stream | |
parent | 0f12f892066a9cb8396e67aa0a6e956d7a625cc5 (diff) | |
download | chromium_src-34fda3e29292d492c9853b7f352569f2a3a39b2e.zip chromium_src-34fda3e29292d492c9853b7f352569f2a3a39b2e.tar.gz chromium_src-34fda3e29292d492c9853b7f352569f2a3a39b2e.tar.bz2 |
Revert 42074 - 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
TBR=ukai@chromium.org
Review URL: http://codereview.chromium.org/1120004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream')
-rw-r--r-- | net/socket_stream/socket_stream.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc index 1d10ad5..b6d3a65 100644 --- a/net/socket_stream/socket_stream.cc +++ b/net/socket_stream/socket_stream.cc @@ -167,8 +167,9 @@ 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()) - socket_->Disconnect(); + if (!socket_.get() || !socket_->IsConnected() || next_state_ == STATE_NONE) + return; + socket_->Disconnect(); next_state_ = STATE_CLOSE; // Close asynchronously, so that delegate won't be called // back before returning Close(). |