Changeset 84340 in webkit


Ignore:
Timestamp:
Apr 19, 2011 9:51:11 PM (13 years ago)
Author:
yutak@chromium.org
Message:

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().
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84336 r84340  
     12011-04-19  Yuta Kitamura  <yutak@chromium.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        WebSocket: Add assertion for SocketStreamError::failingURL.
     6        https://bugs.webkit.org/show_bug.cgi?id=58765
     7
     8        No new tests, because an existing test http/tests/inspector/console-websocket-error.html should cover this.
     9
     10        * websockets/WebSocketChannel.cpp:
     11        (WebCore::WebSocketChannel::didFail): If error.failingURL() is provided, it must be the same as
     12        m_handshake.url(). failingURL may be null if SocketStreamHandle has created a SocketStreamError
     13        using zero- or one-argument constructor (which is old version but some ports are still using it).
     14        In that case, m_handshake.url() is passed to addMessage().
     15
    1162011-04-19  Eric Carlson  <eric.carlson@apple.com>
    217
  • trunk/Source/WebCore/websockets/WebSocketChannel.cpp

    r76216 r84340  
    220220        else
    221221            message = makeString("WebSocket network error: ", error.localizedDescription());
    222         m_context->addMessage(OtherMessageSource, NetworkErrorMessageType, ErrorMessageLevel, message, 0, error.failingURL(), 0);
     222        String failingURL = error.failingURL();
     223        ASSERT(failingURL.isNull() || m_handshake.url().string() == failingURL);
     224        if (failingURL.isNull())
     225            failingURL = m_handshake.url().string();
     226        m_context->addMessage(OtherMessageSource, NetworkErrorMessageType, ErrorMessageLevel, message, 0, failingURL, 0);
    223227    }
    224228    m_shouldDiscardReceivedData = true;
Note: See TracChangeset for help on using the changeset viewer.