Changeset 147542 in webkit


Ignore:
Timestamp:
Apr 3, 2013 5:15:54 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Refine LOG messages in WebSocket related components
https://bugs.webkit.org/show_bug.cgi?id=113852

Patch by Takeshi Yoshino <tyoshino@chromium.org> on 2013-04-03
Reviewed by Kent Tamura.

Refine LOG messages by

  • Make them contain method names to ease identifying where the event occurred.
  • For consistency, make all messages print the pointer of the origin instance.
  • Quote UTF8 data in LOG messages.
  • For overloaded methods, add the type to clarify which one is run
  • Modules/websockets/WebSocket.cpp:

(WebCore::WebSocket::connect):
(WebCore::WebSocket::send):
(WebCore::WebSocket::close):
(WebCore::WebSocket::contextDestroyed):
(WebCore::WebSocket::didConnect):
(WebCore::WebSocket::didReceiveMessage):
(WebCore::WebSocket::didReceiveBinaryData):
(WebCore::WebSocket::didReceiveMessageError):
(WebCore::WebSocket::didUpdateBufferedAmount):
(WebCore::WebSocket::didStartClosingHandshake):
(WebCore::WebSocket::didClose):

  • Modules/websockets/WebSocketChannel.cpp:

(WebCore::WebSocketChannel::connect):
(WebCore::WebSocketChannel::subprotocol):
(WebCore::WebSocketChannel::extensions):
(WebCore::WebSocketChannel::send):
(WebCore::WebSocketChannel::bufferedAmount):
(WebCore::WebSocketChannel::close):
(WebCore::WebSocketChannel::fail):
(WebCore::WebSocketChannel::disconnect):
(WebCore::WebSocketChannel::willOpenSocketStream):
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::didCloseSocketStream):
(WebCore::WebSocketChannel::didReceiveSocketStreamData):
(WebCore::WebSocketChannel::didFailSocketStream):
(WebCore::WebSocketChannel::didStartLoading):
(WebCore::WebSocketChannel::didReceiveData):
(WebCore::WebSocketChannel::didFinishLoading):
(WebCore::WebSocketChannel::didFail):
(WebCore::WebSocketChannel::appendToBuffer):
(WebCore::WebSocketChannel::processBuffer):
(WebCore::WebSocketChannel::startClosingHandshake):
(WebCore::WebSocketChannel::closingTimerFired):

  • Modules/websockets/WebSocketDeflater.cpp:

(WebCore::WebSocketDeflater::~WebSocketDeflater):
(WebCore::WebSocketInflater::~WebSocketInflater):

  • Modules/websockets/WebSocketHandshake.cpp:

(WebCore::WebSocketHandshake::readServerHandshake):

  • platform/network/chromium/SocketStreamHandle.cpp:

