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

Unified Diff: third_party/WebKit/Source/wtf/Uint16Array.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/TypedArrayBase.h ('k') | third_party/WebKit/Source/wtf/Uint32Array.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/Uint16Array.h
diff --git a/third_party/WebKit/Source/wtf/Uint16Array.h b/third_party/WebKit/Source/wtf/Uint16Array.h
index 26645fe0f51068363c21108422b8884c0acbe743..d16457abdbfc9049c38225e74b607e3f4032087e 100644
--- a/third_party/WebKit/Source/wtf/Uint16Array.h
+++ b/third_party/WebKit/Source/wtf/Uint16Array.h
@@ -35,8 +35,9 @@ class ArrayBuffer;
class Uint16Array final : public IntegralTypedArrayBase<unsigned short> {
public:
- static inline PassRefPtr<Uint16Array> create(unsigned length);
- static inline PassRefPtr<Uint16Array> create(const unsigned short* array, unsigned length);
+ static inline PassRefPtr<Uint16Array> createOrNull(unsigned length);
+ static inline PassRefPtr<Uint16Array> createOrNull(const unsigned short* array, unsigned length);
+ static inline PassRefPtr<Uint16Array> deprecatedCreateOrCrash(const unsigned short* array, unsigned length);
static inline PassRefPtr<Uint16Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
using TypedArrayBase<unsigned short>::set;
@@ -53,14 +54,19 @@ private:
friend class TypedArrayBase<unsigned short>;
};
-PassRefPtr<Uint16Array> Uint16Array::create(unsigned length)
+PassRefPtr<Uint16Array> Uint16Array::createOrNull(unsigned length)
{
- return TypedArrayBase<unsigned short>::create<Uint16Array>(length);
+ return TypedArrayBase<unsigned short>::createOrNull<Uint16Array>(length);
}
-PassRefPtr<Uint16Array> Uint16Array::create(const unsigned short* array, unsigned length)
+PassRefPtr<Uint16Array> Uint16Array::createOrNull(const unsigned short* array, unsigned length)
{
- return TypedArrayBase<unsigned short>::create<Uint16Array>(array, length);
+ return TypedArrayBase<unsigned short>::createOrNull<Uint16Array>(array, length);
+}
+
+PassRefPtr<Uint16Array> Uint16Array::deprecatedCreateOrCrash(const unsigned short* array, unsigned length)
+{
+ return TypedArrayBase<unsigned short>::deprecatedCreateOrCrash<Uint16Array>(array, length);
}
PassRefPtr<Uint16Array> Uint16Array::create(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
« no previous file with comments | « third_party/WebKit/Source/wtf/TypedArrayBase.h ('k') | third_party/WebKit/Source/wtf/Uint32Array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698