Commit 58d83b49 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[arraybuffer] Clean up typed_array.h

1) Remove stale comments.
2) Remove an unnecessary implementation of GetType().
3) Add stub bodies for instances of Set() that should not be called.
   * Unfortunately I couldn't find a way to prevent calls to these
     functions at compile time.

R=haraken@chromium.org

Bug: chromium:1008840
Change-Id: Id54bf83656e846670a9c6b249fdf62d64733003e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1928785Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717638}
parent 9d6819cb
......@@ -34,8 +34,6 @@
namespace blink {
// Base class for all WebGL<T>Array types holding integral
// (non-floating-point) values.
template <typename T, bool clamped = false>
class TypedArray : public ArrayBufferView {
public:
......@@ -153,11 +151,6 @@ inline void TypedArray<double, false>::Set(unsigned index, double value) {
Data()[index] = value;
}
template <typename T, bool clamped>
inline void TypedArray<T, clamped>::Set(unsigned index, uint64_t value) {
NOTREACHED();
}
template <>
inline void TypedArray<int64_t, false>::Set(unsigned index, uint64_t value) {
if (index >= length_)
......@@ -172,10 +165,25 @@ inline void TypedArray<uint64_t, false>::Set(unsigned index, uint64_t value) {
Data()[index] = value;
}
template <>
inline void TypedArray<int64_t, false>::Set(unsigned index, double value) {
// This version of {Set} is not supposed to be used for a TypedArray of type
// int64_t.
NOTREACHED();
}
template <>
inline void TypedArray<uint64_t, false>::Set(unsigned index, double value) {
// This version of {Set} is not supposed to be used for a TypedArray of type
// uint64_t.
NOTREACHED();
}
template <typename T, bool clamped>
inline ArrayBufferView::ViewType TypedArray<T, clamped>::GetType() const {
inline void TypedArray<T, clamped>::Set(unsigned index, uint64_t value) {
// This version of {Set} is only supposed to be used for a TypedArrays of type
// int64_t or uint64_t.
NOTREACHED();
return ArrayBufferView::kTypeInt16;
}
#define FOREACH_VIEW_TYPE(V) \
......
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