diff options
author | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-07 06:59:22 +0000 |
---|---|---|
committer | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-07 06:59:22 +0000 |
commit | e2fd69ef662218b1b1d82c33f38018631db3459d (patch) | |
tree | b7963e471be8fdf15a0e54df55fccdf6c3a273cc /net/websockets | |
parent | 16ee721c4e742ea7bdbe7cddc772243c81f04baf (diff) | |
download | chromium_src-e2fd69ef662218b1b1d82c33f38018631db3459d.zip chromium_src-e2fd69ef662218b1b1d82c33f38018631db3459d.tar.gz chromium_src-e2fd69ef662218b1b1d82c33f38018631db3459d.tar.bz2 |
SendPending() does nothing if socket_stream_ == NULL.
It might be socket_stream_ == NULL when SendPending() is called
for wss: URL in websocket_experiment.
SendPending() will be called asynchronously from OnConnected or OnSentData,
and DoClose() might run before SendPending() runs (especially for SSL case).
If socket_stream_ is NULL, it means it must be already closed
and do nothing in SendPending().
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1632002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43810 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets')
-rw-r--r-- | net/websockets/websocket.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/websockets/websocket.cc b/net/websockets/websocket.cc index c079aa5..fa6f180 100644 --- a/net/websockets/websocket.cc +++ b/net/websockets/websocket.cc @@ -209,7 +209,10 @@ void WebSocket::OnError(const SocketStream* socket_stream, int error) { void WebSocket::SendPending() { DCHECK(MessageLoop::current() == origin_loop_); - DCHECK(socket_stream_); + if (!socket_stream_) { + DCHECK_EQ(CLOSED, ready_state_); + return; + } if (!current_write_buf_) { if (pending_write_bufs_.empty()) { if (client_closing_handshake_) { |