summaryrefslogtreecommitdiffstats
path: root/net/websockets
diff options
context:
space:
mode:
authorricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-06 11:03:18 +0000
committerricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-06 11:03:18 +0000
commit5742ae68853c3206fca9dd92ab453c5c65adc277 (patch)
treea0238332aa914fbee5c62dcac11cac8ac31df228 /net/websockets
parentd9a2e414dc7535897b208f70b62c4a0fce284424 (diff)
downloadchromium_src-5742ae68853c3206fca9dd92ab453c5c65adc277.zip
chromium_src-5742ae68853c3206fca9dd92ab453c5c65adc277.tar.gz
chromium_src-5742ae68853c3206fca9dd92ab453c5c65adc277.tar.bz2
Don't set reason "Abnormal Closure"
Previously, WebSocketChannel arbitrarily used the reason text "Abnormal Closure" when there was a failure leading to a 1006 close code. This is not compliant with the WHATWG spec and doesn't match the old implementation. Changed to use no reason text. BUG=340963 TEST=net_unittests --gtest_filter=WebSocket*, layout tests Review URL: https://codereview.chromium.org/143693009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249350 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets')
-rw-r--r--net/websockets/websocket_channel.cc7
-rw-r--r--net/websockets/websocket_channel_test.cc2
2 files changed, 4 insertions, 5 deletions
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index 0e68168..94baafd 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -504,7 +504,7 @@ ChannelState WebSocketChannel::OnWriteDone(bool synchronous, int result) {
stream_->Close();
DCHECK_NE(CLOSED, state_);
state_ = CLOSED;
- return DoDropChannel(kWebSocketErrorAbnormalClosure, "Abnormal Closure");
+ return DoDropChannel(kWebSocketErrorAbnormalClosure, "");
}
}
@@ -567,7 +567,7 @@ ChannelState WebSocketChannel::OnReadDone(bool synchronous, int result) {
DCHECK_NE(CLOSED, state_);
state_ = CLOSED;
uint16 code = kWebSocketErrorAbnormalClosure;
- std::string reason = "Abnormal Closure";
+ std::string reason = "";
if (closing_code_ != 0) {
code = closing_code_;
reason = closing_reason_;
@@ -871,8 +871,7 @@ void WebSocketChannel::CloseTimeout() {
stream_->Close();
DCHECK_NE(CLOSED, state_);
state_ = CLOSED;
- AllowUnused(DoDropChannel(kWebSocketErrorAbnormalClosure,
- "Abnormal Closure"));
+ AllowUnused(DoDropChannel(kWebSocketErrorAbnormalClosure, ""));
// |this| has been deleted.
}
diff --git a/net/websockets/websocket_channel_test.cc b/net/websockets/websocket_channel_test.cc
index bf488e8..ed309c7 100644
--- a/net/websockets/websocket_channel_test.cc
+++ b/net/websockets/websocket_channel_test.cc
@@ -1808,7 +1808,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, OnDropChannelCalledOnce) {
EXPECT_CALL(*event_interface_, OnFlowControl(_));
EXPECT_CALL(*event_interface_,
- OnDropChannel(kWebSocketErrorAbnormalClosure, "Abnormal Closure"))
+ OnDropChannel(kWebSocketErrorAbnormalClosure, ""))
.Times(1);
CreateChannelAndConnectSuccessfully();