Commit b450ddb8 authored by Adam Rice's avatar Adam Rice Committed by Commit Bot

Make bufferedAmount unsigned long long

WebSocket bufferedAmount is defined in the HTML standard as being
unsigned long long
(https://html.spec.whatwg.org/#the-websocket-interface), but Blink has
been using "unsigned long" for this value.

Change to "unsigned long long". This also permits us to remove the check
for overflow.

BUG=631004

Change-Id: I6c6cc356d9b3c425306376e210b9df7a3be13998
Reviewed-on: https://chromium-review.googlesource.com/1037105
Commit-Queue: Adam Rice <ricea@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557114}
parent acb27cdd
......@@ -586,12 +586,10 @@ DOMWebSocket::State DOMWebSocket::readyState() const {
return state_;
}
unsigned DOMWebSocket::bufferedAmount() const {
uint64_t sum = buffered_amount_after_close_ + buffered_amount_;
if (sum > std::numeric_limits<unsigned>::max())
return std::numeric_limits<unsigned>::max();
return sum;
uint64_t DOMWebSocket::bufferedAmount() const {
// TODO(ricea): Check for overflow once machines with exabytes of RAM become
// commonplace.
return buffered_amount_after_close_ + buffered_amount_;
}
String DOMWebSocket::protocol() const {
......
......@@ -103,7 +103,7 @@ class MODULES_EXPORT DOMWebSocket : public EventTargetWithInlineData,
const KURL& url() const;
State readyState() const;
unsigned bufferedAmount() const;
uint64_t bufferedAmount() const;
String protocol() const;
String extensions() const;
......
......@@ -49,7 +49,7 @@ enum BinaryType { "blob", "arraybuffer" };
const unsigned short CLOSING = 2;
const unsigned short CLOSED = 3;
readonly attribute unsigned short readyState;
readonly attribute unsigned long bufferedAmount;
readonly attribute unsigned long long bufferedAmount;
// networking
attribute EventHandler onopen;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment