Chromium Code Reviews| Index: Source/modules/websockets/DOMWebSocket.cpp |
| diff --git a/Source/modules/websockets/DOMWebSocket.cpp b/Source/modules/websockets/DOMWebSocket.cpp |
| index 4ac91877ab57d6ddc6489c4b69561437e3c8307c..a95e3d767d6ab8afcf11c78bb2020cb36438bfa1 100644 |
| --- a/Source/modules/websockets/DOMWebSocket.cpp |
| +++ b/Source/modules/websockets/DOMWebSocket.cpp |
| @@ -205,10 +205,10 @@ static String joinStrings(const Vector<String>& strings, const char* separator) |
| return builder.toString(); |
| } |
| -static unsigned long saturateAdd(unsigned long a, unsigned long b) |
|
tyoshino (SeeGerritForStatus)
2014/11/17 14:15:32
please leave the second argument type "unsigned lo
Paritosh Kumar
2014/11/18 09:38:44
Thanks
Done.
|
| +static unsigned saturateAdd(unsigned a, unsigned b) |
| { |
| - if (std::numeric_limits<unsigned long>::max() - a < b) |
| - return std::numeric_limits<unsigned long>::max(); |
| + if (std::numeric_limits<unsigned>::max() - a < b) |
| + return std::numeric_limits<unsigned>::max(); |
| return a + b; |
| } |
| @@ -349,7 +349,7 @@ void DOMWebSocket::connect(const String& url, const Vector<String>& protocols, E |
| } |
| } |
| -void DOMWebSocket::updateBufferedAmountAfterClose(unsigned long payloadSize) |
|
tyoshino (SeeGerritForStatus)
2014/11/17 14:15:32
please leave this unchanged
Paritosh Kumar
2014/11/18 09:38:44
Done.
|
| +void DOMWebSocket::updateBufferedAmountAfterClose(unsigned payloadSize) |
| { |
| m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize); |
| m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize)); |
| @@ -500,7 +500,7 @@ DOMWebSocket::State DOMWebSocket::readyState() const |
| return m_state; |
| } |
| -unsigned long DOMWebSocket::bufferedAmount() const |
| +unsigned DOMWebSocket::bufferedAmount() const |
| { |
| return saturateAdd(m_bufferedAmount, m_bufferedAmountAfterClose); |
| } |