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

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

Powered by Google App Engine
This is Rietveld 408576698