Changeset 54298 in webkit
- Timestamp:
- Feb 3, 2010 2:00:21 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54292 r54298 1 2010-02-03 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] WebSockets : Buffer the data in WebKit instead of QtNetwork 6 https://bugs.webkit.org/show_bug.cgi?id=34425 7 8 Reverting r54279, it was a misunderstanding. 9 10 * platform/network/qt/SocketStreamHandlePrivate.h: 11 * platform/network/qt/SocketStreamHandleQt.cpp: 12 (WebCore::SocketStreamHandlePrivate::SocketStreamHandlePrivate): 13 (WebCore::SocketStreamHandlePrivate::send): 14 (WebCore::SocketStreamHandlePrivate::close): 15 1 16 2010-02-03 Drew Wilson <atwilson@chromium.org> 2 17 -
trunk/WebCore/platform/network/qt/SocketStreamHandlePrivate.h
r54279 r54298 56 56 void close(); 57 57 void socketSentdata(); 58 void socketBytesWritten(qint64);59 58 void socketClosed(); 60 59 void socketError(QAbstractSocket::SocketError); … … 67 66 QTcpSocket* m_socket; 68 67 SocketStreamHandle* m_streamHandle; 69 QByteArray m_data;70 68 }; 71 69 -
trunk/WebCore/platform/network/qt/SocketStreamHandleQt.cpp
r54279 r54298 57 57 return; 58 58 59 if (isSecure) { 60 #ifndef QT_NO_OPENSSL 61 connect(m_socket, SIGNAL(encrypted()), this, SLOT(socketConnected())); 62 connect(m_socket, SIGNAL(encryptedBytesWritten(qint64)), this, SLOT(socketBytesWritten(qint64))); 63 #endif 64 } else { 65 connect(m_socket, SIGNAL(connected()), this, SLOT(socketConnected())); 66 connect(m_socket, SIGNAL(bytesWritten(qint64)), this, SLOT(socketBytesWritten(qint64))); 67 } 59 connect(m_socket, SIGNAL(connected()), this, SLOT(socketConnected())); 68 60 connect(m_socket, SIGNAL(readyRead()), this, SLOT(socketReadyRead())); 69 61 connect(m_socket, SIGNAL(disconnected()), this, SLOT(socketClosed())); … … 108 100 if (!m_socket || m_socket->state() != QAbstractSocket::ConnectedState) 109 101 return 0; 110 // If we are already sending something, then m_data is not empty. 111 bool sending = m_data.length() > 0; 112 m_data.append(data, len); 113 if (!sending) 114 m_socket->write(m_data); 115 return len; 102 quint64 sentSize = m_socket->write(data, len); 103 QMetaObject::invokeMethod(this, "socketSentData", Qt::QueuedConnection); 104 return sentSize; 116 105 } 117 106 118 107 void SocketStreamHandlePrivate::close() 119 108 { 120 if (m_socket )109 if (m_socket && m_socket->state() == QAbstractSocket::ConnectedState) 121 110 m_socket->close(); 122 111 } … … 126 115 if (m_streamHandle) 127 116 m_streamHandle->sendPendingData(); 128 }129 130 void SocketStreamHandlePrivate::socketBytesWritten(qint64 written)131 {132 if (!m_socket || m_socket->state() != QAbstractSocket::ConnectedState || written < 0)133 return;134 m_data.remove(0, written);135 // If we are done sending all the data, then m_data is now empty136 if (m_data.isEmpty())137 QMetaObject::invokeMethod(this, "socketSentdata", Qt::QueuedConnection);138 else139 m_socket->write(m_data);140 117 } 141 118
Note: See TracChangeset
for help on using the changeset viewer.