Diff
Modified: trunk/Source/WebCore/ChangeLog (147541 => 147542)
--- trunk/Source/WebCore/ChangeLog 2013-04-03 11:56:44 UTC (rev 147541)
+++ trunk/Source/WebCore/ChangeLog 2013-04-03 12:15:54 UTC (rev 147542)
@@ -1,3 +1,65 @@
+2013-04-03 Takeshi Yoshino <[email protected]>
+
+ Refine LOG messages in WebSocket related components
+ https://bugs.webkit.org/show_bug.cgi?id=113852
+
+ 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):
+
2013-04-03 Tor Arne Vestbø <[email protected]>
[Qt] Update QMAKE_MAC_SDK check for Qt 5.1
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (147541 => 147542)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2013-04-03 11:56:44 UTC (rev 147541)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2013-04-03 12:15:54 UTC (rev 147542)
@@ -211,7 +211,7 @@
void WebSocket::connect(const String& url, const Vector<String>& protocols, ExceptionCode& ec)
{
- LOG(Network, "WebSocket %p connect to %s", this, url.utf8().data());
+ LOG(Network, "WebSocket %p connect() url=''", this, url.utf8().data());
m_url = KURL(KURL(), url);
if (!m_url.isValid()) {
@@ -292,7 +292,7 @@
bool WebSocket::send(const String& message, ExceptionCode& ec)
{
- LOG(Network, "WebSocket %p send %s", this, message.utf8().data());
+ LOG(Network, "WebSocket %p send() Sending String '%s'", this, message.utf8().data());
if (m_state == CONNECTING) {
ec = INVALID_STATE_ERR;
return false;
@@ -316,7 +316,7 @@
bool WebSocket::send(ArrayBuffer* binaryData, ExceptionCode& ec)
{
- LOG(Network, "WebSocket %p send arraybuffer %p", this, binaryData);
+ LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, binaryData);
ASSERT(binaryData);
if (m_state == CONNECTING) {
ec = INVALID_STATE_ERR;
@@ -334,7 +334,7 @@
bool WebSocket::send(ArrayBufferView* arrayBufferView, ExceptionCode& ec)
{
- LOG(Network, "WebSocket %p send arraybufferview %p", this, arrayBufferView);
+ LOG(Network, "WebSocket %p send() Sending ArrayBufferView %p", this, arrayBufferView);
ASSERT(arrayBufferView);
if (m_state == CONNECTING) {
ec = INVALID_STATE_ERR;
@@ -353,7 +353,7 @@
bool WebSocket::send(Blob* binaryData, ExceptionCode& ec)
{
- LOG(Network, "WebSocket %p send blob %s", this, binaryData->url().elidedString().utf8().data());
+ LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData->url().elidedString().utf8().data());
ASSERT(binaryData);
if (m_state == CONNECTING) {
ec = INVALID_STATE_ERR;
@@ -372,9 +372,9 @@
void WebSocket::close(int code, const String& reason, ExceptionCode& ec)
{
if (code == WebSocketChannel::CloseEventCodeNotSpecified)
- LOG(Network, "WebSocket %p close without code and reason", this);
+ LOG(Network, "WebSocket %p close() without code and reason", this);
else {
- LOG(Network, "WebSocket %p close with code = %d, reason = %s", this, code, reason.utf8().data());
+ LOG(Network, "WebSocket %p close() code=%d reason='%s'", this, code, reason.utf8().data());
if (!(code == WebSocketChannel::CloseEventCodeNormalClosure || (WebSocketChannel::CloseEventCodeMinimumUserDefined <= code && code <= WebSocketChannel::CloseEventCodeMaximumUserDefined))) {
ec = INVALID_ACCESS_ERR;
return;
@@ -461,7 +461,7 @@
void WebSocket::contextDestroyed()
{
- LOG(Network, "WebSocket %p scriptExecutionContext destroyed", this);
+ LOG(Network, "WebSocket %p contextDestroyed()", this);
ASSERT(!m_channel);
ASSERT(m_state == CLOSED);
ActiveDOMObject::contextDestroyed();
@@ -498,7 +498,7 @@
void WebSocket::didConnect()
{
- LOG(Network, "WebSocket %p didConnect", this);
+ LOG(Network, "WebSocket %p didConnect()", this);
if (m_state != CONNECTING) {
didClose(0, ClosingHandshakeIncomplete, WebSocketChannel::CloseEventCodeAbnormalClosure, "");
return;
@@ -512,7 +512,7 @@
void WebSocket::didReceiveMessage(const String& msg)
{
- LOG(Network, "WebSocket %p didReceiveMessage %s", this, msg.utf8().data());
+ LOG(Network, "WebSocket %p didReceiveMessage() Text message '%s'", this, msg.utf8().data());
if (m_state != OPEN && m_state != CLOSING)
return;
ASSERT(scriptExecutionContext());
@@ -521,6 +521,7 @@
void WebSocket::didReceiveBinaryData(PassOwnPtr<Vector<char> > binaryData)
{
+ LOG(Network, "WebSocket %p didReceiveBinaryData() %lu byte binary message", this, binaryData->size());
switch (m_binaryType) {
case BinaryTypeBlob: {
size_t size = binaryData->size();
@@ -541,14 +542,14 @@
void WebSocket::didReceiveMessageError()
{
- LOG(Network, "WebSocket %p didReceiveErrorMessage", this);
+ LOG(Network, "WebSocket %p didReceiveErrorMessage()", this);
ASSERT(scriptExecutionContext());
dispatchEvent(Event::create(eventNames().errorEvent, false, false));
}
void WebSocket::didUpdateBufferedAmount(unsigned long bufferedAmount)
{
- LOG(Network, "WebSocket %p didUpdateBufferedAmount %lu", this, bufferedAmount);
+ LOG(Network, "WebSocket %p didUpdateBufferedAmount() New bufferedAmount is %lu", this, bufferedAmount);
if (m_state == CLOSED)
return;
m_bufferedAmount = bufferedAmount;
@@ -556,13 +557,13 @@
void WebSocket::didStartClosingHandshake()
{
- LOG(Network, "WebSocket %p didStartClosingHandshake", this);
+ LOG(Network, "WebSocket %p didStartClosingHandshake()", this);
m_state = CLOSING;
}
void WebSocket::didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code, const String& reason)
{
- LOG(Network, "WebSocket %p didClose", this);
+ LOG(Network, "WebSocket %p didClose()", this);
if (!m_channel)
return;
bool wasClean = m_state == CLOSING && !unhandledBufferedAmount && closingHandshakeCompletion == ClosingHandshakeComplete && code != WebSocketChannel::CloseEventCodeAbnormalClosure;
Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp (147541 => 147542)
--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp 2013-04-03 11:56:44 UTC (rev 147541)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp 2013-04-03 12:15:54 UTC (rev 147542)
@@ -100,7 +100,7 @@
void WebSocketChannel::connect(const KURL& url, const String& protocol)
{
- LOG(Network, "WebSocketChannel %p connect", this);
+ LOG(Network, "WebSocketChannel %p connect()", this);
ASSERT(!m_handle);
ASSERT(!m_suspended);
m_handshake = adoptPtr(new WebSocketHandshake(url, protocol, m_document));
@@ -115,7 +115,7 @@
String WebSocketChannel::subprotocol()
{
- LOG(Network, "WebSocketChannel %p subprotocol", this);
+ LOG(Network, "WebSocketChannel %p subprotocol()", this);
if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected)
return "";
String serverProtocol = m_handshake->serverWebSocketProtocol();
@@ -126,7 +126,7 @@
String WebSocketChannel::extensions()
{
- LOG(Network, "WebSocketChannel %p extensions", this);
+ LOG(Network, "WebSocketChannel %p extensions()", this);
if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected)
return "";
String extensions = m_handshake->acceptedExtensions();
@@ -137,7 +137,7 @@
ThreadableWebSocketChannel::SendResult WebSocketChannel::send(const String& message)
{
- LOG(Network, "WebSocketChannel %p send %s", this, message.utf8().data());
+ LOG(Network, "WebSocketChannel %p send() Sending String '%s'", this, message.utf8().data());
CString utf8 = message.utf8(String::StrictConversionReplacingUnpairedSurrogatesWithFFFD);
enqueueTextFrame(utf8);
// According to WebSocket API specification, WebSocket.send() should return void instead
@@ -151,28 +151,28 @@
ThreadableWebSocketChannel::SendResult WebSocketChannel::send(const ArrayBuffer& binaryData, unsigned byteOffset, unsigned byteLength)
{
- LOG(Network, "WebSocketChannel %p send arraybuffer %p %u %u", this, &binaryData, byteOffset, byteLength);
+ LOG(Network, "WebSocketChannel %p send() Sending ArrayBuffer %p byteOffset=%u byteLength=%u", this, &binaryData, byteOffset, byteLength);
enqueueRawFrame(WebSocketFrame::OpCodeBinary, static_cast<const char*>(binaryData.data()) + byteOffset, byteLength);
return ThreadableWebSocketChannel::SendSuccess;
}
ThreadableWebSocketChannel::SendResult WebSocketChannel::send(const Blob& binaryData)
{
- LOG(Network, "WebSocketChannel %p send blob %s", this, binaryData.url().elidedString().utf8().data());
+ LOG(Network, "WebSocketChannel %p send() Sending Blob '%s'", this, binaryData.url().elidedString().utf8().data());
enqueueBlobFrame(WebSocketFrame::OpCodeBinary, binaryData);
return ThreadableWebSocketChannel::SendSuccess;
}
bool WebSocketChannel::send(const char* data, int length)
{
- LOG(Network, "WebSocketChannel %p send binary %p (%dB)", this, data, length);
+ LOG(Network, "WebSocketChannel %p send() Sending char* data="" length=%d", this, data, length);
enqueueRawFrame(WebSocketFrame::OpCodeBinary, data, length);
return true;
}
unsigned long WebSocketChannel::bufferedAmount() const
{
- LOG(Network, "WebSocketChannel %p bufferedAmount", this);
+ LOG(Network, "WebSocketChannel %p bufferedAmount()", this);
ASSERT(m_handle);
ASSERT(!m_suspended);
return m_handle->bufferedAmount();
@@ -180,7 +180,7 @@
void WebSocketChannel::close(int code, const String& reason)
{
- LOG(Network, "WebSocketChannel %p close", this);
+ LOG(Network, "WebSocketChannel %p close() code=%d reason='%s'", this, code, reason.utf8().data());
ASSERT(!m_suspended);
if (!m_handle)
return;
@@ -191,7 +191,7 @@
void WebSocketChannel::fail(const String& reason)
{
- LOG(Network, "WebSocketChannel %p fail: %s", this, reason.utf8().data());
+ LOG(Network, "WebSocketChannel %p fail() reason='%s'", this, reason.utf8().data());
ASSERT(!m_suspended);
if (m_document) {
InspectorInstrumentation::didReceiveWebSocketFrameError(m_document, m_identifier, reason);
@@ -215,7 +215,7 @@
void WebSocketChannel::disconnect()
{
- LOG(Network, "WebSocketChannel %p disconnect", this);
+ LOG(Network, "WebSocketChannel %p disconnect()", this);
if (m_identifier && m_document)
InspectorInstrumentation::didCloseWebSocket(m_document, m_identifier);
if (m_handshake)
@@ -240,7 +240,7 @@
void WebSocketChannel::willOpenSocketStream(SocketStreamHandle* handle)
{
- LOG(Network, "WebSocketChannel %p willOpensocketStream", this);
+ LOG(Network, "WebSocketChannel %p willOpenSocketStream()", this);
ASSERT(handle);
if (m_document->frame())
m_document->frame()->loader()->client()->dispatchWillOpenSocketStream(handle);
@@ -248,7 +248,7 @@
void WebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle)
{
- LOG(Network, "WebSocketChannel %p didOpenSocketStream", this);
+ LOG(Network, "WebSocketChannel %p didOpenSocketStream()", this);
ASSERT(handle == m_handle);
if (!m_document)
return;
@@ -261,7 +261,7 @@
void WebSocketChannel::didCloseSocketStream(SocketStreamHandle* handle)
{
- LOG(Network, "WebSocketChannel %p didCloseSocketStream", this);
+ LOG(Network, "WebSocketChannel %p didCloseSocketStream()", this);
if (m_identifier && m_document)
InspectorInstrumentation::didCloseWebSocket(m_document, m_identifier);
ASSERT_UNUSED(handle, handle == m_handle || !m_handle);
@@ -286,7 +286,7 @@
void WebSocketChannel::didReceiveSocketStreamData(SocketStreamHandle* handle, const char* data, int len)
{
- LOG(Network, "WebSocketChannel %p didReceiveSocketStreamData %d", this, len);
+ LOG(Network, "WebSocketChannel %p didReceiveSocketStreamData() Received %d bytes", this, len);
RefPtr<WebSocketChannel> protect(this); // The client can close the channel, potentially removing the last reference.
ASSERT(handle == m_handle);
if (!m_document) {
@@ -321,7 +321,7 @@
void WebSocketChannel::didFailSocketStream(SocketStreamHandle* handle, const SocketStreamError& error)
{
- LOG(Network, "WebSocketChannel %p didFailSocketStream", this);
+ LOG(Network, "WebSocketChannel %p didFailSocketStream()", this);
ASSERT(handle == m_handle || !m_handle);
if (m_document) {
String message;
@@ -349,21 +349,21 @@
#if ENABLE(BLOB)
void WebSocketChannel::didStartLoading()
{
- LOG(Network, "WebSocketChannel %p didStartLoading", this);
+ LOG(Network, "WebSocketChannel %p didStartLoading()", this);
ASSERT(m_blobLoader);
ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
}
void WebSocketChannel::didReceiveData()
{
- LOG(Network, "WebSocketChannel %p didReceiveData", this);
+ LOG(Network, "WebSocketChannel %p didReceiveData()", this);
ASSERT(m_blobLoader);
ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
}
void WebSocketChannel::didFinishLoading()
{
- LOG(Network, "WebSocketChannel %p didFinishLoading", this);
+ LOG(Network, "WebSocketChannel %p didFinishLoading()", this);
ASSERT(m_blobLoader);
ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
m_blobLoaderStatus = BlobLoaderFinished;
@@ -373,7 +373,7 @@
void WebSocketChannel::didFail(int errorCode)
{
- LOG(Network, "WebSocketChannel %p didFail %d", this, errorCode);
+ LOG(Network, "WebSocketChannel %p didFail() errorCode=%d", this, errorCode);
ASSERT(m_blobLoader);
ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
m_blobLoader.clear();
@@ -387,7 +387,7 @@
{
size_t newBufferSize = m_buffer.size() + len;
if (newBufferSize < m_buffer.size()) {
- LOG(Network, "WebSocket buffer overflow (%lu+%lu)", static_cast<unsigned long>(m_buffer.size()), static_cast<unsigned long>(len));
+ 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));
return false;
}
m_buffer.append(data, len);
@@ -406,7 +406,7 @@
ASSERT(!m_suspended);
ASSERT(m_client);
ASSERT(!m_buffer.isEmpty());
- LOG(Network, "WebSocketChannel %p processBuffer %lu", this, static_cast<unsigned long>(m_buffer.size()));
+ LOG(Network, "WebSocketChannel %p processBuffer() Receive buffer has %lu bytes", this, static_cast<unsigned long>(m_buffer.size()));
if (m_shouldDiscardReceivedData)
return false;
@@ -432,14 +432,14 @@
}
}
// FIXME: handle set-cookie2.
- LOG(Network, "WebSocketChannel %p connected", this);
+ LOG(Network, "WebSocketChannel %p Connected", this);
skipBuffer(headerLength);
m_client->didConnect();
- LOG(Network, "remaining in read buf %lu", static_cast<unsigned long>(m_buffer.size()));
+ LOG(Network, "WebSocketChannel %p %lu bytes remaining in m_buffer", this, static_cast<unsigned long>(m_buffer.size()));
return !m_buffer.isEmpty();
}
ASSERT(m_handshake->mode() == WebSocketHandshake::Failed);
- LOG(Network, "WebSocketChannel %p connection failed", this);
+ LOG(Network, "WebSocketChannel %p Connection failed", this);
skipBuffer(headerLength);
m_shouldDiscardReceivedData = true;
fail(m_handshake->failureReason());
@@ -465,7 +465,7 @@
void WebSocketChannel::startClosingHandshake(int code, const String& reason)
{
- LOG(Network, "WebSocketChannel %p closing %d %d", this, m_closing, m_receivedClosingHandshake);
+ LOG(Network, "WebSocketChannel %p startClosingHandshake() code=%d m_receivedClosingHandshake=%d", this, m_closing, m_receivedClosingHandshake);
if (m_closing)
return;
ASSERT(m_handle);
@@ -487,7 +487,7 @@
void WebSocketChannel::closingTimerFired(Timer<WebSocketChannel>* timer)
{
- LOG(Network, "WebSocketChannel %p closing timer", this);
+ LOG(Network, "WebSocketChannel %p closingTimerFired()", this);
ASSERT_UNUSED(timer, &m_closingTimer == timer);
if (m_handle)
m_handle->disconnect();
Modified: trunk/Source/WebCore/Modules/websockets/WebSocketDeflater.cpp (147541 => 147542)
--- trunk/Source/WebCore/Modules/websockets/WebSocketDeflater.cpp 2013-04-03 11:56:44 UTC (rev 147541)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketDeflater.cpp 2013-04-03 12:15:54 UTC (rev 147542)
@@ -71,7 +71,7 @@
{
int result = deflateEnd(m_stream.get());
if (result != Z_OK)
- LOG(Network, "deflateEnd() failed: %d", result);
+ LOG(Network, "WebSocketDeflater %p Destructor deflateEnd() failed: %d is returned", this, result);
}
static void setStreamParameter(z_stream* stream, const char* inputData, size_t inputLength, char* outputData, size_t outputLength)
@@ -148,7 +148,7 @@
{
int result = inflateEnd(m_stream.get());
if (result != Z_OK)
- LOG(Network, "inflateEnd() failed: %d", result);
+ LOG(Network, "WebSocketInflater %p Destructor inflateEnd() failed: %d is returned", this, result);
}
bool WebSocketInflater::addBytes(const char* data, size_t length)
Modified: trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp (147541 => 147542)
--- trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp 2013-04-03 11:56:44 UTC (rev 147541)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp 2013-04-03 12:15:54 UTC (rev 147542)
@@ -296,7 +296,7 @@
m_mode = Failed; // m_failureReason is set inside readStatusLine().
return len;
}
- LOG(Network, "response code: %d", statusCode);
+ LOG(Network, "WebSocketHandshake %p readServerHandshake() Status code is %d", this, statusCode);
m_response.setStatusCode(statusCode);
m_response.setStatusText(statusText);
if (statusCode != 101) {
@@ -312,12 +312,12 @@
}
const char* p = readHTTPHeaders(header + lineLength, header + len);
if (!p) {
- LOG(Network, "readHTTPHeaders failed");
+ LOG(Network, "WebSocketHandshake %p readServerHandshake() readHTTPHeaders() failed", this);
m_mode = Failed; // m_failureReason is set inside readHTTPHeaders().
return len;
}
if (!checkResponseHeaders()) {
- LOG(Network, "header process failed");
+ LOG(Network, "WebSocketHandshake %p readServerHandshake() checkResponseHeaders() failed", this);
m_mode = Failed;
return p - header;
}
Modified: trunk/Source/WebCore/platform/network/chromium/SocketStreamHandle.cpp (147541 => 147542)
--- trunk/Source/WebCore/platform/network/chromium/SocketStreamHandle.cpp 2013-04-03 11:56:44 UTC (rev 147541)
+++ trunk/Source/WebCore/platform/network/chromium/SocketStreamHandle.cpp 2013-04-03 12:15:54 UTC (rev 147542)
@@ -59,7 +59,7 @@
void SocketStreamHandleInternal::connect(const KURL& url)
{
m_socket = adoptPtr(WebKit::Platform::current()->createSocketStreamHandle());
- LOG(Network, "connect");
+ LOG(Network, "SocketStreamHandleInternal %p connect()", this);
ASSERT(m_socket);
ASSERT(m_handle);
if (m_handle->m_client)
@@ -69,12 +69,12 @@
int SocketStreamHandleInternal::send(const char* data, int len)
{
- LOG(Network, "send len=%d", len);
+ LOG(Network, "SocketStreamHandleInternal %p send() len=%d", this, len);
// FIXME: |m_socket| should not be null here, but it seems that there is the
// case. We should figure out such a path and fix it rather than checking
// null here.
if (!m_socket) {
- LOG(Network, "m_socket is null when sending. It should not be.");
+ LOG(Network, "SocketStreamHandleInternal %p send() m_socket is NULL", this);
return 0;
}
if (m_pendingAmountSent + len > m_maxPendingSendAllowed)
@@ -85,24 +85,23 @@
WebKit::WebData webdata(data, len);
if (m_socket->send(webdata)) {
m_pendingAmountSent += len;
- LOG(Network, "sent");
+ LOG(Network, "SocketStreamHandleInternal %p send() Sent %d bytes", this, len);
return len;
}
- LOG(Network, "busy. buffering");
+ LOG(Network, "SocketStreamHandleInternal %p send() m_socket->send() failed", this);
return 0;
}
void SocketStreamHandleInternal::close()
{
- LOG(Network, "close");
+ LOG(Network, "SocketStreamHandleInternal %p close()", this);
if (m_socket)
m_socket->close();
}
void SocketStreamHandleInternal::didOpenStream(WebKit::WebSocketStreamHandle* socketHandle, int maxPendingSendAllowed)
{
- LOG(Network, "SocketStreamHandleInternal::didOpen %d",
- maxPendingSendAllowed);
+ LOG(Network, "SocketStreamHandleInternal %p didOpenStream() maxPendingSendAllowed=%d", this, maxPendingSendAllowed);
ASSERT(maxPendingSendAllowed > 0);
if (m_handle && m_socket) {
ASSERT(socketHandle == m_socket.get());
@@ -113,12 +112,12 @@
return;
}
}
- LOG(Network, "no m_handle or m_socket?");
+ LOG(Network, "SocketStreamHandleInternal %p didOpenStream() m_handle or m_socket is NULL", this);
}
void SocketStreamHandleInternal::didSendData(WebKit::WebSocketStreamHandle* socketHandle, int amountSent)
{
- LOG(Network, "SocketStreamHandleInternal::didSendData %d", amountSent);
+ LOG(Network, "SocketStreamHandleInternal %p didSendData() amountSent=%d", this, amountSent);
ASSERT(amountSent > 0);
if (m_handle && m_socket) {
ASSERT(socketHandle == m_socket.get());
@@ -130,7 +129,7 @@
void SocketStreamHandleInternal::didReceiveData(WebKit::WebSocketStreamHandle* socketHandle, const WebKit::WebData& data)
{
- LOG(Network, "didReceiveData");
+ LOG(Network, "SocketStreamHandleInternal %p didReceiveData() Received %lu bytes", this, data.size());
if (m_handle && m_socket) {
ASSERT(socketHandle == m_socket.get());
if (m_handle->m_client)
@@ -140,7 +139,7 @@
void SocketStreamHandleInternal::didClose(WebKit::WebSocketStreamHandle* socketHandle)
{
- LOG(Network, "didClose");
+ LOG(Network, "SocketStreamHandleInternal %p didClose()", this);
if (m_handle && m_socket) {
ASSERT(socketHandle == m_socket.get());
m_socket.clear();
@@ -153,7 +152,7 @@
void SocketStreamHandleInternal::didFail(WebKit::WebSocketStreamHandle* socketHandle, const WebKit::WebSocketStreamError& err)
{
- LOG(Network, "didFail");
+ LOG(Network, "SocketStreamHandleInternal %p didFail()", this);
if (m_handle && m_socket) {
ASSERT(socketHandle == m_socket.get());
m_socket.clear();