Skip to content

Commit

Permalink
[WebSocket] Add DCHECK on OnFailChannel() call
Browse files Browse the repository at this point in the history
Make it clear that OnFailChannel() is expected to delete channel.

R=yhirano
BUG=none

Review URL: https://codereview.chromium.org/704743002

Cr-Commit-Position: refs/heads/master@{#302965}
  • Loading branch information
tyoshino authored and Commit bot committed Nov 6, 2014
1 parent 6601f74 commit ae74d7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/websockets/websocket_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ void WebSocketChannel::OnConnectFailure(const std::string& message) {
// |this| has been deleted.
return;
}
ignore_result(event_interface_->OnFailChannel(message_copy));
ChannelState result = event_interface_->OnFailChannel(message_copy);
DCHECK_EQ(CHANNEL_DELETED, result);
// |this| has been deleted.
}

Expand Down Expand Up @@ -1000,7 +1001,9 @@ ChannelState WebSocketChannel::FailChannel(const std::string& message,
// handshake.
stream_->Close();
SetState(CLOSED);
return event_interface_->OnFailChannel(message);
ChannelState result = event_interface_->OnFailChannel(message);
DCHECK_EQ(CHANNEL_DELETED, result);
return result;
}

ChannelState WebSocketChannel::SendClose(uint16 code,
Expand Down

0 comments on commit ae74d7a

Please sign in to comment.