Chromium Code Reviews| Index: Source/modules/websockets/NewWebSocketChannelImpl.cpp |
| diff --git a/Source/modules/websockets/NewWebSocketChannelImpl.cpp b/Source/modules/websockets/NewWebSocketChannelImpl.cpp |
| index 7b056012a46a1b31e2b628f282b8c0e9336ebfc1..af0a6dcd7ee2e55a14ba887243543af89edeb7b8 100644 |
| --- a/Source/modules/websockets/NewWebSocketChannelImpl.cpp |
| +++ b/Source/modules/websockets/NewWebSocketChannelImpl.cpp |
| @@ -115,7 +115,6 @@ NewWebSocketChannelImpl::NewWebSocketChannelImpl(ExecutionContext* context, WebS |
| , m_identifier(0) |
| , m_sendingQuota(0) |
| , m_receivedDataSizeForFlowControl(receivedDataSizeForFlowControlHighWaterMark * 2) // initial quota |
| - , m_bufferedAmount(0) |
| , m_sentSizeOfTopMessage(0) |
| , m_sourceURLAtConstruction(sourceURL) |
| , m_lineNumberAtConstruction(lineNumber) |
| @@ -241,12 +240,6 @@ WebSocketChannel::SendResult NewWebSocketChannelImpl::send(PassOwnPtr<Vector<cha |
| return SendSuccess; |
| } |
| -unsigned long NewWebSocketChannelImpl::bufferedAmount() const |
| -{ |
| - WTF_LOG(Network, "NewWebSocketChannelImpl %p bufferedAmount()", this); |
| - return m_bufferedAmount; |
| -} |
| - |
| void NewWebSocketChannelImpl::close(int code, const String& reason) |
| { |
| WTF_LOG(Network, "NewWebSocketChannelImpl %p close(%d, %s)", this, code, reason.utf8().data()); |
| @@ -317,7 +310,7 @@ NewWebSocketChannelImpl::Message::Message(PassOwnPtr<Vector<char> > vectorData) |
| void NewWebSocketChannelImpl::sendInternal() |
| { |
| ASSERT(m_handle); |
| - unsigned long bufferedAmount = m_bufferedAmount; |
| + int64_t quota = m_sendingQuota; |
|
tyoshino (SeeGerritForStatus)
2014/06/16 02:29:29
quota and bufferedAmount are different concept. as
yhirano
2014/06/16 04:44:27
Done.
|
| while (!m_messages.isEmpty() && m_sendingQuota > 0 && !m_blobLoader) { |
| bool final = false; |
| Message* message = m_messages.first().get(); |
| @@ -362,8 +355,9 @@ void NewWebSocketChannelImpl::sendInternal() |
| m_sentSizeOfTopMessage = 0; |
| } |
| } |
| - if (m_client && m_bufferedAmount != bufferedAmount) { |
| - m_client->didUpdateBufferedAmount(m_bufferedAmount); |
| + if (m_client && quota != m_sendingQuota) { |
| + unsigned long diff = quota - m_sendingQuota; |
| + m_client->didConsumeBufferedAmount(diff); |
| } |
| } |
| @@ -395,7 +389,7 @@ void NewWebSocketChannelImpl::handleDidClose(bool wasClean, unsigned short code, |
| m_client = 0; |
| WebSocketChannelClient::ClosingHandshakeCompletionStatus status = |
| wasClean ? WebSocketChannelClient::ClosingHandshakeComplete : WebSocketChannelClient::ClosingHandshakeIncomplete; |
| - client->didClose(m_bufferedAmount, status, code, reason); |
| + client->didClose(status, code, reason); |
| // client->didClose may delete this object. |
| } |