Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(599)

Unified Diff: third_party/WebKit/Source/wtf/Float32Array.h

Issue 1414553002: Fix out-of-memory crashes related to ArrayBuffer allocation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+more tweaks Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/ArrayBufferContents.cpp ('k') | third_party/WebKit/Source/wtf/Float64Array.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/Float32Array.h
diff --git a/third_party/WebKit/Source/wtf/Float32Array.h b/third_party/WebKit/Source/wtf/Float32Array.h
index 25bec0542bd22e0fb23e2aabdee292ebe0cfec50..ea1aa5a79d9e7d3c3786d93292837b6ef1b08e6b 100644
--- a/third_party/WebKit/Source/wtf/Float32Array.h
+++ b/third_party/WebKit/Source/wtf/Float32Array.h
@@ -34,10 +34,9 @@ namespace WTF {
class Float32Array final : public TypedArrayBase<float> {
public:
- static inline PassRefPtr<Float32Array> create(unsigned length);
- static inline PassRefPtr<Float32Array> create(const float* array, unsigned length);
static inline PassRefPtr<Float32Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
-
+ static inline PassRefPtr<Float32Array> createOrNull(const float* array, unsigned length);
+ static inline PassRefPtr<Float32Array> deprecatedCreateOrCrash(const float* array, unsigned length); // Prefer createOrNull
static inline PassRefPtr<Float32Array> createOrNull(unsigned length);
using TypedArrayBase<float>::set;
@@ -60,24 +59,24 @@ private:
friend class TypedArrayBase<float>;
};
-PassRefPtr<Float32Array> Float32Array::create(unsigned length)
+PassRefPtr<Float32Array> Float32Array::createOrNull(unsigned length)
{
- return TypedArrayBase<float>::create<Float32Array>(length);
+ return TypedArrayBase<float>::createOrNull<Float32Array>(length);
}
-PassRefPtr<Float32Array> Float32Array::create(const float* array, unsigned length)
+PassRefPtr<Float32Array> Float32Array::createOrNull(const float* array, unsigned length)
{
- return TypedArrayBase<float>::create<Float32Array>(array, length);
+ return TypedArrayBase<float>::createOrNull<Float32Array>(array, length);
}
-PassRefPtr<Float32Array> Float32Array::create(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
+PassRefPtr<Float32Array> Float32Array::deprecatedCreateOrCrash(const float* array, unsigned length)
{
- return TypedArrayBase<float>::create<Float32Array>(buffer, byteOffset, length);
+ return TypedArrayBase<float>::deprecatedCreateOrCrash<Float32Array>(array, length);
}
-PassRefPtr<Float32Array> Float32Array::createOrNull(unsigned length)
+PassRefPtr<Float32Array> Float32Array::create(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
{
- return TypedArrayBase<float>::createOrNull<Float32Array>(length);
+ return TypedArrayBase<float>::create<Float32Array>(buffer, byteOffset, length);
}
Float32Array::Float32Array(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
« no previous file with comments | « third_party/WebKit/Source/wtf/ArrayBufferContents.cpp ('k') | third_party/WebKit/Source/wtf/Float64Array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698