Reviewed by Alexey Proskuryakov.
WebSocket: Add assertion for SocketStreamError::failingURL.
https://bugs.webkit.org/show_bug.cgi?id=58765
No new tests, because an existing test http/tests/inspector/console-websocket-error.html should cover this.
* websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didFail): If error.failingURL() is provided, it must be the same as
m_handshake.url(). failingURL may be null if SocketStreamHandle has created a SocketStreamError
using zero- or one-argument constructor (which is old version but some ports are still using it).
In that case, m_handshake.url() is passed to addMessage().
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84340
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-04-19 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ WebSocket: Add assertion for SocketStreamError::failingURL.
+ https://bugs.webkit.org/show_bug.cgi?id=58765
+
+ No new tests, because an existing test http/tests/inspector/console-websocket-error.html should cover this.
+
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::didFail): If error.failingURL() is provided, it must be the same as
+ m_handshake.url(). failingURL may be null if SocketStreamHandle has created a SocketStreamError
+ using zero- or one-argument constructor (which is old version but some ports are still using it).
+ In that case, m_handshake.url() is passed to addMessage().
+
2011-04-19 Eric Carlson <eric.carlson@apple.com>
Reviewed by Dimitri Glazkov.
message = makeString("WebSocket network error: error code ", String::number(error.errorCode()));
else
message = makeString("WebSocket network error: ", error.localizedDescription());
- m_context->addMessage(OtherMessageSource, NetworkErrorMessageType, ErrorMessageLevel, message, 0, error.failingURL(), 0);
+ String failingURL = error.failingURL();
+ ASSERT(failingURL.isNull() || m_handshake.url().string() == failingURL);
+ if (failingURL.isNull())
+ failingURL = m_handshake.url().string();
+ m_context->addMessage(OtherMessageSource, NetworkErrorMessageType, ErrorMessageLevel, message, 0, failingURL, 0);
}
m_shouldDiscardReceivedData = true;
handle->close();