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

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: Created 5 years, 2 months 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
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..3dfec5a02f67a532426ea9ee0ae3ddc9954390bf 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>::createOrNull<Float32Array>(array, length);
binji 2015/10/16 22:12:39 should be deprecatedCreateOrCrash?
Justin Novosad 2015/10/19 16:42:52 Acknowledged.
}
-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)

Powered by Google App Engine
This is Rietveld 408576698