Commit 6bf1b472 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[arraybuffer] Remove dead code

I removed the declaration of two functions where I deleted the
definition recently.

Drive-by: I also changed the implementation of ByteLengthAsUnsigned to
use a checked_cast now. I was not aware of checked_cast back when I did
the change originally.

R=haraken@chromium.org

Bug: chromium:1008840
Change-Id: I8863115c06b44d1c04e8bb71df93709a25012e4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947740Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721416}
parent 060bb849
...@@ -77,10 +77,6 @@ class CORE_EXPORT ArrayBuffer : public RefCounted<ArrayBuffer> { ...@@ -77,10 +77,6 @@ class CORE_EXPORT ArrayBuffer : public RefCounted<ArrayBuffer> {
// instead. // instead.
inline unsigned ByteLengthAsUnsigned() const; inline unsigned ByteLengthAsUnsigned() const;
// Creates a new ArrayBuffer object with copy of bytes in this object
// ranging from |begin| up to but not including |end|.
inline scoped_refptr<ArrayBuffer> Slice(unsigned begin, unsigned end) const;
void AddView(ArrayBufferView*); void AddView(ArrayBufferView*);
void RemoveView(ArrayBufferView*); void RemoveView(ArrayBufferView*);
...@@ -110,8 +106,6 @@ class CORE_EXPORT ArrayBuffer : public RefCounted<ArrayBuffer> { ...@@ -110,8 +106,6 @@ class CORE_EXPORT ArrayBuffer : public RefCounted<ArrayBuffer> {
size_t element_byte_size, size_t element_byte_size,
ArrayBufferContents::InitializationPolicy); ArrayBufferContents::InitializationPolicy);
inline unsigned ClampIndex(unsigned index) const;
ArrayBufferContents contents_; ArrayBufferContents contents_;
ArrayBufferView* first_view_; ArrayBufferView* first_view_;
bool is_detached_; bool is_detached_;
...@@ -246,12 +240,10 @@ size_t ArrayBuffer::ByteLengthAsSizeT() const { ...@@ -246,12 +240,10 @@ size_t ArrayBuffer::ByteLengthAsSizeT() const {
// This function is deprecated and should not be used. Use {ByteLengthAsSizeT} // This function is deprecated and should not be used. Use {ByteLengthAsSizeT}
// instead. // instead.
unsigned ArrayBuffer::ByteLengthAsUnsigned() const { unsigned ArrayBuffer::ByteLengthAsUnsigned() const {
CHECK_LE(contents_.DataLength(),
static_cast<size_t>(std::numeric_limits<unsigned>::max()));
// TODO(dtapuska): Revisit this cast. ArrayBufferContents // TODO(dtapuska): Revisit this cast. ArrayBufferContents
// uses size_t for storing data. Whereas ArrayBuffer IDL is // uses size_t for storing data. Whereas ArrayBuffer IDL is
// only uint32_t based. // only uint32_t based.
return static_cast<unsigned>(contents_.DataLength()); return base::checked_cast<unsigned>(contents_.DataLength());
} }
} // namespace blink } // namespace blink
......
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