(WebCore::SocketStreamHandleInternal::connect):
(WebCore::SocketStreamHandleInternal::send):
(WebCore::SocketStreamHandleInternal::close):
(WebCore::SocketStreamHandleInternal::didOpenStream):
(WebCore::SocketStreamHandleInternal::didSendData):
(WebCore::SocketStreamHandleInternal::didReceiveData):
(WebCore::SocketStreamHandleInternal::didClose):
(WebCore::SocketStreamHandleInternal::didFail):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147541 r147542  
     12013-04-03  Takeshi Yoshino  <tyoshino@chromium.org>
     2
     3        Refine LOG messages in WebSocket related components
     4        https://bugs.webkit.org/show_bug.cgi?id=113852
     5
     6        Reviewed by Kent Tamura.
     7
     8        Refine LOG messages by
     9        - Make them contain method names to ease identifying where the event occurred.
     10        - For consistency, make all messages print the pointer of the origin instance.
     11        - Quote UTF8 data in LOG messages.
     12        - For overloaded methods, add the type to clarify which one is run
     13
     14        * Modules/websockets/WebSocket.cpp:
     15        (WebCore::WebSocket::connect):
     16        (WebCore::WebSocket::send):
     17        (WebCore::WebSocket::close):
     18        (WebCore::WebSocket::contextDestroyed):
     19        (WebCore::WebSocket::didConnect):
     20        (WebCore::WebSocket::didReceiveMessage):
     21        (WebCore::WebSocket::didReceiveBinaryData):
     22        (WebCore::WebSocket::didReceiveMessageError):
     23        (WebCore::WebSocket::didUpdateBufferedAmount):
     24        (WebCore::WebSocket::didStartClosingHandshake):
     25        (WebCore::WebSocket::didClose):
     26        * Modules/websockets/WebSocketChannel.cpp:
     27        (WebCore::WebSocketChannel::connect):
     28        (WebCore::WebSocketChannel::subprotocol):
     29        (WebCore::WebSocketChannel::extensions):
     30        (WebCore::WebSocketChannel::send):
     31        (WebCore::WebSocketChannel::bufferedAmount):
     32        (WebCore::WebSocketChannel::close):
     33        (WebCore::WebSocketChannel::fail):
     34        (WebCore::WebSocketChannel::disconnect):
     35        (WebCore::WebSocketChannel::willOpenSocketStream):
     36        (WebCore::WebSocketChannel::didOpenSocketStream):
     37        (WebCore::WebSocketChannel::didCloseSocketStream):
     38        (WebCore::WebSocketChannel::didReceiveSocketStreamData):
     39        (WebCore::WebSocketChannel::didFailSocketStream):
     40        (WebCore::WebSocketChannel::didStartLoading):
     41        (WebCore::WebSocketChannel::didReceiveData):
     42        (WebCore::WebSocketChannel::didFinishLoading):
     43        (WebCore::WebSocketChannel::didFail):
     44        (WebCore::WebSocketChannel::appendToBuffer):
     45        (WebCore::WebSocketChannel::processBuffer):
     46        (WebCore::WebSocketChannel::startClosingHandshake):
     47        (WebCore::WebSocketChannel::closingTimerFired):
     48        * Modules/websockets/WebSocketDeflater.cpp:
     49        (WebCore::WebSocketDeflater::~WebSocketDeflater):
     50        (WebCore::WebSocketInflater::~WebSocketInflater):
     51        * Modules/websockets/WebSocketHandshake.cpp:
     52        (WebCore::WebSocketHandshake::readServerHandshake):
     53        * platform/network/chromium/SocketStreamHandle.cpp:
     54        (WebCore::SocketStreamHandleInternal::connect):
     55        (WebCore::SocketStreamHandleInternal::send):
     56        (WebCore::SocketStreamHandleInternal::close):
     57        (WebCore::SocketStreamHandleInternal::didOpenStream):
     58        (WebCore::SocketStreamHandleInternal::didSendData):
     59        (WebCore::SocketStreamHandleInternal::didReceiveData):
     60        (WebCore::SocketStreamHandleInternal::didClose):
     61        (WebCore::SocketStreamHandleInternal::didFail):
     62
    1632013-04-03  Tor Arne Vestbø  <tor.arne.vestbo@digia.com>
    264
  • trunk/Source/WebCore/Modules/websockets/WebSocket.cpp

    r146537 r147542  
    212212void WebSocket::connect(const String& url, const Vector<String>& protocols, ExceptionCode& ec)
    213213{
    214     LOG(Network, "WebSocket %p connect to %s", this, url.utf8().data());
     214    LOG(Network, "WebSocket %p connect() url='%s'", this, url.utf8().data());
    215215    m_url = KURL(KURL(), url);
    216216
     
    293293bool WebSocket::send(const String& message, ExceptionCode& ec)
    294294{
    295     LOG(Network, "WebSocket %p send %s", this, message.utf8().data());
     295    LOG(Network, "WebSocket %p send() Sending String '%s'", this, message.utf8().data());
    296296    if (m_state == CONNECTING) {
    297297        ec = INVALID_STATE_ERR;
     
    317317bool WebSocket::send(ArrayBuffer* binaryData, ExceptionCode& ec)
    318318{
    319     LOG(Network, "WebSocket %p send arraybuffer %p", this, binaryData);
     319    LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, binaryData);
    320320    ASSERT(binaryData);
    321321    if (m_state == CONNECTING) {
     
    335335bool WebSocket::send(ArrayBufferView* arrayBufferView, ExceptionCode& ec)
    336336{
    337     LOG(Network, "WebSocket %p send arraybufferview %p", this, arrayBufferView);
     337    LOG(Network, "WebSocket %p send() Sending ArrayBufferView %p", this, arrayBufferView);
    338338    ASSERT(arrayBufferView);
    339339    if (m_state == CONNECTING) {
     
    354354bool WebSocket::send(Blob* binaryData, ExceptionCode& ec)
    355355{
    356     LOG(Network, "WebSocket %p send blob %s", this, binaryData->url().elidedString().utf8().data());
     356    LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData->url().elidedString().utf8().data());
    357357    ASSERT(binaryData);
    358358    if (m_state == CONNECTING) {
     
    373373{
    374374    if (code == WebSocketChannel::CloseEventCodeNotSpecified)
    375         LOG(Network, "WebSocket %p close without code and reason", this);
     375        LOG(Network, "WebSocket %p close() without code and reason", this);
    376376    else {
    377         LOG(Network, "WebSocket %p close with code = %d, reason = %s", this, code, reason.utf8().data());
     377        LOG(Network, "WebSocket %p close() code=%d reason='%s'", this, code, reason.utf8().data());
    378378        if (!(code == WebSocketChannel::CloseEventCodeNormalClosure || (WebSocketChannel::CloseEventCodeMinimumUserDefined <= code && code <= WebSocketChannel::CloseEventCodeMaximumUserDefined))) {
    379379            ec = INVALID_ACCESS_ERR;
     
    462462void WebSocket::contextDestroyed()
    463463{
    464     LOG(Network, "WebSocket %p scriptExecutionContext destroyed", this);
     464    LOG(Network, "WebSocket %p contextDestroyed()", this);
    465465    ASSERT(!m_channel);
    466466    ASSERT(m_state == CLOSED);
     
    499499void WebSocket::didConnect()
    500500{
    501     LOG(Network, "WebSocket %p didConnect", this);
     501    LOG(Network, "WebSocket %p didConnect()", this);
    502502    if (m_state != CONNECTING) {
    503503        didClose(0, ClosingHandshakeIncomplete, WebSocketChannel::CloseEventCodeAbnormalClosure, "");
     
    513513void WebSocket::didReceiveMessage(const String& msg)
    514514{
    515     LOG(Network, "WebSocket %p didReceiveMessage %s", this, msg.utf8().data());
     515    LOG(Network, "WebSocket %p didReceiveMessage() Text message '%s'", this, msg.utf8().data());
    516516    if (m_state != OPEN && m_state != CLOSING)
    517517        return;
     
    522522void WebSocket::didReceiveBinaryData(PassOwnPtr<Vector<char> > binaryData)
    523523{
     524    LOG(Network, "WebSocket %p didReceiveBinaryData() %lu byte binary message", this, binaryData->size());
    524525    switch (m_binaryType) {
    525526    case BinaryTypeBlob: {
     
    542543void WebSocket::didReceiveMessageError()
    543544{
    544     LOG(Network, "WebSocket %p didReceiveErrorMessage", this);
     545    LOG(Network, "WebSocket %p didReceiveErrorMessage()", this);
    545546    ASSERT(scriptExecutionContext());
    546547    dispatchEvent(Event::create(eventNames().errorEvent, false, false));
     
    549550void WebSocket::didUpdateBufferedAmount(unsigned long bufferedAmount)
    550551{
    551     LOG(Network, "WebSocket %p didUpdateBufferedAmount %lu", this, bufferedAmount);
     552    LOG(Network, "WebSocket %p didUpdateBufferedAmount() New bufferedAmount is %lu", this, bufferedAmount);
    552553    if (m_state == CLOSED)
    553554        return;
     
    557558void WebSocket::didStartClosingHandshake()
    558559{
    559     LOG(Network, "WebSocket %p didStartClosingHandshake", this);
     560    LOG(Network, "WebSocket %p didStartClosingHandshake()", this);
    560561    m_state = CLOSING;
    561562}
     
    563564void WebSocket::didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code, const String& reason)
    564565{
    565     LOG(Network, "WebSocket %p didClose", this);
     566    LOG(Network, "WebSocket %p didClose()", this);
    566567    if (!m_channel)
    567568        return;
  • trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp

    r144949 r147542  
    101101void WebSocketChannel::connect(const KURL& url, const String& protocol)
    102102{
    103     LOG(Network, "WebSocketChannel %p connect", this);
     103    LOG(Network, "WebSocketChannel %p connect()", this);
    104104    ASSERT(!m_handle);
    105105    ASSERT(!m_suspended);
     
    116116String WebSocketChannel::subprotocol()
    117117{
    118     LOG(Network, "WebSocketChannel %p subprotocol", this);
     118    LOG(Network, "WebSocketChannel %p subprotocol()", this);
    119119    if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected)
    120120        return "";
     
    127127String WebSocketChannel::extensions()
    128128{
    129     LOG(Network, "WebSocketChannel %p extensions", this);
     129    LOG(Network, "WebSocketChannel %p extensions()", this);
    130130    if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected)
    131131        return "";
     
    138138ThreadableWebSocketChannel::SendResult WebSocketChannel::send(const String& message)
    139139{
    140     LOG(Network, "WebSocketChannel %p send %s", this, message.utf8().data());
     140    LOG(Network, "WebSocketChannel %p send() Sending String '%s'", this, message.utf8().data());
    141141    CString utf8 = message.utf8(String::StrictConversionReplacingUnpairedSurrogatesWithFFFD);
    142142    enqueueTextFrame(utf8);
     
    152152ThreadableWebSocketChannel::SendResult WebSocketChannel::send(const ArrayBuffer& binaryData, unsigned byteOffset, unsigned byteLength)
    153153{
    154     LOG(Network, "WebSocketChannel %p send arraybuffer %p %u %u", this, &binaryData, byteOffset, byteLength);
     154    LOG(Network, "WebSocketChannel %p send() Sending ArrayBuffer %p byteOffset=%u byteLength=%u", this, &binaryData, byteOffset, byteLength);
    155155    enqueueRawFrame(WebSocketFrame::OpCodeBinary, static_cast<const char*>(binaryData.data()) + byteOffset, byteLength);
    156156    return ThreadableWebSocketChannel::SendSuccess;
     
    159159ThreadableWebSocketChannel::SendResult WebSocketChannel::send(const Blob& binaryData)
    160160{
    161     LOG(Network, "WebSocketChannel %p send blob %s", this, binaryData.url().elidedString().utf8().data());
     161    LOG(Network, "WebSocketChannel %p send() Sending Blob '%s'", this, binaryData.url().elidedString().utf8().data());
    162162    enqueueBlobFrame(WebSocketFrame::OpCodeBinary, binaryData);
    163163    return ThreadableWebSocketChannel::SendSuccess;
     
    166166bool WebSocketChannel::send(const char* data, int length)
    167167{
    168     LOG(Network, "WebSocketChannel %p send binary %p (%dB)", this, data, length);
     168    LOG(Network, "WebSocketChannel %p send() Sending char* data=%p length=%d", this, data, length);
    169169    enqueueRawFrame(WebSocketFrame::OpCodeBinary, data, length);
    170170    return true;
     
    173173unsigned long WebSocketChannel::bufferedAmount() const
    174174{
    175     LOG(Network, "WebSocketChannel %p bufferedAmount", this);
     175    LOG(Network, "WebSocketChannel %p bufferedAmount()", this);
    176176    ASSERT(m_handle);
    177177    ASSERT(!m_suspended);
     
    181181void WebSocketChannel::close(int code, const String& reason)
    182182{
    183     LOG(Network, "WebSocketChannel %p close", this);
     183    LOG(Network, "WebSocketChannel %p close() code=%d reason='%s'", this, code, reason.utf8().data());
    184184    ASSERT(!m_suspended);
    185185    if (!m_handle)
     
    192192void WebSocketChannel::fail(const String& reason)
    193193{
    194     LOG(Network, "WebSocketChannel %p fail: %s", this, reason.utf8().data());
     194    LOG(Network, "WebSocketChannel %p fail() reason='%s'", this, reason.utf8().data());
    195195    ASSERT(!m_suspended);
    196196    if (m_document) {
     
    216216void WebSocketChannel::disconnect()
    217217{
    218     LOG(Network, "WebSocketChannel %p disconnect", this);
     218    LOG(Network, "WebSocketChannel %p disconnect()", this);
    219219    if (m_identifier && m_document)
    220220        InspectorInstrumentation::didCloseWebSocket(m_document, m_identifier);
     
    241241void WebSocketChannel::willOpenSocketStream(SocketStreamHandle* handle)
    242242{
    243     LOG(Network, "WebSocketChannel %p willOpensocketStream", this);
     243    LOG(Network, "WebSocketChannel %p willOpenSocketStream()", this);
    244244    ASSERT(handle);
    245245    if (m_document->frame())
     
    249249void WebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle)
    250250{
    251     LOG(Network, "WebSocketChannel %p didOpenSocketStream", this);
     251    LOG(Network, "WebSocketChannel %p didOpenSocketStream()", this);
    252252    ASSERT(handle == m_handle);
    253253    if (!m_document)
     
    262262void WebSocketChannel::didCloseSocketStream(SocketStreamHandle* handle)
    263263{
    264     LOG(Network, "WebSocketChannel %p didCloseSocketStream", this);
     264    LOG(Network, "WebSocketChannel %p didCloseSocketStream()", this);
    265265    if (m_identifier && m_document)
    266266        InspectorInstrumentation::didCloseWebSocket(m_document, m_identifier);
     
    287287void WebSocketChannel::didReceiveSocketStreamData(SocketStreamHandle* handle, const char* data, int len)
    288288{
    289     LOG(Network, "WebSocketChannel %p didReceiveSocketStreamData %d", this, len);
     289    LOG(Network, "WebSocketChannel %p didReceiveSocketStreamData() Received %d bytes", this, len);
    290290    RefPtr<WebSocketChannel> protect(this); // The client can close the channel, potentially removing the last reference.
    291291    ASSERT(handle == m_handle);
     
    322322void WebSocketChannel::didFailSocketStream(SocketStreamHandle* handle, const SocketStreamError& error)
    323323{
    324     LOG(Network, "WebSocketChannel %p didFailSocketStream", this);
     324    LOG(Network, "WebSocketChannel %p didFailSocketStream()", this);
    325325    ASSERT(handle == m_handle || !m_handle);
    326326    if (m_document) {
     
    350350void WebSocketChannel::didStartLoading()
    351351{
    352     LOG(Network, "WebSocketChannel %p didStartLoading", this);
     352    LOG(Network, "WebSocketChannel %p didStartLoading()", this);
    353353    ASSERT(m_blobLoader);
    354354    ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
     
    357357void WebSocketChannel::didReceiveData()
    358358{
    359     LOG(Network, "WebSocketChannel %p didReceiveData", this);
     359    LOG(Network, "WebSocketChannel %p didReceiveData()", this);
    360360    ASSERT(m_blobLoader);
    361361    ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
     
    364364void WebSocketChannel::didFinishLoading()
    365365{
    366     LOG(Network, "WebSocketChannel %p didFinishLoading", this);
     366    LOG(Network, "WebSocketChannel %p didFinishLoading()", this);
    367367    ASSERT(m_blobLoader);
    368368    ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
     
    374374void WebSocketChannel::didFail(int errorCode)
    375375{
    376     LOG(Network, "WebSocketChannel %p didFail %d", this, errorCode);
     376    LOG(Network, "WebSocketChannel %p didFail() errorCode=%d", this, errorCode);
    377377    ASSERT(m_blobLoader);
    378378    ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
     
    388388    size_t newBufferSize = m_buffer.size() + len;
    389389    if (newBufferSize < m_buffer.size()) {
    390         LOG(Network, "WebSocket buffer overflow (%lu+%lu)", static_cast<unsigned long>(m_buffer.size()), static_cast<unsigned long>(len));
     390        LOG(Network, "WebSocketChannel %p appendToBuffer() Buffer overflow (%lu bytes already in receive buffer and appending %lu bytes)", this, static_cast<unsigned long>(m_buffer.size()), static_cast<unsigned long>(len));
    391391        return false;
    392392    }
     
    407407    ASSERT(m_client);
    408408    ASSERT(!m_buffer.isEmpty());
    409     LOG(Network, "WebSocketChannel %p processBuffer %lu", this, static_cast<unsigned long>(m_buffer.size()));
     409    LOG(Network, "WebSocketChannel %p processBuffer() Receive buffer has %lu bytes", this, static_cast<unsigned long>(m_buffer.size()));
    410410
    411411    if (m_shouldDiscardReceivedData)
     
    433433            }
    434434            // FIXME: handle set-cookie2.
    435             LOG(Network, "WebSocketChannel %p connected", this);
     435            LOG(Network, "WebSocketChannel %p Connected", this);
    436436            skipBuffer(headerLength);
    437437            m_client->didConnect();
    438             LOG(Network, "remaining in read buf %lu", static_cast<unsigned long>(m_buffer.size()));
     438            LOG(Network, "WebSocketChannel %p %lu bytes remaining in m_buffer", this, static_cast<unsigned long>(m_buffer.size()));
    439439            return !m_buffer.isEmpty();
    440440        }
    441441        ASSERT(m_handshake->mode() == WebSocketHandshake::Failed);
    442         LOG(Network, "WebSocketChannel %p connection failed", this);
     442        LOG(Network, "WebSocketChannel %p Connection failed", this);
    443443        skipBuffer(headerLength);
    444444        m_shouldDiscardReceivedData = true;
     
    466466void WebSocketChannel::startClosingHandshake(int code, const String& reason)
    467467{
    468     LOG(Network, "WebSocketChannel %p closing %d %d", this, m_closing, m_receivedClosingHandshake);
     468    LOG(Network, "WebSocketChannel %p startClosingHandshake() code=%d m_receivedClosingHandshake=%d", this, m_closing, m_receivedClosingHandshake);
    469469    if (m_closing)
    470470        return;
     
    488488void WebSocketChannel::closingTimerFired(Timer<WebSocketChannel>* timer)
    489489{
    490     LOG(Network, "WebSocketChannel %p closing timer", this);
     490    LOG(Network, "WebSocketChannel %p closingTimerFired()", this);
    491491    ASSERT_UNUSED(timer, &m_closingTimer == timer);
    492492    if (m_handle)
  • trunk/Source/WebCore/Modules/websockets/WebSocketDeflater.cpp

    r131395 r147542  
    7272    int result = deflateEnd(m_stream.get());
    7373    if (result != Z_OK)
    74         LOG(Network, "deflateEnd() failed: %d", result);
     74        LOG(Network, "WebSocketDeflater %p Destructor deflateEnd() failed: %d is returned", this, result);
    7575}
    7676
     
    149149    int result = inflateEnd(m_stream.get());
    150150    if (result != Z_OK)
    151         LOG(Network, "inflateEnd() failed: %d", result);
     151        LOG(Network, "WebSocketInflater %p Destructor inflateEnd() failed: %d is returned", this, result);
    152152}
    153153
  • trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp

    r145745 r147542  
    297297        return len;
    298298    }
    299     LOG(Network, "response code: %d", statusCode);
     299    LOG(Network, "WebSocketHandshake %p readServerHandshake() Status code is %d", this, statusCode);
    300300    m_response.setStatusCode(statusCode);
    301301    m_response.setStatusText(statusText);
     
    313313    const char* p = readHTTPHeaders(header + lineLength, header + len);
    314314    if (!p) {
    315         LOG(Network, "readHTTPHeaders failed");
     315        LOG(Network, "WebSocketHandshake %p readServerHandshake() readHTTPHeaders() failed", this);
    316316        m_mode = Failed; // m_failureReason is set inside readHTTPHeaders().
    317317        return len;
    318318    }
    319319    if (!checkResponseHeaders()) {
    320         LOG(Network, "header process failed");
     320        LOG(Network, "WebSocketHandshake %p readServerHandshake() checkResponseHeaders() failed", this);
    321321        m_mode = Failed;
    322322        return p - header;
  • trunk/Source/WebCore/platform/network/chromium/SocketStreamHandle.cpp

    r146965 r147542  
    6060{
    6161    m_socket = adoptPtr(WebKit::Platform::current()->createSocketStreamHandle());
    62     LOG(Network, "connect");
     62    LOG(Network, "SocketStreamHandleInternal %p connect()", this);
    6363    ASSERT(m_socket);
    6464    ASSERT(m_handle);
     
    7070int SocketStreamHandleInternal::send(const char* data, int len)
    7171{
    72     LOG(Network, "send len=%d", len);
     72    LOG(Network, "SocketStreamHandleInternal %p send() len=%d", this, len);
    7373    // FIXME: |m_socket| should not be null here, but it seems that there is the
    7474    // case. We should figure out such a path and fix it rather than checking
    7575    // null here.
    7676    if (!m_socket) {
    77         LOG(Network, "m_socket is null when sending. It should not be.");
     77        LOG(Network, "SocketStreamHandleInternal %p send() m_socket is NULL", this);
    7878        return 0;
    7979    }
     
    8686    if (m_socket->send(webdata)) {
    8787        m_pendingAmountSent += len;
    88         LOG(Network, "sent");
     88        LOG(Network, "SocketStreamHandleInternal %p send() Sent %d bytes", this, len);
    8989        return len;
    9090    }
    91     LOG(Network, "busy. buffering");
     91    LOG(Network, "SocketStreamHandleInternal %p send() m_socket->send() failed", this);
    9292    return 0;
    9393}
     
    9595void SocketStreamHandleInternal::close()
    9696{
    97     LOG(Network, "close");
     97    LOG(Network, "SocketStreamHandleInternal %p close()", this);
    9898    if (m_socket)
    9999        m_socket->close();
     
    102102void SocketStreamHandleInternal::didOpenStream(WebKit::WebSocketStreamHandle* socketHandle, int maxPendingSendAllowed)
    103103{
    104     LOG(Network, "SocketStreamHandleInternal::didOpen %d",
    105         maxPendingSendAllowed);
     104    LOG(Network, "SocketStreamHandleInternal %p didOpenStream() maxPendingSendAllowed=%d", this, maxPendingSendAllowed);
    106105    ASSERT(maxPendingSendAllowed > 0);
    107106    if (m_handle && m_socket) {
     
    114113        }
    115114    }
    116     LOG(Network, "no m_handle or m_socket?");
     115    LOG(Network, "SocketStreamHandleInternal %p didOpenStream() m_handle or m_socket is NULL", this);
    117116}
    118117
    119118void SocketStreamHandleInternal::didSendData(WebKit::WebSocketStreamHandle* socketHandle, int amountSent)
    120119{
    121     LOG(Network, "SocketStreamHandleInternal::didSendData %d", amountSent);
     120    LOG(Network, "SocketStreamHandleInternal %p didSendData() amountSent=%d", this, amountSent);
    122121    ASSERT(amountSent > 0);
    123122    if (m_handle && m_socket) {
     
    131130void SocketStreamHandleInternal::didReceiveData(WebKit::WebSocketStreamHandle* socketHandle, const WebKit::WebData& data)
    132131{
    133     LOG(Network, "didReceiveData");
     132    LOG(Network, "SocketStreamHandleInternal %p didReceiveData() Received %lu bytes", this, data.size());
    134133    if (m_handle && m_socket) {
    135134        ASSERT(socketHandle == m_socket.get());
     
    141140void SocketStreamHandleInternal::didClose(WebKit::WebSocketStreamHandle* socketHandle)
    142141{
    143     LOG(Network, "didClose");
     142    LOG(Network, "SocketStreamHandleInternal %p didClose()", this);
    144143    if (m_handle && m_socket) {
    145144        ASSERT(socketHandle == m_socket.get());
     
    154153void SocketStreamHandleInternal::didFail(WebKit::WebSocketStreamHandle* socketHandle, const WebKit::WebSocketStreamError& err)
    155154{
    156     LOG(Network, "didFail");
     155    LOG(Network, "SocketStreamHandleInternal %p didFail()", this);
    157156    if (m_handle && m_socket) {
    158157        ASSERT(socketHandle == m_socket.get());
Note: See TracChangeset for help on using the changeset viewer.