OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef TypedFlexibleArrayBufferView_h | |
6 #define TypedFlexibleArrayBufferView_h | |
7 | |
8 #include "core/CoreExport.h" | |
9 #include "core/dom/FlexibleArrayBufferView.h" | |
10 #include "wtf/Noncopyable.h" | |
11 | |
12 namespace blink { | |
13 | |
14 template<typename WTFTypedArray> | |
15 class CORE_TEMPLATE_CLASS_EXPORT TypedFlexibleArrayBufferView final : public Fle xibleArrayBufferView { | |
16 DISALLOW_ALLOCATION(); | |
17 WTF_MAKE_NONCOPYABLE(TypedFlexibleArrayBufferView); | |
haraken
2015/07/30 14:54:57
Add WTF_MAKE_FAST_ALLOCATED.
Michael Lippautz
2015/07/30 17:06:15
STACK_ALLOCATED() (?)
| |
18 public: | |
19 typedef typename WTFTypedArray::ValueType ValueType; | |
haraken
2015/07/30 14:54:57
Use 'using'.
Michael Lippautz
2015/07/30 17:06:15
Done.
| |
20 | |
21 TypedFlexibleArrayBufferView() : FlexibleArrayBufferView() {} | |
22 | |
23 ValueType* data() const { return static_cast<ValueType*>(baseAddress()); } | |
haraken
2015/07/30 14:54:57
I'd rename this to dataMaybeOnStack() or something
Michael Lippautz
2015/07/30 17:06:15
Done.
| |
24 unsigned length() const { return byteLength() / sizeof(ValueType); } | |
25 }; | |
26 | |
27 typedef TypedFlexibleArrayBufferView<WTF::Float32Array> FlexibleFloat32ArrayView ; | |
28 typedef TypedFlexibleArrayBufferView<WTF::Int32Array> FlexibleInt32ArrayView; | |
haraken
2015/07/30 14:54:57
Blink prefers 'using' in the new coding style.
Michael Lippautz
2015/07/30 17:06:15
Done.
| |
29 | |
30 } // namespace blink | |
31 | |
32 #endif // TypedFlexibleArrayBufferView_h | |
OLD | NEW |